Skip to content

Commit 77f6497

Browse files
mscolnickakshayka
andauthored
docs: v2 (marimo-team#3205)
Co-authored-by: Akshay Agrawal <[email protected]>
1 parent 452b95e commit 77f6497

File tree

118 files changed

+2218
-2402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+2218
-2402
lines changed

docs/Makefile

-20
This file was deleted.

docs/__init__.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"""Marimo documentation package."""
2+
3+
from . import macros # noqa: F401
4+
from . import blocks # noqa: F401
5+
6+
__all__ = ["macros", "blocks"]

docs/api/app.md

+5-13
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
# App
22

3-
```{eval-rst}
4-
.. autoclass:: marimo.App
5-
6-
.. automethod:: marimo.App.embed
7-
```
3+
::: marimo.App
4+
options:
5+
members:
6+
- embed
87

98
## AppMeta
109

11-
```{eval-rst}
12-
.. currentmodule:: marimo
13-
14-
.. autoclass:: app_meta()
15-
16-
.. automethod:: marimo._runtime.app_meta.AppMeta.theme
17-
.. automethod:: marimo._runtime.app_meta.AppMeta.mode
18-
```
10+
::: marimo.app_meta

docs/api/caching.md

+7-18
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,8 @@ associated with the cached function, which makes you more productive while devel
1919

2020
For a cache with bounded size, use [`mo.lru_cache`](#marimo.lru_cache).
2121

22-
23-
```{eval-rst}
24-
.. autofunction:: marimo.cache
25-
```
26-
27-
```{eval-rst}
28-
.. autofunction:: marimo.lru_cache
29-
```
22+
::: marimo.cache
23+
::: marimo.lru_cache
3024

3125
## Caching variables to disk
3226

@@ -35,14 +29,9 @@ code to disk. The next time this block of code is run, if marimo detects a
3529
cache hit, the code will be skipped and your variables will be loaded into
3630
memory, letting you pick up where you left off.
3731

38-
```{admonition} Cache location
39-
:class: tip
40-
41-
By default, caches are stored in `__marimo__/cache/`, in the directory of the
42-
current notebook. For projects versioned with `git`, consider adding
43-
`**/__marimo__/cache/` to your `.gitignore`.
44-
```
32+
!!! tip "Cache location"
33+
By default, caches are stored in `__marimo__/cache/`, in the directory of the
34+
current notebook. For projects versioned with `git`, consider adding
35+
`**/__marimo__/cache/` to your `.gitignore`.
4536

46-
```{eval-rst}
47-
.. autofunction:: marimo.persistent_cache
48-
```
37+
::: marimo.persistent_cache

docs/api/cell.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
# Cell
22

3-
```{eval-rst}
4-
.. autoclass:: marimo.Cell
5-
:members:
6-
7-
.. autoclasstoc::
8-
```
3+
::: marimo.Cell

docs/api/cli_args.md

+4-9
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,8 @@ python notebook.py -- --arg1 10.5 --arg2 hello --arg2 world
2323
In each example, `python` can be replaced as `marimo run` (for running as
2424
an app) or `marimo edit` (for running as a notebook).
2525

26-
```{eval-rst}
27-
.. autofunction:: marimo.cli_args
28-
```
29-
30-
```{admonition} Query Parameters
31-
:class: note
26+
::: marimo.cli_args
3227

33-
You can also access query parameters passed to the notebook using
34-
`mo.query_params`. This allows you to pass arguments to the notebook that can be controlled by the user.
35-
```
28+
!!! note "Query Parameters"
29+
You can also access query parameters passed to the notebook using
30+
`mo.query_params`. This allows you to pass arguments to the notebook that can be controlled by the user.

docs/api/control_flow.md

+2-14
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,9 @@
33
Use `mo.stop` to halt execution of a cell, and optionally output an object.
44
This function is useful for validating user input.
55

6-
```{eval-rst}
7-
.. autofunction:: marimo.stop
8-
```
9-
10-
```{eval-rst}
11-
.. autoclass:: marimo.MarimoStopError
12-
```
6+
::: marimo.stop
137

148
Use `mo.ui.refresh` to trigger other cells to run periodically, on a configurable
159
interval (or on click).
1610

17-
```{eval-rst}
18-
.. autoclass:: marimo.ui.refresh
19-
:members:
20-
:noindex:
21-
22-
.. autoclasstoc:: marimo._plugins.ui._impl.refresh.refresh
23-
```
11+
::: marimo.ui.refresh

docs/api/diagrams.md

+10-27
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,17 @@
11
# Diagrams
22

3-
```{eval-rst}
4-
.. marimo-embed::
5-
:size: medium
3+
/// marimo-embed
4+
size: medium
65

7-
@app.cell
8-
def __():
9-
mo.mermaid("graph TD\n A[Christmas] -->|Get money| B(Go shopping)\n B --> C{Let me think}\n C -->|One| D[Laptop]\n C -->|Two| E[iPhone]\n C -->|Three| F[Car]")
10-
return
6+
```python
7+
@app.cell
8+
def __():
9+
mo.mermaid("graph TD\n A[Christmas] -->|Get money| B(Go shopping)\n B --> C{Let me think}\n C -->|One| D[Laptop]\n C -->|Two| E[iPhone]\n C -->|Three| F[Car]")
10+
return
1111
```
1212

13-
## Mermaid diagrams
14-
15-
```{eval-rst}
16-
.. autofunction:: marimo.mermaid
17-
```
18-
19-
## Statistic cards
13+
///
2014

21-
```{eval-rst}
22-
.. marimo-embed::
23-
@app.cell
24-
def __():
25-
mo.hstack([
26-
mo.stat(value="100.54", label="Open price", caption="2.4", direction="increase", bordered=True),
27-
mo.stat(value="100.54", label="Close price", caption="2.4", direction="decrease", bordered=True),
28-
])
29-
return
30-
```
15+
## Mermaid diagrams
3116

32-
```{eval-rst}
33-
.. autofunction:: marimo.stat
34-
```
17+
::: marimo.mermaid

docs/api/html.md

+3-12
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,8 @@
22

33
All marimo elements extend the HTML element class.
44

5-
```{eval-rst}
6-
.. autofunction:: marimo.as_html
7-
```
5+
::: marimo.as_html
86

9-
```{eval-rst}
10-
.. autoclass:: marimo.Html
11-
:members:
7+
::: marimo.Html
128

13-
.. autoclasstoc::
14-
```
15-
16-
```{eval-rst}
17-
.. autofunction:: marimo.iframe
18-
```
9+
::: marimo.iframe

docs/api/index.md

+17-41
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,5 @@
11
# API Reference
22

3-
```{eval-rst}
4-
.. toctree::
5-
:maxdepth: 1
6-
:hidden:
7-
8-
markdown
9-
inputs/index
10-
layouts/index
11-
plotting
12-
media/index
13-
diagrams
14-
status
15-
outputs
16-
control_flow
17-
html
18-
query_params
19-
cli_args
20-
caching
21-
state
22-
app
23-
cell
24-
miscellaneous
25-
```
26-
273
Use the marimo library in marimo notebooks (`import marimo as mo`) to
284

295
- connect interactive inputs like sliders, dropdowns, and tables to Python,
@@ -34,20 +10,20 @@ Use the marimo library in marimo notebooks (`import marimo as mo`) to
3410

3511
| | |
3612
| :------------------- | :-------------------------------------------------------- |
37-
| {doc}`markdown` | Write markdown with `mo.md` |
38-
| {doc}`inputs/index` | Connect sliders, dropdowns, tables, and more to Python |
39-
| {doc}`layouts/index` | Customize outputs with accordions, tabs, stacks, and more |
40-
| {doc}`plotting` | Output interactive plots |
41-
| {doc}`media/index` | Output media like images, audio, PDFs, and plain text |
42-
| {doc}`diagrams` | Flow charts, graphs, statistic cards, and more |
43-
| {doc}`status` | Display progress indicators |
44-
| {doc}`outputs` | Modify cell outputs, redirect console output |
45-
| {doc}`control_flow` | Control how cells execute |
46-
| {doc}`html` | Manipulate HTML objects |
47-
| {doc}`query_params` | Access and set query parameters with `mo.query_params` |
48-
| {doc}`cli_args` | Access command-line arguments with `mo.cli_args` |
49-
| {doc}`caching` | Cache expensive computations in memory or on disk |
50-
| {doc}`state` | Synchronize multiple UI elements with `mo.state` |
51-
| {doc}`app` | Embed notebooks in other notebooks |
52-
| {doc}`cell` | Run cells defined in another notebook |
53-
| {doc}`miscellaneous` | Miscellaneous utilities |
13+
| [markdown](markdown.md) | Write markdown with `mo.md` |
14+
| [inputs](inputs/index.md) | Connect sliders, dropdowns, tables, and more to Python |
15+
| [layouts](layouts/index.md) | Customize outputs with accordions, tabs, stacks, and more |
16+
| [plotting](plotting.md) | Output interactive plots |
17+
| [media](media/index.md) | Output media like images, audio, PDFs, and plain text |
18+
| [diagrams](diagrams.md) | Flow charts, graphs, statistic cards, and more |
19+
| [status](status.md) | Display progress indicators |
20+
| [outputs](outputs.md) | Modify cell outputs, redirect console output |
21+
| [control_flow](control_flow.md) | Control how cells execute |
22+
| [html](html.md) | Manipulate HTML objects |
23+
| [query_params](query_params.md) | Access and set query parameters with `mo.query_params` |
24+
| [cli_args](cli_args.md) | Access command-line arguments with `mo.cli_args` |
25+
| [caching](caching.md) | Cache expensive computations in memory or on disk |
26+
| [state](state.md) | Synchronize multiple UI elements with `mo.state` |
27+
| [app](app.md) | Embed notebooks in other notebooks |
28+
| [cell](cell.md) | Run cells defined in another notebook |
29+
| [miscellaneous](miscellaneous.md) | Miscellaneous utilities |

docs/api/inputs/anywidget.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# Building custom UI elements
23

34
Build custom UI plugins that hook into marimo's reactive
@@ -86,9 +87,4 @@ widget.count
8687

8788
---
8889

89-
```{eval-rst}
90-
.. autoclass:: marimo.ui.anywidget
91-
:members:
92-
93-
.. autoclasstoc:: marimo._plugins.ui._impl.from_anywidget.anywidget
94-
```
90+
::: marimo.ui.anywidget

docs/api/inputs/array.md

+14-16
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
# Array
22

3-
```{eval-rst}
4-
.. marimo-embed::
5-
@app.cell
6-
def __():
7-
wish = mo.ui.text(placeholder="Wish")
8-
wishes = mo.ui.array([wish] * 3, label="Three wishes")
9-
return
3+
/// marimo-embed
104

11-
@app.cell
12-
def __():
13-
mo.hstack([wishes, wishes.value], justify="space-between")
14-
return
5+
```python
6+
@app.cell
7+
def __():
8+
wish = mo.ui.text(placeholder="Wish")
9+
wishes = mo.ui.array([wish] * 3, label="Three wishes")
10+
return
11+
12+
@app.cell
13+
def __():
14+
mo.hstack([wishes, wishes.value], justify="space-between")
15+
return
1516
```
1617

17-
```{eval-rst}
18-
.. autoclass:: marimo.ui.array
19-
:members:
18+
///
2019

21-
.. autoclasstoc:: marimo._plugins.ui._impl.array.array
22-
```
20+
::: marimo.ui.array

docs/api/inputs/batch.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Batch
22

3-
```{eval-rst}
4-
.. marimo-embed::
3+
/// marimo-embed
4+
5+
```python
56
@app.cell
67
def __():
78
el = mo.md("{start}{end}").batch(
@@ -17,9 +18,6 @@
1718
return
1819
```
1920

20-
```{eval-rst}
21-
.. autoclass:: marimo.ui.batch
22-
:members:
21+
///
2322

24-
.. autoclasstoc:: marimo._plugins.ui._impl.batch.batch
25-
```
23+
::: marimo.ui.batch

docs/api/inputs/button.md

+11-16
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
11
# Button
22

3-
```{admonition} Looking for a submit/run button?
4-
:class: tip
3+
!!! tip "Looking for a submit/run button?"
4+
If you're looking for a button to trigger computation on click, consider
5+
using [`mo.ui.run_button`](../api/inputs/run_button.md).
56

6-
If you're looking for a button to trigger computation on click, consider
7-
using [`mo.ui.run_button`](/api/inputs/run_button.md).
8-
```
7+
/// marimo-embed
98

10-
```{eval-rst}
11-
.. marimo-embed::
12-
@app.cell
13-
def __():
14-
mo.ui.button(label="Click me")
15-
return
9+
```python
10+
@app.cell
11+
def __():
12+
mo.ui.button(label="Click me")
13+
return
1614
```
1715

18-
```{eval-rst}
19-
.. autoclass:: marimo.ui.button
20-
:members:
16+
///
2117

22-
.. autoclasstoc:: marimo._plugins.ui._impl.input.button
23-
```
18+
::: marimo.ui.button

0 commit comments

Comments
 (0)