Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

docs: add documentation for mo.outline widget (#6468)

Myles Scolnicke9f2f0e9afcd
diff --git a/docs/api/layouts/index.md b/docs/api/layouts/index.md
index 87fcd902ad..b56c69e731 100644
--- a/docs/api/layouts/index.md
+++ b/docs/api/layouts/index.md
@@ -18,6 +18,7 @@ them but just render their children in a certain way.
| [`marimo.lazy`][marimo.lazy] | Lazy load content |
| [`marimo.left`][marimo.left] | Left-align content |
| [`marimo.nav_menu`][marimo.nav_menu] | Create navigation menus |
+| [`marimo.outline`][marimo.outline] | Display table of contents outline |
| [`marimo.plain`][marimo.plain] | Display content without styling |
| [`marimo.right`][marimo.right] | Right-align content |
| [`marimo.routes`][marimo.routes] | Create page routing |
diff --git a/docs/api/layouts/outline.md b/docs/api/layouts/outline.md
new file mode 100644
index 0000000000..a2fc14f73c
--- /dev/null
+++ b/docs/api/layouts/outline.md
@@ -0,0 +1,24 @@
+# Outline
+
+/// marimo-embed
+
+```python
+def __():
+ mo.md("# Header 1")
+ return
+
+def __():
+ mo.md("## Header 2")
+ return
+
+def __():
+ mo.outline(label="Table of Contents")
+ return
+```
+
+///
+
+::: marimo.outline
\ No newline at end of file
diff --git a/mkdocs.yml b/mkdocs.yml
index 1f80ac7c2d..0a9a01adcf 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -232,6 +232,7 @@ nav:
- Json: api/layouts/json.md
- Justify: api/layouts/justify.md
- Lazy: api/layouts/lazy.md
+ - Outline: api/layouts/outline.md
- Plain: api/layouts/plain.md
- Routes: api/layouts/routes.md
- Sidebar: api/layouts/sidebar.md