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.
Python artificial-intelligencedagdata-sciencedata-visualizationdataflowdeveloper-toolsmachine-learningnotebookspipelinepythonreactivesqlweb-app
docs: v2 (#3205)
Myles Scolnick77f64978f2f9
diff --git a/docs/Makefile b/docs/Makefiledeleted file mode 100644index d4bb2cbb9e..0000000000--- a/docs/Makefile+++ /dev/null@@ -1,20 +0,0 @@-# Minimal makefile for Sphinx documentation-#--# You can set these variables from the command line, and also-# from the environment for the first two.-SPHINXOPTS ?=-SPHINXBUILD ?= sphinx-build-SOURCEDIR = .-BUILDDIR = _build--# Put it first so that "make" without argument is like "make help".-help:- @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)--.PHONY: help Makefile--# Catch-all target: route all unknown targets to Sphinx using the new-# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).-%: Makefile- @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)diff --git a/docs/__init__.py b/docs/__init__.pynew file mode 100644index 0000000000..6f3288e1b9--- /dev/null+++ b/docs/__init__.py@@ -0,0 +1,6 @@+"""Marimo documentation package."""++from . import macros # noqa: F401+from . import blocks # noqa: F401++__all__ = ["macros", "blocks"]diff --git a/docs/api/app.md b/docs/api/app.mdindex fc2f349c31..1f26340261 100644--- a/docs/api/app.md+++ b/docs/api/app.md@@ -1,18 +1,10 @@# App-```{eval-rst}-.. autoclass:: marimo.App-- .. automethod:: marimo.App.embed-```+::: marimo.App+ options:+ members:+ - embed## AppMeta-```{eval-rst}-.. currentmodule:: marimo--.. autoclass:: app_meta()-- .. automethod:: marimo._runtime.app_meta.AppMeta.theme- .. automethod:: marimo._runtime.app_meta.AppMeta.mode-```+::: marimo.app_metadiff --git a/docs/api/caching.md b/docs/api/caching.mdindex 5dcd037b4c..28b7616c52 100644--- a/docs/api/caching.md+++ b/docs/api/caching.md@@ -19,14 +19,8 @@ associated with the cached function, which makes you more productive while develFor a cache with bounded size, use [`mo.lru_cache`](#marimo.lru_cache).--```{eval-rst}-.. autofunction:: marimo.cache-```--```{eval-rst}-.. autofunction:: marimo.lru_cache-```+::: marimo.cache+::: marimo.lru_cache## Caching variables to disk@@ -35,14 +29,9 @@ code to disk. The next time this block of code is run, if marimo detects acache hit, the code will be skipped and your variables will be loaded intomemory, letting you pick up where you left off.-```{admonition} Cache location-:class: tip--By default, caches are stored in `__marimo__/cache/`, in the directory of the-current notebook. For projects versioned with `git`, consider adding-`**/__marimo__/cache/` to your `.gitignore`.-```+!!! tip "Cache location"+ By default, caches are stored in `__marimo__/cache/`, in the directory of the+ current notebook. For projects versioned with `git`, consider adding+ `**/__marimo__/cache/` to your `.gitignore`.-```{eval-rst}-.. autofunction:: marimo.persistent_cache-```+::: marimo.persistent_cachediff --git a/docs/api/cell.md b/docs/api/cell.mdindex f5350e8137..6db3bc910f 100644--- a/docs/api/cell.md+++ b/docs/api/cell.md@@ -1,8 +1,3 @@# Cell-```{eval-rst}-.. autoclass:: marimo.Cell- :members:-- .. autoclasstoc::-```+::: marimo.Celldiff --git a/docs/api/cli_args.md b/docs/api/cli_args.mdindex 8705245bea..0e9c1a5aa2 100644--- a/docs/api/cli_args.md+++ b/docs/api/cli_args.md@@ -23,13 +23,8 @@ python notebook.py -- --arg1 10.5 --arg2 hello --arg2 worldIn each example, `python` can be replaced as `marimo run` (for running asan app) or `marimo edit` (for running as a notebook).-```{eval-rst}-.. autofunction:: marimo.cli_args-```--```{admonition} Query Parameters-:class: note+::: marimo.cli_args-You can also access query parameters passed to the notebook using-`mo.query_params`. This allows you to pass arguments to the notebook that can be controlled by the user.-```+!!! note "Query Parameters"+ You can also access query parameters passed to the notebook using+ `mo.query_params`. This allows you to pass arguments to the notebook that can be controlled by the user.diff --git a/docs/api/control_flow.md b/docs/api/control_flow.mdindex 60d2aa2d22..dccb554349 100644--- a/docs/api/control_flow.md+++ b/docs/api/control_flow.md@@ -3,21 +3,9 @@Use `mo.stop` to halt execution of a cell, and optionally output an object.This function is useful for validating user input.-```{eval-rst}-.. autofunction:: marimo.stop-```--```{eval-rst}-.. autoclass:: marimo.MarimoStopError-```+::: marimo.stopUse `mo.ui.refresh` to trigger other cells to run periodically, on a configurableinterval (or on click).-```{eval-rst}-.. autoclass:: marimo.ui.refresh- :members:- :noindex:-- .. autoclasstoc:: marimo._plugins.ui._impl.refresh.refresh-```+::: marimo.ui.refreshdiff --git a/docs/api/diagrams.md b/docs/api/diagrams.mdindex a8445847f4..259115c4c2 100644--- a/docs/api/diagrams.md+++ b/docs/api/diagrams.md@@ -1,34 +1,17 @@# Diagrams-```{eval-rst}-.. marimo-embed::- :size: medium+/// marimo-embed+ size: medium- @app.cell- def __():- 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]")- return+```python+def __():+ 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]")+ return```-## Mermaid diagrams--```{eval-rst}-.. autofunction:: marimo.mermaid-```--## Statistic cards+///-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- mo.hstack([- mo.stat(value="100.54", label="Open price", caption="2.4", direction="increase", bordered=True),- mo.stat(value="100.54", label="Close price", caption="2.4", direction="decrease", bordered=True),- ])- return-```+## Mermaid diagrams-```{eval-rst}-.. autofunction:: marimo.stat-```+::: marimo.mermaiddiff --git a/docs/api/html.md b/docs/api/html.mdindex f0e851c452..8854909c8b 100644--- a/docs/api/html.md+++ b/docs/api/html.md@@ -2,17 +2,8 @@All marimo elements extend the HTML element class.-```{eval-rst}-.. autofunction:: marimo.as_html-```+::: marimo.as_html-```{eval-rst}-.. autoclass:: marimo.Html- :members:+::: marimo.Html- .. autoclasstoc::-```--```{eval-rst}-.. autofunction:: marimo.iframe-```+::: marimo.iframediff --git a/docs/api/index.md b/docs/api/index.mdindex 68e0c65fd0..4d8f6b3c5c 100644--- a/docs/api/index.md+++ b/docs/api/index.md@@ -1,29 +1,5 @@# API Reference-```{eval-rst}-.. toctree::- :maxdepth: 1- :hidden:-- markdown- inputs/index- layouts/index- plotting- media/index- diagrams- status- outputs- control_flow- html- query_params- cli_args- caching- state- app- cell- miscellaneous-```-Use the marimo library in marimo notebooks (`import marimo as mo`) to- 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| | || :------------------- | :-------------------------------------------------------- |-| {doc}`markdown` | Write markdown with `mo.md` |-| {doc}`inputs/index` | Connect sliders, dropdowns, tables, and more to Python |-| {doc}`layouts/index` | Customize outputs with accordions, tabs, stacks, and more |-| {doc}`plotting` | Output interactive plots |-| {doc}`media/index` | Output media like images, audio, PDFs, and plain text |-| {doc}`diagrams` | Flow charts, graphs, statistic cards, and more |-| {doc}`status` | Display progress indicators |-| {doc}`outputs` | Modify cell outputs, redirect console output |-| {doc}`control_flow` | Control how cells execute |-| {doc}`html` | Manipulate HTML objects |-| {doc}`query_params` | Access and set query parameters with `mo.query_params` |-| {doc}`cli_args` | Access command-line arguments with `mo.cli_args` |-| {doc}`caching` | Cache expensive computations in memory or on disk |-| {doc}`state` | Synchronize multiple UI elements with `mo.state` |-| {doc}`app` | Embed notebooks in other notebooks |-| {doc}`cell` | Run cells defined in another notebook |-| {doc}`miscellaneous` | Miscellaneous utilities |+| [markdown](markdown.md) | Write markdown with `mo.md` |+| [inputs](inputs/index.md) | Connect sliders, dropdowns, tables, and more to Python |+| [layouts](layouts/index.md) | Customize outputs with accordions, tabs, stacks, and more |+| [plotting](plotting.md) | Output interactive plots |+| [media](media/index.md) | Output media like images, audio, PDFs, and plain text |+| [diagrams](diagrams.md) | Flow charts, graphs, statistic cards, and more |+| [status](status.md) | Display progress indicators |+| [outputs](outputs.md) | Modify cell outputs, redirect console output |+| [control_flow](control_flow.md) | Control how cells execute |+| [html](html.md) | Manipulate HTML objects |+| [query_params](query_params.md) | Access and set query parameters with `mo.query_params` |+| [cli_args](cli_args.md) | Access command-line arguments with `mo.cli_args` |+| [caching](caching.md) | Cache expensive computations in memory or on disk |+| [state](state.md) | Synchronize multiple UI elements with `mo.state` |+| [app](app.md) | Embed notebooks in other notebooks |+| [cell](cell.md) | Run cells defined in another notebook |+| [miscellaneous](miscellaneous.md) | Miscellaneous utilities |diff --git a/docs/api/inputs/anywidget.md b/docs/api/inputs/anywidget.mdindex ea4c63efbe..4397e9134e 100644--- a/docs/api/inputs/anywidget.md+++ b/docs/api/inputs/anywidget.md@@ -1,3 +1,4 @@+# Building custom UI elementsBuild custom UI plugins that hook into marimo's reactive@@ -86,9 +87,4 @@ widget.count----```{eval-rst}-.. autoclass:: marimo.ui.anywidget- :members:-- .. autoclasstoc:: marimo._plugins.ui._impl.from_anywidget.anywidget-```+::: marimo.ui.anywidgetdiff --git a/docs/api/inputs/array.md b/docs/api/inputs/array.mdindex e3cf6bec4d..939475960c 100644--- a/docs/api/inputs/array.md+++ b/docs/api/inputs/array.md@@ -1,22 +1,20 @@# Array-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- wish = mo.ui.text(placeholder="Wish")- wishes = mo.ui.array([wish] * 3, label="Three wishes")- return+/// marimo-embed- @app.cell- def __():- mo.hstack([wishes, wishes.value], justify="space-between")- return+```python+def __():+ wish = mo.ui.text(placeholder="Wish")+ wishes = mo.ui.array([wish] * 3, label="Three wishes")+ return++def __():+ mo.hstack([wishes, wishes.value], justify="space-between")+ return```-```{eval-rst}-.. autoclass:: marimo.ui.array- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.array.array-```+::: marimo.ui.arraydiff --git a/docs/api/inputs/batch.md b/docs/api/inputs/batch.mdindex 9152a66b3d..9246bef5d3 100644--- a/docs/api/inputs/batch.md+++ b/docs/api/inputs/batch.md@@ -1,7 +1,8 @@# Batch-```{eval-rst}-.. marimo-embed::+/// marimo-embed++```python@app.celldef __():el = mo.md("{start} → {end}").batch(@@ -17,9 +18,6 @@return```-```{eval-rst}-.. autoclass:: marimo.ui.batch- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.batch.batch-```+::: marimo.ui.batchdiff --git a/docs/api/inputs/button.md b/docs/api/inputs/button.mdindex 92bc1d2cff..13d41b496f 100644--- a/docs/api/inputs/button.md+++ b/docs/api/inputs/button.md@@ -1,23 +1,18 @@# Button-```{admonition} Looking for a submit/run button?-:class: tip+!!! tip "Looking for a submit/run button?"+ If you're looking for a button to trigger computation on click, consider+ using [`mo.ui.run_button`](../api/inputs/run_button.md).-If you're looking for a button to trigger computation on click, consider-using [`mo.ui.run_button`](/api/inputs/run_button.md).-```+/// marimo-embed-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- mo.ui.button(label="Click me")- return+```python+def __():+ mo.ui.button(label="Click me")+ return```-```{eval-rst}-.. autoclass:: marimo.ui.button- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.input.button-```+::: marimo.ui.buttondiff --git a/docs/api/inputs/chat.md b/docs/api/inputs/chat.mdindex 60ef4c8dba..016f113d48 100644--- a/docs/api/inputs/chat.md+++ b/docs/api/inputs/chat.md@@ -1,39 +1,33 @@# Chat-```{admonition} Looking for example notebooks?-:class: tip+!!! tip "Looking for example notebooks?"+ For example notebooks, check out [`examples/ai/chat` on our+ GitHub](https://github.com/marimo-team/marimo/tree/main/examples/ai/chat).-For example notebooks, check out [`examples/ai/chat` on our-GitHub](https://github.com/marimo-team/marimo/tree/main/examples/ai/chat).-```+/// marimo-embed+ size: large-```{eval-rst}-.. marimo-embed::- :size: large-- @app.cell- def __():- def simple_echo_model(messages, config):- return f"You said: {messages[-1].content}"-- mo.ui.chat(- simple_echo_model,- prompts=["Hello", "How are you?"],- show_configuration_controls=True- )- return+```python+def __():+ def simple_echo_model(messages, config):+ return f"You said: {messages[-1].content}"++ mo.ui.chat(+ simple_echo_model,+ prompts=["Hello", "How are you?"],+ show_configuration_controls=True+ )+ return```+///+The chat UI element provides an interactive chatbot interface forconversations. It can be customized with different models, including built-inAI models from popular providers or custom functions.-```{eval-rst}-.. autoclass:: marimo.ui.chat- :members:-- .. autoclasstoc:: marimo._plugins.ui._impl.chat.chat.chat-```+::: marimo.ui.chat## Basic Usage@@ -83,12 +77,7 @@ chat.valueThis returns a list of [`ChatMessage`](#marimo.ai.ChatMessage) objects, eachcontaining `role`, `content`, and optional `attachments` attributes.-```{eval-rst}-.. autoclass:: ChatMessage- :members:-- .. autoclasstoc:: marimo._ai.types.types.ChatMessage-```+::: marimo.ai.ChatMessage## Custom Model with Additional Context@@ -163,12 +152,7 @@ mo.ui.chat()```-```{eval-rst}-.. autoclass:: marimo.ai.llm.openai- :members:-- .. autoclasstoc:: marimo._ai.llm.openai-```+::: marimo.ai.llm.openai### Anthropic@@ -185,12 +169,7 @@ mo.ui.chat()```-```{eval-rst}-.. autoclass:: marimo.ai.llm.anthropic- :members:-- .. autoclasstoc:: marimo._ai.llm.anthropic-```+::: marimo.ai.llm.anthropic### Google AI@@ -205,15 +184,11 @@ mo.ui.chat(),show_configuration_controls=True)-```-```{eval-rst}-.. autoclass:: marimo.ai.llm.google- :members:-- .. autoclasstoc:: marimo._ai.llm.google```+::: marimo.ai.llm.google+### Groq```python@@ -229,12 +204,7 @@ mo.ui.chat()```-```{eval-rst}-.. autoclass:: marimo.ai.llm.groq- :members:-- .. autoclasstoc:: marimo._ai.llm.groq-```+::: marimo.ai.llm.groq## Types@@ -242,22 +212,16 @@ Chatbots can be implemented with a function that receives a list of[`ChatMessage`](#marimo.ai.ChatMessage) objects and a[`ChatModelConfig`](#marimo.ai.ChatModelConfig).-```{eval-rst}-.. autoclass:: marimo.ai.ChatMessage-```+::: marimo.ai.ChatMessage-```{eval-rst}-.. autoclass:: marimo.ai.ChatModelConfig-```+::: marimo.ai.ChatModelConfig[`mo.ui.chat`](#marimo.ui.chat) can be instantiated with an initialconfiguration with a dictionary conforming to the config.`ChatMessage`s can also include attachments.-```{eval-rst}-.. autoclass:: marimo.ai.ChatAttachment-```+::: marimo.ai.ChatAttachment## Supported Model Providers@@ -265,51 +229,51 @@ We support any OpenAI-compatible endpoint. If you want any specific provider addNormally, overriding the `base_url` parameter should work. Here are some examples:-::::{tab-set}-:::{tab-item} Cerebras+/// tab | Cerebras```pythonchatbot = mo.ui.chat(- mo.ai.llm.openai(- model="llama3.1-8b",- api_key="csk-...", # insert your key here- base_url="https://api.cerebras.ai/v1/",- ),+ mo.ai.llm.openai(+ model="llama3.1-8b",+ api_key="csk-...", # insert your key here+ base_url="https://api.cerebras.ai/v1/",+ ),)chatbot```-:::-:::{tab-item} Groq+///++/// tab | Groq```pythonchatbot = mo.ui.chat(- mo.ai.llm.openai(- model="llama-3.1-70b-versatile",- api_key="gsk_...", # insert your key here- base_url="https://api.groq.com/openai/v1/",- ),+ mo.ai.llm.openai(+ model="llama-3.1-70b-versatile",+ api_key="gsk_...", # insert your key here+ base_url="https://api.groq.com/openai/v1/",+ ),)chatbot```-:::-:::{tab-item} xAI+///++/// tab | xAI```pythonchatbot = mo.ui.chat(- mo.ai.llm.openai(- model="grok-beta",- api_key=key, # insert your key here- base_url="https://api.x.ai/v1",- ),+ mo.ai.llm.openai(+ model="grok-beta",+ api_key=key, # insert your key here+ base_url="https://api.x.ai/v1",+ ),)chatbot```-:::-::::+///-```{note}-We have added examples for GROQ and Cerebras. These providers offer free API keys and are great for trying out Llama models (from Meta). You can sign up on their platforms and integrate with various AI integrations in marimo easily. For more information, refer to the [AI completion documentation in marimo](/guides/editor_features/ai_completion).-```+!!! note++ We have added examples for GROQ and Cerebras. These providers offer free API keys and are great for trying out Llama models (from Meta). You can sign up on their platforms and integrate with various AI integrations in marimo easily. For more information, refer to the [AI completion documentation in marimo](../guides/editor_features/ai_completion).diff --git a/docs/api/inputs/checkbox.md b/docs/api/inputs/checkbox.mdindex 978181663a..fbab61844d 100644--- a/docs/api/inputs/checkbox.md+++ b/docs/api/inputs/checkbox.md@@ -1,21 +1,19 @@# Checkbox-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- checkbox = mo.ui.checkbox(label="check me")- return+/// marimo-embed- @app.cell- def __():- mo.hstack([checkbox, mo.md(f"Has value: {checkbox.value}")])- return+```python+def __():+ checkbox = mo.ui.checkbox(label="check me")+ return++def __():+ mo.hstack([checkbox, mo.md(f"Has value: {checkbox.value}")])+ return```-```{eval-rst}-.. autoclass:: marimo.ui.checkbox- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.input.checkbox-```+::: marimo.ui.checkboxdiff --git a/docs/api/inputs/code_editor.md b/docs/api/inputs/code_editor.mdindex dc8e1584db..117b1b109b 100644--- a/docs/api/inputs/code_editor.md+++ b/docs/api/inputs/code_editor.md@@ -1,16 +1,14 @@# Code Editor-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- mo.ui.code_editor(label="Code Editor", language="python")- return+/// marimo-embed++```python+def __():+ mo.ui.code_editor(label="Code Editor", language="python")+ return```-```{eval-rst}-.. autoclass:: marimo.ui.code_editor- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.input.code_editor-```+::: marimo.ui.code_editordiff --git a/docs/api/inputs/data_explorer.md b/docs/api/inputs/data_explorer.mdindex 2412996e47..d9f79624d5 100644--- a/docs/api/inputs/data_explorer.md+++ b/docs/api/inputs/data_explorer.md@@ -2,31 +2,26 @@The data explorer UI element outputs a visual editor explore your data via plotting and intelligent recommendations. You can incrementally build your "main" plot by adding different encodings: x-axis, y-axis, color, size, and shape. As you build your plot, the UI element will suggest further plots by intelligently "exploding" an additional encoding derived from your base plot.-```{admonition} Pandas Required-:class: note+!!! note "Pandas Required"-In order to use the dataframe UI element, you must have the `pandas` package installed.-You can install it with `pip install pandas`.-```+ In order to use the dataframe UI element, you must have the `pandas` package installed.+ You can install it with `pip install pandas`.-```{eval-rst}-.. marimo-embed::- :size: large- :app_width: full+/// marimo-embed+ size: large+ app_width: full- @app.cell- def __():- import pandas as pd- import pyodide- csv = pyodide.http.open_url("https://raw.githubusercontent.com/mwaskom/seaborn-data/master/iris.csv")- df = pd.read_csv(csv)- mo.ui.data_explorer(df)- return+```python+def __():+ import pandas as pd+ import pyodide+ csv = pyodide.http.open_url("https://raw.githubusercontent.com/mwaskom/seaborn-data/master/iris.csv")+ df = pd.read_csv(csv)+ mo.ui.data_explorer(df)+ return```-```{eval-rst}-.. autoclass:: marimo.ui.data_explorer- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.data_explorer.data_explorer-```+::: marimo.ui.data_explorerdiff --git a/docs/api/inputs/dataframe.md b/docs/api/inputs/dataframe.mdindex f2ac419ccc..cce24f4e41 100644--- a/docs/api/inputs/dataframe.md+++ b/docs/api/inputs/dataframe.md@@ -2,12 +2,10 @@The dataframe UI element outputs a visual editor to apply "transforms" to a dataframe, such as filtering rows, applying group-bys and aggregations, and more. The transformed dataframe is shown below the transform editor. The UI output also includes the generated Python used to generate the resulting dataframe, which you can copy paste into a cell. You can programmatically access the resulting dataframe by accessing the element's `.value` attribute.-```{admonition} Pandas Required-:class: note+!!! note "Pandas or Polars Required"-In order to use the dataframe UI element, you must have the `pandas` package installed.-You can install it with `pip install pandas`.-```+ In order to use the dataframe UI element, you must have the `pandas` or `polars` package installed.+ You can install it with `pip install pandas` or `pip install polars`.Supported transforms are:@@ -18,11 +16,7 @@ Supported transforms are:- Group By- Aggregate-```{eval-rst}-.. marimo-embed::- :size: large- :app_width: full-+```python@app.celldef __():import pandas as pd@@ -33,9 +27,4 @@ Supported transforms are:return```-```{eval-rst}-.. autoclass:: marimo.ui.dataframe- :members:-- .. autoclasstoc:: marimo._plugins.ui._impl.dataframes.dataframe.dataframe-```+::: marimo.ui.dataframediff --git a/docs/api/inputs/dates.md b/docs/api/inputs/dates.mdindex a78ba9831f..ae26a4eb0e 100644--- a/docs/api/inputs/dates.md+++ b/docs/api/inputs/dates.md@@ -2,8 +2,7 @@## Single date-```{eval-rst}-.. marimo-embed::+```python@app.celldef __():date = mo.ui.date(label="Start Date")@@ -13,19 +12,15 @@def __():mo.hstack([date, mo.md(f"Has value: {date.value}")])return+```-```{eval-rst}-.. autoclass:: marimo.ui.date+::: marimo.ui.date:members:- .. autoclasstoc:: marimo._plugins.ui._impl.dates.date-```-## Date and time-```{eval-rst}-.. marimo-embed::+```python@app.celldef __():datetime = mo.ui.datetime(label="Start Date")@@ -37,17 +32,12 @@return```-```{eval-rst}-.. autoclass:: marimo.ui.datetime+::: marimo.ui.datetime:members:- .. autoclasstoc:: marimo._plugins.ui._impl.dates.datetime-```-## Date range-```{eval-rst}-.. marimo-embed::+```python@app.celldef __():date_range = mo.ui.date_range(label="Start Date")@@ -57,11 +47,7 @@def __():mo.hstack([date_range, mo.md(f"Has value: {date_range.value}")])return-````+```-```{eval-rst}-.. autoclass:: marimo.ui.date_range+::: marimo.ui.date_range:members:-- .. autoclasstoc:: marimo._plugins.ui._impl.dates.date_range-```diff --git a/docs/api/inputs/dictionary.md b/docs/api/inputs/dictionary.mdindex a88a188754..7efe8fd1ef 100644--- a/docs/api/inputs/dictionary.md+++ b/docs/api/inputs/dictionary.md@@ -1,33 +1,31 @@# Dictionary-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- first_name = mo.ui.text(placeholder="First name")- last_name = mo.ui.text(placeholder="Last name")- email = mo.ui.text(placeholder="Email", kind="email")+/// marimo-embed- dictionary = mo.ui.dictionary(- {- "First name": first_name,- "Last name": last_name,- "Email": email,- }- )- return- @app.cell- def __():- mo.hstack(- [dictionary, dictionary.value],- justify="space-between"- )- return+```python+def __():+ first_name = mo.ui.text(placeholder="First name")+ last_name = mo.ui.text(placeholder="Last name")+ email = mo.ui.text(placeholder="Email", kind="email")++ dictionary = mo.ui.dictionary(+ {+ "First name": first_name,+ "Last name": last_name,+ "Email": email,+ }+ )+ return+def __():+ mo.hstack(+ [dictionary, dictionary.value],+ justify="space-between"+ )+ return```-```{eval-rst}-.. autoclass:: marimo.ui.dictionary- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.dictionary.dictionary-```+::: marimo.ui.dictionarydiff --git a/docs/api/inputs/dropdown.md b/docs/api/inputs/dropdown.mdindex 1c526bcbc6..a56c2211d4 100644--- a/docs/api/inputs/dropdown.md+++ b/docs/api/inputs/dropdown.md@@ -1,26 +1,24 @@# Dropdown-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- dropdown = mo.ui.dropdown(options=["Apples", "Oranges", "Pears"], label="choose fruit")- dropdown_dict = mo.ui.dropdown(options={"Apples":1, "Oranges":2, "Pears":3},- value="Apples", # initial value- label="choose fruit with dict options")- return+/// marimo-embed- @app.cell- def __():- mo.vstack([mo.hstack([dropdown, mo.md(f"Has value: {dropdown.value}")]),- mo.hstack([dropdown_dict, mo.md(f"Has value: {dropdown_dict.value} and selected_key {dropdown_dict.selected_key}")]),- ])- return+```python+def __():+ dropdown = mo.ui.dropdown(options=["Apples", "Oranges", "Pears"], label="choose fruit")+ dropdown_dict = mo.ui.dropdown(options={"Apples":1, "Oranges":2, "Pears":3},+ value="Apples", # initial value+ label="choose fruit with dict options")+ return++def __():+ mo.vstack([mo.hstack([dropdown, mo.md(f"Has value: {dropdown.value}")]),+ mo.hstack([dropdown_dict, mo.md(f"Has value: {dropdown_dict.value} and selected_key {dropdown_dict.selected_key}")]),+ ])+ return```-```{eval-rst}-.. autoclass:: marimo.ui.dropdown- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.input.dropdown-```+::: marimo.ui.dropdowndiff --git a/docs/api/inputs/file.md b/docs/api/inputs/file.mdindex 5e37ec5950..d2e568c258 100644--- a/docs/api/inputs/file.md+++ b/docs/api/inputs/file.md@@ -1,16 +1,14 @@# File-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- mo.vstack([mo.ui.file(kind="button"), mo.ui.file(kind="area")])- return+/// marimo-embed++```python+def __():+ mo.vstack([mo.ui.file(kind="button"), mo.ui.file(kind="area")])+ return```-```{eval-rst}-.. autoclass:: marimo.ui.file- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.input.file-```+::: marimo.ui.filediff --git a/docs/api/inputs/file_browser.md b/docs/api/inputs/file_browser.mdindex b42b6a32a9..58965a8a8a 100644--- a/docs/api/inputs/file_browser.md+++ b/docs/api/inputs/file_browser.md@@ -1,16 +1,14 @@# File Browser-```{eval-rst}-.. marimo-embed::+/// marimo-embed++```python@app.celldef __():mo.vstack([mo.ui.file_browser()])return```-```{eval-rst}-.. autoclass:: marimo.ui.file_browser- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.input.file_browser-```+::: marimo.ui.file_browserdiff --git a/docs/api/inputs/form.md b/docs/api/inputs/form.mdindex f1ff63a96c..1dbcb33650 100644--- a/docs/api/inputs/form.md+++ b/docs/api/inputs/form.md@@ -1,23 +1,20 @@# Form-```{eval-rst}-.. marimo-embed::- :size: medium+/// marimo-embed+ size: medium- @app.cell- def __():- form = mo.ui.text_area(placeholder="...").form()- return+```python+def __():+ form = mo.ui.text_area(placeholder="...").form()+ return- @app.cell- def __():- mo.vstack([form, mo.md(f"Has value: {form.value}")])- return+def __():+ mo.vstack([form, mo.md(f"Has value: {form.value}")])+ return```-```{eval-rst}-.. autoclass:: marimo.ui.form- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.input.form-```+::: marimo.ui.formdiff --git a/docs/api/inputs/index.md b/docs/api/inputs/index.mdindex 8d578754d1..a7c671c642 100644--- a/docs/api/inputs/index.md+++ b/docs/api/inputs/index.md@@ -1,78 +1,39 @@# Inputs-```{eval-rst}-.. toctree::- :maxdepth: 1- :hidden:-- array- batch- button- chat- checkbox- code_editor- data_explorer- dataframe- dates- dictionary- dropdown- file- file_browser- form- microphone- multiselect- nav_menu- number- radio- range_slider- refresh- run_button- slider- switch- table- tabs- text- text_area- anywidget-```-marimo comes packaged with interactive UI elements that you can use to buildpowerful notebooks and apps. These elements are available in `marimo.ui`.-```{eval-rst}-.. autosummary::- :nosignatures:-- marimo.ui.array- marimo.ui.batch- marimo.ui.button- marimo.ui.chat- marimo.ui.checkbox- marimo.ui.code_editor- marimo.ui.dataframe- marimo.ui.data_explorer- marimo.ui.date- marimo.ui.datetime- marimo.ui.date_range- marimo.ui.dictionary- marimo.ui.dropdown- marimo.ui.file- marimo.ui.file_browser- marimo.ui.form- marimo.ui.microphone- marimo.ui.multiselect- marimo.ui.number- marimo.ui.radio- marimo.ui.range_slider- marimo.ui.refresh- marimo.ui.run_button- marimo.ui.slider- marimo.ui.switch- marimo.ui.tabs- marimo.ui.table- marimo.ui.text- marimo.ui.text_area-```+| Element | Description |+|---------|-------------|+| [`marimo.ui.array`](array.md) | Create array inputs |+| [`marimo.ui.batch`](batch.md) | Batch operations |+| [`marimo.ui.button`](button.md) | Create buttons |+| [`marimo.ui.chat`](chat.md) | Create chat interfaces |+| [`marimo.ui.checkbox`](checkbox.md) | Create checkboxes |+| [`marimo.ui.code_editor`](code_editor.md) | Create code editors |+| [`marimo.ui.dataframe`](dataframe.md) | Interactive dataframes |+| [`marimo.ui.data_explorer`](data_explorer.md) | Explore data |+| [`marimo.ui.date`](dates.md) | Date picker |+| [`marimo.ui.datetime`](dates.md) | Date and time picker |+| [`marimo.ui.date_range`](dates.md) | Date range picker |+| [`marimo.ui.dictionary`](dictionary.md) | Dictionary inputs |+| [`marimo.ui.dropdown`](dropdown.md) | Create dropdowns |+| [`marimo.ui.file`](file.md) | File uploads |+| [`marimo.ui.file_browser`](file_browser.md) | Browse files |+| [`marimo.ui.form`](form.md) | Create forms |+| [`marimo.ui.microphone`](microphone.md) | Record audio |+| [`marimo.ui.multiselect`](multiselect.md) | Multiple selection |+| [`marimo.ui.number`](number.md) | Number inputs |+| [`marimo.ui.radio`](radio.md) | Radio buttons |+| [`marimo.ui.range_slider`](range_slider.md) | Range sliders |+| [`marimo.ui.refresh`](refresh.md) | Refresh buttons |+| [`marimo.ui.run_button`](run_button.md) | Run buttons |+| [`marimo.ui.slider`](slider.md) | Create sliders |+| [`marimo.ui.switch`](switch.md) | Toggle switches |+| [`marimo.ui.tabs`](tabs.md) | Tabbed interfaces |+| [`marimo.ui.table`](table.md) | Interactive tables |+| [`marimo.ui.text`](text.md) | Text inputs |+| [`marimo.ui.text_area`](text_area.md) | Multiline text inputs |To use a UI element, assign it to a global variable and output it in a cell.When you interact with the frontend element, the Python object's `value`@@ -81,12 +42,9 @@ automatically run with the element's latest value.## Integrations-```{eval-rst}-.. autosummary::- :nosignatures:-- marimo.ui.altair_chart- marimo.ui.plotly- marimo.mpl.interactive- marimo.ui.anywidget-```+| Integration | Description |+|-------------|-------------|+| [`marimo.ui.altair_chart`](altair_chart.md) | Interactive Altair charts |+| [`marimo.ui.plotly`](plotly.md) | Interactive Plotly charts |+| [`marimo.mpl.interactive`](mpl.md) | Interactive Matplotlib plots |+| [`marimo.ui.anywidget`](anywidget.md) | Custom widgets |diff --git a/docs/api/inputs/microphone.md b/docs/api/inputs/microphone.mdindex de10242595..b634767c2b 100644--- a/docs/api/inputs/microphone.md+++ b/docs/api/inputs/microphone.md@@ -1,21 +1,19 @@# Microphone-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- microphone = mo.ui.microphone(label="Drop a beat!")- return+/// marimo-embed- @app.cell- def __():- mo.hstack([microphone, mo.audio(microphone.value)])- return+```python+def __():+ microphone = mo.ui.microphone(label="Drop a beat!")+ return++def __():+ mo.hstack([microphone, mo.audio(microphone.value)])+ return```-```{eval-rst}-.. autoclass:: marimo.ui.microphone- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.microphone.microphone-```+::: marimo.ui.microphonediff --git a/docs/api/inputs/multiselect.md b/docs/api/inputs/multiselect.mdindex 594828d192..5bf236172f 100644--- a/docs/api/inputs/multiselect.md+++ b/docs/api/inputs/multiselect.md@@ -1,22 +1,20 @@# Multiselect-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- options = ["Apples", "Oranges", "Pears"]- multiselect = mo.ui.multiselect(options=options)- return+/// marimo-embed- @app.cell- def __():- mo.hstack([multiselect, mo.md(f"Has value: {multiselect.value}")])- return+```python+def __():+ options = ["Apples", "Oranges", "Pears"]+ multiselect = mo.ui.multiselect(options=options)+ return++def __():+ mo.hstack([multiselect, mo.md(f"Has value: {multiselect.value}")])+ return```-```{eval-rst}-.. autoclass:: marimo.ui.multiselect- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.input.multiselect-```+::: marimo.ui.multiselectdiff --git a/docs/api/inputs/nav_menu.md b/docs/api/inputs/nav_menu.mdindex d8f07db645..0d07d3109f 100644--- a/docs/api/inputs/nav_menu.md+++ b/docs/api/inputs/nav_menu.md@@ -1,46 +1,46 @@# Navigation Menu-```{eval-rst}-.. marimo-embed::- :size: large+/// marimo-embed+ size: large- @app.cell- def __():- nav_menu = mo.nav_menu({- "/overview": "Overview",- "Sales": {- "/sales": {- "label": "Sales",- "description": "View sales and revenue",- },- "/sales/invoices": {- "label": "Invoices",- "description": "View invoices and payments",- },- "/sales/customers": {- "label": "Customers",- "description": "View customers and subscriptions",- },+```python+def __():+ nav_menu = mo.nav_menu({+ "/overview": "Overview",+ "Sales": {+ "/sales": {+ "label": "Sales",+ "description": "View sales and revenue",},- "Products": {- "/products": {- "label": "Products",- "description": "View and manage products",- },- "/products/inventory": {- "label": "Inventory",- "description": "View inventory and stock levels",- },- "/products/categories": {- "label": "Categories",- "description": "View categories and products",- },+ "/sales/invoices": {+ "label": "Invoices",+ "description": "View invoices and payments",},- })- nav_menu- return+ "/sales/customers": {+ "label": "Customers",+ "description": "View customers and subscriptions",+ },+ },+ "Products": {+ "/products": {+ "label": "Products",+ "description": "View and manage products",+ },+ "/products/inventory": {+ "label": "Inventory",+ "description": "View inventory and stock levels",+ },+ "/products/categories": {+ "label": "Categories",+ "description": "View categories and products",+ },+ },+ })+ nav_menu+ return```-```{eval-rst}-.. autofunction:: marimo.nav_menu-```+///++::: marimo.nav_menudiff --git a/docs/api/inputs/number.md b/docs/api/inputs/number.mdindex 9b9d8da880..15d002cb14 100644--- a/docs/api/inputs/number.md+++ b/docs/api/inputs/number.md@@ -1,21 +1,19 @@# Number-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- number = mo.ui.number(start=1, stop=20, label="Number")- return+/// marimo-embed- @app.cell- def __():- mo.hstack([number, mo.md(f"Has value: {number.value}")])- return+```python+def __():+ number = mo.ui.number(start=1, stop=20, label="Number")+ return++def __():+ mo.hstack([number, mo.md(f"Has value: {number.value}")])+ return```-```{eval-rst}-.. autoclass:: marimo.ui.number- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.input.number-```+::: marimo.ui.numberdiff --git a/docs/api/inputs/radio.md b/docs/api/inputs/radio.mdindex 638db66f6f..fa2bf8bb2f 100644--- a/docs/api/inputs/radio.md+++ b/docs/api/inputs/radio.md@@ -1,22 +1,20 @@# Radio-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- options = ["Apples", "Oranges", "Pears"]- radio = mo.ui.radio(options=options)- return+/// marimo-embed- @app.cell- def __():- mo.hstack([radio, mo.md(f"Has value: {radio.value}")])- return+```python+def __():+ options = ["Apples", "Oranges", "Pears"]+ radio = mo.ui.radio(options=options)+ return++def __():+ mo.hstack([radio, mo.md(f"Has value: {radio.value}")])+ return```-```{eval-rst}-.. autoclass:: marimo.ui.radio- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.input.radio-```+::: marimo.ui.radiodiff --git a/docs/api/inputs/range_slider.md b/docs/api/inputs/range_slider.mdindex 28ad083860..8c2223141b 100644--- a/docs/api/inputs/range_slider.md+++ b/docs/api/inputs/range_slider.md@@ -1,21 +1,19 @@# Range Slider-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- range_slider = mo.ui.range_slider(start=1, stop=10, step=2, value=[2, 6], full_width=True)- return+/// marimo-embed- @app.cell- def __():- mo.hstack([range_slider, mo.md(f"Has value: {range_slider.value}")])- return+```python+def __():+ range_slider = mo.ui.range_slider(start=1, stop=10, step=2, value=[2, 6], full_width=True)+ return++def __():+ mo.hstack([range_slider, mo.md(f"Has value: {range_slider.value}")])+ return```-```{eval-rst}-.. autoclass:: marimo.ui.range_slider- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.input.range_slider-```+::: marimo.ui.range_sliderdiff --git a/docs/api/inputs/refresh.md b/docs/api/inputs/refresh.mdindex f5408ecaf6..6aebdc704c 100644--- a/docs/api/inputs/refresh.md+++ b/docs/api/inputs/refresh.md@@ -1,24 +1,22 @@# Refresh-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- refresh = mo.ui.refresh(- label="Refresh",- options=["1s", "5s", "10s", "30s"]- )- return+/// marimo-embed- @app.cell- def __():- mo.hstack([refresh, refresh.value])- return+```python+def __():+ refresh = mo.ui.refresh(+ label="Refresh",+ options=["1s", "5s", "10s", "30s"]+ )+ return++def __():+ mo.hstack([refresh, refresh.value])+ return```-```{eval-rst}-.. autoclass:: marimo.ui.refresh- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.refresh.refresh-```+::: marimo.ui.refreshdiff --git a/docs/api/inputs/run_button.md b/docs/api/inputs/run_button.mdindex 01b3afc41f..c2e9b924a1 100644--- a/docs/api/inputs/run_button.md+++ b/docs/api/inputs/run_button.md@@ -1,33 +1,29 @@# Run Button-```{eval-rst}-.. marimo-embed::- :size: medium-- @app.cell- def __():- b = mo.ui.run_button()- b- return-- @app.cell- def __():- s = mo.ui.slider(1, 10)- s- return--- @app.cell- def __():- mo.stop(not b.value, "Click `run` to submit the slider's value")-- s.value- return+/// marimo-embed+ size: medium++```python+def __():+ b = mo.ui.run_button()+ b+ return++def __():+ s = mo.ui.slider(1, 10)+ s+ return++def __():+ mo.stop(not b.value, \"Click `run` to submit the slider's value\")++ s.value+ return```-```{eval-rst}-.. autoclass:: marimo.ui.run_button- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.run_button.run_button-```+::: marimo.ui.run_buttondiff --git a/docs/api/inputs/slider.md b/docs/api/inputs/slider.mdindex 5563b8fac2..3918ea04ba 100644--- a/docs/api/inputs/slider.md+++ b/docs/api/inputs/slider.md@@ -1,37 +1,35 @@# Slider-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- slider = mo.ui.slider(start=1, stop=20, label="Slider", value=3)- return-- @app.cell- def __():- mo.hstack([slider, mo.md(f"Has value: {slider.value}")])- return-- @app.cell- def __():- # You can also use steps to create a slider on a custom range- log_slider = mo.ui.slider(steps=np.logspace(-2, 2, 101), label="Logarithmic Slider", value=1)- return-- @app.cell- def __():- mo.hstack([log_slider, mo.md(f"Has value: {log_slider.value}")])- return-- @app.cell- def __():- import numpy as np- return-```+/// marimo-embed++```python+def __():+ slider = mo.ui.slider(start=1, stop=20, label="Slider", value=3)+ return++def __():+ mo.hstack([slider, mo.md(f"Has value: {slider.value}")])+ return-```{eval-rst}-.. autoclass:: marimo.ui.slider- :members:+def __():+ # You can also use steps to create a slider on a custom range+ log_slider = mo.ui.slider(steps=np.logspace(-2, 2, 101), label="Logarithmic Slider", value=1)+ return- .. autoclasstoc:: marimo._plugins.ui._impl.input.slider+def __():+ mo.hstack([log_slider, mo.md(f"Has value: {log_slider.value}")])+ return++def __():+ import numpy as np+ return```++///++::: marimo.ui.sliderdiff --git a/docs/api/inputs/switch.md b/docs/api/inputs/switch.mdindex 2177b5eb53..fb2e7b4c68 100644--- a/docs/api/inputs/switch.md+++ b/docs/api/inputs/switch.md@@ -1,21 +1,19 @@# Switch-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- switch = mo.ui.switch(label="do not disturb")- return+/// marimo-embed- @app.cell- def __():- mo.hstack([switch, mo.md(f"Has value: {switch.value}")])- return+```python+def __():+ switch = mo.ui.switch(label="do not disturb")+ return++def __():+ mo.hstack([switch, mo.md(f"Has value: {switch.value}")])+ return```-```{eval-rst}-.. autoclass:: marimo.ui.switch- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.switch.switch-```+::: marimo.ui.switchdiff --git a/docs/api/inputs/table.md b/docs/api/inputs/table.mdindex 13d3307ef5..8a9cfe19c5 100644--- a/docs/api/inputs/table.md+++ b/docs/api/inputs/table.md@@ -1,9 +1,9 @@# Table-```{eval-rst}-.. marimo-embed::- :size: large+/// marimo-embed+ size: large+```python@app.celldef __():table = mo.ui.table(data=office_characters, pagination=True)@@ -41,9 +41,6 @@return```-```{eval-rst}-.. autoclass:: marimo.ui.table- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.table.table-```+::: marimo.ui.tablediff --git a/docs/api/inputs/tabs.md b/docs/api/inputs/tabs.mdindex 2e1f89377d..63a90bf8f3 100644--- a/docs/api/inputs/tabs.md+++ b/docs/api/inputs/tabs.md@@ -1,40 +1,37 @@# Tabs-```{eval-rst}-.. marimo-embed::- :size: large+/// marimo-embed+ size: large- @app.cell- def __():- import matplotlib.pyplot as plt- import numpy as np+```python+def __():+ import matplotlib.pyplot as plt+ import numpy as np- # Generate some random data- categories = ["A", "B", "C", "D", "E"]- values = np.random.rand(5)+ # Generate some random data+ categories = ["A", "B", "C", "D", "E"]+ values = np.random.rand(5)- bar = plt.bar(categories, values)- plt.title("Random Bar Chart")- plt.xlabel("Categories")- plt.ylabel("Values")- None- return+ bar = plt.bar(categories, values)+ plt.title("Random Bar Chart")+ plt.xlabel("Categories")+ plt.ylabel("Values")+ None+ return- @app.cell- def __():- mo.ui.tabs(- {- "📈 Sales": bar,- "📊 Subscriptions": bar,- "💻 Settings": mo.ui.text(placeholder="Key"),- }- )- return+def __():+ mo.ui.tabs(+ {+ "📈 Sales": bar,+ "📊 Subscriptions": bar,+ "💻 Settings": mo.ui.text(placeholder="Key"),+ }+ )+ return```-```{eval-rst}-.. autoclass:: marimo.ui.tabs- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.tabs.tabs-```+::: marimo.ui.tabsdiff --git a/docs/api/inputs/text.md b/docs/api/inputs/text.mdindex b1c80ce572..2daff96207 100644--- a/docs/api/inputs/text.md+++ b/docs/api/inputs/text.md@@ -1,21 +1,19 @@# Text-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- text = mo.ui.text(placeholder="Search...", label="Filter")- return+/// marimo-embed- @app.cell- def __():- mo.hstack([text, mo.md(f"Has value: {text.value}")])- return+```python+def __():+ text = mo.ui.text(placeholder="Search...", label="Filter")+ return++def __():+ mo.hstack([text, mo.md(f"Has value: {text.value}")])+ return```-```{eval-rst}-.. autoclass:: marimo.ui.text- :members:+///- .. autoclasstoc:: marimo._plugins.ui._impl.input.text-```+::: marimo.ui.textdiff --git a/docs/api/inputs/text_area.md b/docs/api/inputs/text_area.mdindex 0e942d31d1..b3eff284a2 100644--- a/docs/api/inputs/text_area.md+++ b/docs/api/inputs/text_area.md@@ -1,21 +1,17 @@# Text Area-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- text_area = mo.ui.text_area(placeholder="Search...", label="Description")- return+/// marimo-embed- @app.cell- def __():- mo.hstack([text_area, mo.md(f"Has value: {text_area.value}")])- return-```+```python+def __():+ text_area = mo.ui.text_area(placeholder="Search...", label="Description")+ return-```{eval-rst}-.. autoclass:: marimo.ui.text_area- :members:+def __():+ mo.hstack([text_area, mo.md(f"Has value: {text_area.value}")])+ return///- .. autoclasstoc:: marimo._plugins.ui._impl.input.text_area+::: marimo.ui.text_area```diff --git a/docs/api/layouts/accordion.md b/docs/api/layouts/accordion.mdindex b41626f3f9..9095fc7f10 100644--- a/docs/api/layouts/accordion.md+++ b/docs/api/layouts/accordion.md@@ -1,23 +1,23 @@# Accordion-```{eval-rst}-.. marimo-embed::- :size: medium+/// marimo-embed+ size: medium- @app.cell- def __():- mo.accordion(- {- "Door 1": mo.md("Nothing!"),- "Door 2": mo.md("Nothing!"),- "Door 3": mo.md(- ""- ),- }- )- return+```python+def __():+ mo.accordion(+ {+ "Door 1": mo.md("Nothing!"),+ "Door 2": mo.md("Nothing!"),+ "Door 3": mo.md(+ ""+ ),+ }+ )+ return```-```{eval-rst}-.. autofunction:: marimo.accordion-```+///++::: marimo.accordiondiff --git a/docs/api/layouts/callout.md b/docs/api/layouts/callout.mdindex a6833f001c..abb82a6149 100644--- a/docs/api/layouts/callout.md+++ b/docs/api/layouts/callout.md@@ -1,27 +1,28 @@# Callout-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- callout_kind = mo.ui.dropdown(- label="Color",- options=["info", "neutral", "danger", "warn", "success"],- value="neutral",- )- return+/// marimo-embed- @app.cell- def __():- callout = mo.callout("This is a callout", kind=callout_kind.value)- return+```python+def __():+ callout_kind = mo.ui.dropdown(+ label="Color",+ options=["info", "neutral", "danger", "warn", "success"],+ value="neutral",+ )+ return- @app.cell- def __():- mo.vstack([callout_kind, callout], align="stretch", gap=0)- return-```+def __():+ callout = mo.callout("This is a callout", kind=callout_kind.value)+ return-```{eval-rst}-.. autofunction:: marimo.callout+def __():+ mo.vstack([callout_kind, callout], align="stretch", gap=0)+ return```++///++::: marimo.calloutdiff --git a/docs/api/layouts/carousel.md b/docs/api/layouts/carousel.mdindex 92dfe32275..44b59aff6f 100644--- a/docs/api/layouts/carousel.md+++ b/docs/api/layouts/carousel.md@@ -1,21 +1,21 @@# Carousel-```{eval-rst}-.. marimo-embed::- :size: large+/// marimo-embed+ size: large- @app.cell- def __():- mo.carousel([- mo.md("# Introduction"),- "By the marimo team",- mo.md("## What is marimo?"),- mo.md(""),- mo.md("## Questions?"),- ])- return+```python+def __():+ mo.carousel([+ mo.md("# Introduction"),+ "By the marimo team",+ mo.md("## What is marimo?"),+ mo.md(""),+ mo.md("## Questions?"),+ ])+ return```-```{eval-rst}-.. autofunction:: marimo.carousel-```+///++::: marimo.carouseldiff --git a/docs/api/layouts/index.md b/docs/api/layouts/index.mdindex 65c8192c96..479cb47ac2 100644--- a/docs/api/layouts/index.md+++ b/docs/api/layouts/index.md@@ -1,23 +1,5 @@# Layouts-```{eval-rst}-.. toctree::- :maxdepth: 1- :hidden:-- accordion- carousel- callout- justify- lazy- nav_menu- plain- routes- sidebar- stacks- tree-```-marimo has higher-order layout functions that you can use to arrange outputsin rows, columns, tables, tabs, and more.@@ -26,25 +8,22 @@ in rows, columns, tables, tabs, and more.Unlike elements in `marimo.ui`, these don't have any values associated withthem but just render their children in a certain way.-```{eval-rst}-.. autosummary::- :nosignatures:-- marimo.accordion- marimo.carousel- marimo.callout- marimo.center- marimo.hstack- marimo.lazy- marimo.left- marimo.nav_menu- marimo.plain- marimo.right- marimo.routes- marimo.sidebar- marimo.tree- marimo.vstack-```+| Function | Description |+|----------|-------------|+| [`marimo.accordion`](accordion.md) | Create collapsible sections |+| [`marimo.carousel`](carousel.md) | Create a slideshow |+| [`marimo.callout`](callout.md) | Create highlighted sections |+| [`marimo.center`](center.md) | Center content |+| [`marimo.hstack`](hstack.md) | Stack elements horizontally |+| [`marimo.lazy`](lazy.md) | Lazy load content |+| [`marimo.left`](left.md) | Left-align content |+| [`marimo.nav_menu`](nav_menu.md) | Create navigation menus |+| [`marimo.plain`](plain.md) | Display content without styling |+| [`marimo.right`](right.md) | Right-align content |+| [`marimo.routes`](routes.md) | Create page routing |+| [`marimo.sidebar`](sidebar.md) | Create sidebars |+| [`marimo.tree`](tree.md) | Create tree structures |+| [`marimo.vstack`](vstack.md) | Stack elements vertically |## Stateful@@ -52,10 +31,7 @@ Some elements in `marimo.ui` are also helpful for layout. These elementsdo have values associated with them: for example, `tabs` tracks theselected tab name, and `table` tracks the selected rows.-```{eval-rst}-.. autosummary::- :nosignatures:-- marimo.ui.tabs- marimo.ui.table-```+| Function | Description |+|----------|-------------|+| [`marimo.ui.tabs`](../inputs/tabs.md) | Create tabbed interfaces |+| [`marimo.ui.table`](../inputs/table.md) | Create interactive tables |diff --git a/docs/api/layouts/justify.md b/docs/api/layouts/justify.mdindex 32ffd0858a..3fe5a2fc0f 100644--- a/docs/api/layouts/justify.md+++ b/docs/api/layouts/justify.md@@ -1,13 +1,6 @@# Justify-```{eval-rst}-.. autofunction:: marimo.center-```+::: marimo.center+::: marimo.left-```{eval-rst}-.. autofunction:: marimo.left-```--```{eval-rst}-.. autofunction:: marimo.right-```+::: marimo.rightdiff --git a/docs/api/layouts/lazy.md b/docs/api/layouts/lazy.mdindex 104939c7c2..19fee1d7fe 100644--- a/docs/api/layouts/lazy.md+++ b/docs/api/layouts/lazy.md@@ -1,26 +1,27 @@# Lazy-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- mo.accordion({- "Open me": mo.lazy(expensive_number, show_loading_indicator=True)- })- return+/// marimo-embed- @app.cell- def __():- import time- import random+```python+def __():+ mo.accordion({+ "Open me": mo.lazy(expensive_number, show_loading_indicator=True)+ })+ return- def expensive_number():- time.sleep(1)- num = random.randint(0, 100)- return num- return-```+def __():+ import time+ import random-```{eval-rst}-.. autofunction:: marimo.lazy+ def expensive_number():+ time.sleep(1)+ num = random.randint(0, 100)+ return num+ return```++///++::: marimo.lazydiff --git a/docs/api/layouts/plain.md b/docs/api/layouts/plain.mdindex af8ba18e90..128e0e93fe 100644--- a/docs/api/layouts/plain.md+++ b/docs/api/layouts/plain.md@@ -1,5 +1,3 @@# Plain-```{eval-rst}-.. autofunction:: marimo.plain-```+::: marimo.plaindiff --git a/docs/api/layouts/routes.md b/docs/api/layouts/routes.mdindex e814fce8ab..d6c1bc8f87 100644--- a/docs/api/layouts/routes.md+++ b/docs/api/layouts/routes.md@@ -1,14 +1,7 @@# Routes-```{eval-rst}-.. autofunction:: marimo.routes-```--## Full example with a sidebar--Here is a marimo program that uses routes with a sidebar.--```python+::: marimo.routes+pythonimport marimoapp = marimo.App()@@ -49,4 +42,3 @@ def __():mo.routes.CATCH_ALL: mo.md("# Home"),})return-```diff --git a/docs/api/layouts/sidebar.md b/docs/api/layouts/sidebar.mdindex c28065369b..9062e487b5 100644--- a/docs/api/layouts/sidebar.md+++ b/docs/api/layouts/sidebar.md@@ -1,31 +1,31 @@# Sidebar-```{eval-rst}-.. marimo-embed::- :size: medium+/// marimo-embed+ size: medium- @app.cell- def __():- mo.sidebar(- [- mo.md("# marimo"),- mo.nav_menu(- {- "#/home": f"{mo.icon('lucide:home')} Home",- "#/about": f"{mo.icon('lucide:user')} About",- "#/contact": f"{mo.icon('lucide:phone')} Contact",- "Links": {- "https://twitter.com/marimo_io": "Twitter",- "https://github.com/marimo-team/marimo": "GitHub",- },+```python+def __():+ mo.sidebar(+ [+ mo.md("# marimo"),+ mo.nav_menu(+ {+ "#/home": f"{mo.icon('lucide:home')} Home",+ "#/about": f"{mo.icon('lucide:user')} About",+ "#/contact": f"{mo.icon('lucide:phone')} Contact",+ "Links": {+ "https://twitter.com/marimo_io": "Twitter",+ "https://github.com/marimo-team/marimo": "GitHub",},- orientation="vertical",- ),- ]- )- return+ },+ orientation="vertical",+ ),+ ]+ )+ return```-```{eval-rst}-.. autofunction:: marimo.sidebar-```+///++::: marimo.sidebardiff --git a/docs/api/layouts/stacks.md b/docs/api/layouts/stacks.mdindex 1935225d1f..0f3bfd9736 100644--- a/docs/api/layouts/stacks.md+++ b/docs/api/layouts/stacks.md@@ -1,68 +1,66 @@# Stacks-```{eval-rst}-.. marimo-embed::- :size: large+/// marimo-embed+ size: large- @app.cell- def __():- def create_box(num=1):- box_size = 30 + num * 10- return mo.Html(- f"<div style='min-width: {box_size}px; min-height: {box_size}px; background-color: orange; text-align: center; line-height: {box_size}px'>{str(num)}</div>"- )+```python+def __():+ def create_box(num=1):+ box_size = 30 + num * 10+ return mo.Html(+ f"<div style='min-width: {box_size}px; min-height: {box_size}px; background-color: orange; text-align: center; line-height: {box_size}px'>{str(num)}</div>"+ )- boxes = [create_box(i) for i in range(1, 5)]- return- @app.cell- def __():- justify = mo.ui.dropdown(- ["start", "center", "end", "space-between", "space-around"],- value="space-between",- label="justify",- )- align = mo.ui.dropdown(- ["start", "center", "end", "stretch"], value="center", label="align"- )- gap = mo.ui.number(start=0, step=0.25, stop=2, value=0.25, label="gap")- wrap = mo.ui.checkbox(label="wrap")- return- @app.cell- def __():- horizontal = mo.hstack(- boxes,- align=align.value,- justify=justify.value,- gap=gap.value,- wrap=wrap.value,- )- vertical = mo.vstack(- boxes,- align=align.value,- gap=gap.value,- )+ boxes = [create_box(i) for i in range(1, 5)]+ return- mo.vstack(- [- mo.hstack([justify, align, gap], justify="center"),- horizontal,- mo.md("-----------------------------"),- vertical,- ],- align="stretch",- gap=1,- )- return+def __():+ justify = mo.ui.dropdown(+ ["start", "center", "end", "space-between", "space-around"],+ value="space-between",+ label="justify",+ )+ align = mo.ui.dropdown(+ ["start", "center", "end", "stretch"], value="center", label="align"+ )+ gap = mo.ui.number(start=0, step=0.25, stop=2, value=0.25, label="gap")+ wrap = mo.ui.checkbox(label="wrap")+ return-```+def __():+ horizontal = mo.hstack(+ boxes,+ align=align.value,+ justify=justify.value,+ gap=gap.value,+ wrap=wrap.value,+ )+ vertical = mo.vstack(+ boxes,+ align=align.value,+ gap=gap.value,+ )-```{eval-rst}-.. autofunction:: marimo.hstack+ mo.vstack(+ [+ mo.hstack([justify, align, gap], justify="center"),+ horizontal,+ mo.md("-----------------------------"),+ vertical,+ ],+ align="stretch",+ gap=1,+ )+ return```-```{eval-rst}-.. autofunction:: marimo.vstack-```+///++::: marimo.hstack+::: marimo.vstackdiff --git a/docs/api/layouts/tree.md b/docs/api/layouts/tree.mdindex df5ca6cc4f..0902ed0deb 100644--- a/docs/api/layouts/tree.md+++ b/docs/api/layouts/tree.md@@ -1,16 +1,17 @@# Tree-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- mo.tree(- ["entry", "another entry", {"key": [0, mo.ui.slider(1, 10, value=5), 2]}],- label="A tree of elements.",- )- return-```+/// marimo-embed-```{eval-rst}-.. autofunction:: marimo.tree+```python+def __():+ mo.tree(+ ["entry", "another entry", {"key": [0, mo.ui.slider(1, 10, value=5), 2]}],+ label="A tree of elements.",+ )+ return```++///++::: marimo.treediff --git a/docs/api/markdown.md b/docs/api/markdown.mdindex dc128213df..6a5ece5b2b 100644--- a/docs/api/markdown.md+++ b/docs/api/markdown.md@@ -4,9 +4,7 @@ Write markdown with `mo.md`; make your markdown **interactive**, **dynamic**,and **visually rich** by interpolating arbitrary Python values and marimoelements.-```{eval-rst}-.. autofunction:: marimo.md-```+::: marimo.md## Icons@@ -16,9 +14,7 @@ When is inside markdown, you can render an icon with the syntax `::iconset:icon-For other advanced features, use `mo.icon()` such as `mo.icon("lucide:rocket", size=20)` or `mo.icon("mdi:home", color="blue")`.-```{eval-rst}-.. autofunction:: marimo.icon-```+::: marimo.icon## Tooltipsdiff --git a/docs/api/media/audio.md b/docs/api/media/audio.mdindex 7e906816a9..6915cd6ac1 100644--- a/docs/api/media/audio.md+++ b/docs/api/media/audio.md@@ -1,14 +1,15 @@# Audio-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- _src = "https://upload.wikimedia.org/wikipedia/commons/8/8c/Ivan_Ili%C4%87-Chopin_-_Prelude_no._1_in_C_major.ogg"- mo.audio(_src)- return-```+/// marimo-embed-```{eval-rst}-.. autofunction:: marimo.audio+```python+def __():+ _src = "https://upload.wikimedia.org/wikipedia/commons/8/8c/Ivan_Ili%C4%87-Chopin_-_Prelude_no._1_in_C_major.ogg"+ mo.audio(_src)+ return```++///++::: marimo.audiodiff --git a/docs/api/media/download.md b/docs/api/media/download.mdindex 53125d5fe8..1cc707c997 100644--- a/docs/api/media/download.md+++ b/docs/api/media/download.md@@ -1,18 +1,19 @@# Download Media-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- download_txt = mo.download(- data="Hello, world!".encode("utf-8"),- filename="hello.txt",- mimetype="text/plain",- )- download_txt- return-```+/// marimo-embed-```{eval-rst}-.. autofunction:: marimo.download+```python+def __():+ download_txt = mo.download(+ data="Hello, world!".encode("utf-8"),+ filename="hello.txt",+ mimetype="text/plain",+ )+ download_txt+ return```++///++::: marimo.downloaddiff --git a/docs/api/media/image.md b/docs/api/media/image.mdindex 7b0b992eb3..b28ecdf011 100644--- a/docs/api/media/image.md+++ b/docs/api/media/image.md@@ -1,16 +1,17 @@# Image-```{eval-rst}-.. marimo-embed::- @app.cell- def __():- _src = (- "https://images.pexels.com/photos/86596/owl-bird-eyes-eagle-owl-86596.jpeg"- )- mo.image(src=_src, width="180px", height="180px", rounded=True)- return-```+/// marimo-embed-```{eval-rst}-.. autofunction:: marimo.image+```python+def __():+ _src = (+ "https://images.pexels.com/photos/86596/owl-bird-eyes-eagle-owl-86596.jpeg"+ )+ mo.image(src=_src, width="180px", height="180px", rounded=True)+ return```++///++::: marimo.imagediff --git a/docs/api/media/index.md b/docs/api/media/index.mdindex c5dda56c39..cfb6a5b646 100644--- a/docs/api/media/index.md+++ b/docs/api/media/index.md@@ -1,31 +1,15 @@# Media-```{eval-rst}-.. toctree::- :maxdepth: 1- :hidden:-- image- audio- video- download- plain_text-```-Use these functions to embed media in your outputs.-```{eval-rst}-.. autosummary::- :nosignatures:-- marimo.image- marimo.audio- marimo.video- marimo.pdf- marimo.download- marimo.plain_text-```+| Function | Description |+|----------|-------------|+| [`marimo.image`](image.md) | Display images |+| [`marimo.audio`](audio.md) | Play audio files |+| [`marimo.video`](video.md) | Play videos |+| [`marimo.pdf`](pdf.md) | Display PDFs |+| [`marimo.download`](download.md) | Create download links |+| [`marimo.plain_text`](plain_text.md) | Display plain text |Most of these methods accept URLs (including data URLs), paths to localfiles, or file-like objects.diff --git a/docs/api/media/pdf.md b/docs/api/media/pdf.mdindex 116ca07760..612db48b75 100644--- a/docs/api/media/pdf.md+++ b/docs/api/media/pdf.md@@ -1,5 +1,3 @@-```{eval-rst}-.. autofunction:: marimo.pdf-```+::: marimo.pdfdiff --git a/docs/api/media/plain_text.md b/docs/api/media/plain_text.mdindex e69e304408..0afa8d7c90 100644--- a/docs/api/media/plain_text.md+++ b/docs/api/media/plain_text.md@@ -1,5 +1,3 @@# Plain text-```{eval-rst}-.. autofunction:: marimo.plain_text-```+::: marimo.plain_textdiff --git a/docs/api/media/video.md b/docs/api/media/video.mdindex 24094f57f4..1058193c78 100644--- a/docs/api/media/video.md+++ b/docs/api/media/video.md@@ -1,18 +1,18 @@# Video-```{eval-rst}-.. marimo-embed::- :size: medium+/// marimo-embed+ size: medium- @app.cell- def __():- mo.video(- src="https://v3.cdnpk.net/videvo_files/video/free/2013-08/large_watermarked/hd0992_preview.mp4",- controls=False,- )- return+```python+def __():+ mo.video(+ src="https://v3.cdnpk.net/videvo_files/video/free/2013-08/large_watermarked/hd0992_preview.mp4",+ controls=False,+ )+ return```-```{eval-rst}-.. autofunction:: marimo.video-```+///++::: marimo.videodiff --git a/docs/api/miscellaneous.md b/docs/api/miscellaneous.mdindex f64a4d558b..6b7a56613a 100644--- a/docs/api/miscellaneous.md+++ b/docs/api/miscellaneous.md@@ -1,21 +1,10 @@# Miscellaneous-```{eval-rst}-.. autofunction:: marimo.running_in_notebook-```+::: marimo.running_in_notebook-```{eval-rst}-.. autofunction:: marimo.defs-```+::: marimo.defs-```{eval-rst}-.. autofunction:: marimo.refs-```+::: marimo.refs+::: marimo.notebook_dir-```{eval-rst}-.. autofunction:: marimo.notebook_dir-```--```{eval-rst}-.. autoclass:: marimo.Thread-```+::: marimo.Threaddiff --git a/docs/api/outputs.md b/docs/api/outputs.mdindex ff75353bd3..63b47dad35 100644--- a/docs/api/outputs.md+++ b/docs/api/outputs.md@@ -2,55 +2,37 @@## Cell outputs-```{admonition} Cell outputs-:class: note+!!! note "Cell outputs"+ Every cell in a marimo notebook can have a visual **output**. When editing,+ outputs are displayed above cells. When running a notebook as an app,+ its UI is an arrangement of outputs.-Every cell in a marimo notebook can have a visual **output**. When editing,-outputs are displayed above cells. When running a notebook as an app,-its UI is an arrangement of outputs.+ A cell's output is by default its last expression. You can also create outputs+ programmatically, using `mo.output.replace()` and `mo.output.append()`.-A cell's output is by default its last expression. You can also create outputs-programmatically, using `mo.output.replace()` and `mo.output.append()`.-```+::: marimo.output.replace+::: marimo.output.append-```{eval-rst}-.. autofunction:: marimo.output.replace-```+::: marimo.output.clear+::: marimo.output.replace_at_index-```{eval-rst}-.. autofunction:: marimo.output.append-```--```{eval-rst}-.. autofunction:: marimo.output.clear-```--```{eval-rst}-.. autofunction:: marimo.output.replace_at_index-```--```{admonition} Last expression replaces existing output-:class: warning--Ending a cell with a non-`None` expression is the same as calling-`mo.output.replace()` on it: the last expression replaces any output you may have-already written. Wrap the last expression in `mo.output.append` if you want-to add to an existing output instead of replacing it.-```+!!! warning "Last expression replaces existing output"+ Ending a cell with a non-`None` expression is the same as calling+ `mo.output.replace()` on it: the last expression replaces any output you may have+ already written. Wrap the last expression in `mo.output.append` if you want+ to add to an existing output instead of replacing it.### Display cell code in marimo's app viewsUse `mo.show_code()` to display the cell's code in the output area, whichwill then be visible in all app views.-```{eval-rst}-.. autofunction:: marimo.show_code-```+::: marimo.show_code## Console outputs-```{admonition} Console outputs-:class: note+/// admonition | Console outputs+ type: noteText written to `stdout`/`stderr`, including print statementsand logs, shows up in a console output area below a cell.@@ -58,20 +40,11 @@ and logs, shows up in a console output area below a cell.By default, these console outputs don't appear when running a marimo notebookas an app. If you do want them to appear in apps, marimo provides utilityfunctions for capturing console outputs and redirecting them to cell outputs.-```--```{eval-rst}-.. autofunction:: marimo.redirect_stdout-```+///-```{eval-rst}-.. autofunction:: marimo.redirect_stderr-```+::: marimo.redirect_stdout-```{eval-rst}-.. autofunction:: marimo.capture_stdout-```+::: marimo.redirect_stderr+::: marimo.capture_stdout-```{eval-rst}-.. autofunction:: marimo.capture_stderr-```+::: marimo.capture_stderrdiff --git a/docs/api/plotting.md b/docs/api/plotting.mdindex 7e77ce1e1e..b7ec72a43c 100644--- a/docs/api/plotting.md+++ b/docs/api/plotting.md@@ -4,42 +4,43 @@ marimo supports most major plotting libraries, including Matplotlib, Seaborn,Plotly, and Altair. Just import your plotting library of choice and use itas you normally would.-For more information about plotting, see the [plotting guide](/guides/working_with_data/plotting.md).+For more information about plotting, see the [plotting guide](../guides/working_with_data/plotting.md).## Reactive charts with Altair-```{eval-rst}-.. marimo-embed::- :size: large-- @app.cell- async def __():- import pandas as pd- import pyodide- import micropip- import json- await micropip.install('altair')- import altair as alt- return-- @app.cell- def __():- cars = pd.DataFrame(json.loads(- pyodide.http.open_url('https://vega.github.io/vega-datasets/data/cars.json').read()- ))-- chart = mo.ui.altair_chart(alt.Chart(cars).mark_point().encode(- x='Horsepower',- y='Miles_per_Gallon',- color='Origin'- ))- return-- @app.cell- def __():- mo.vstack([chart, mo.ui.table(chart.value)])- return+/// marimo-embed+ size: large++````python+async def __():+ import pandas as pd+ import pyodide+ import micropip+ import json+ await micropip.install('altair')+ import altair as alt+ return++def __():+ cars = pd.DataFrame(json.loads(+ pyodide.http.open_url('https://vega.github.io/vega-datasets/data/cars.json').read()+ ))++ chart = mo.ui.altair_chart(alt.Chart(cars).mark_point().encode(+ x='Horsepower',+ y='Miles_per_Gallon',+ color='Origin'+ ))+ return++def __():+ mo.vstack([chart, mo.ui.table(chart.value)])+ return```+///### Disabling automatic selection@@ -65,9 +66,8 @@ chart = mo.ui.altair_chart(chart # You can now access chart.value to get the selected data```-```{eval-rst}-.. autofunction:: marimo.ui.altair_chart-```+::: marimo.ui.altair_chart+### Performance and Data Transformers@@ -92,23 +92,19 @@ alt.data_transformers.enable('marimo_csv')## Reactive plots with Plotly-```{admonition} mo.ui.plotly only supports scatter plots, treemaps charts, and sunbursts charts.-:class: warning+!!! warning "mo.ui.plotly only supports scatter plots, treemaps charts, and sunbursts charts."+ marimo can render any Plotly plot, but [`mo.ui.plotly`](#marimo.ui.plotly) only+ supports reactive selections for scatter plots, treemaps charts, and sunbursts charts. If you require other kinds of+ selection, consider using [`mo.ui.altair_chart`](#marimo.ui.altair_chart).-marimo can render any Plotly plot, but [`mo.ui.plotly`](#marimo.ui.plotly) only-supports reactive selections for scatter plots, treemaps charts, and sunbursts charts. If you require other kinds of-selection, consider using [`mo.ui.altair_chart`](#marimo.ui.altair_chart).-```+::: marimo.ui.plotly-```{eval-rst}-.. autofunction:: marimo.ui.plotly-```## Interactive matplotlib--```{eval-rst}-.. autofunction:: marimo.mpl.interactive-```+::: marimo.mpl.interactive+ options:+ show_root_heading: true+ show_source: true## Leafmap supportdiff --git a/docs/api/query_params.md b/docs/api/query_params.mdindex 8eae214ab5..d9e80a5e81 100644--- a/docs/api/query_params.md+++ b/docs/api/query_params.md@@ -5,13 +5,9 @@ can also use `mo.query_params` to set query parameters in order to keep trackof state in the URL. This is useful for bookmarking or sharing a particularstate of the notebook while running as an application with `marimo run`.-```{eval-rst}-.. autofunction:: marimo.query_params-```+::: marimo.query_params-```{admonition} CLI arguments-:class: note+!!! note "CLI arguments"-You can also access command-line arguments passed to the notebook using-`mo.cli_args`. This allows you to pass arguments to the notebook that are not controllable by the user.-```+ You can also access command-line arguments passed to the notebook using+ `mo.cli_args`. This allows you to pass arguments to the notebook that are not controllable by the user.diff --git a/docs/api/state.md b/docs/api/state.mdindex e28e296296..2e186f5ee0 100644--- a/docs/api/state.md+++ b/docs/api/state.md@@ -1,40 +1,36 @@# State-```{admonition} Advanced topic!-:class: warning+!!! warning "Advanced topic!"-This API doc covers reactive state (`mo.state`), an advanced topic.+ This API doc covers reactive state (`mo.state`), an advanced topic.-**You likely don't need reactive state**. UI elements already have built-in-state, their associated value, which you can access with their `value` attribute.-For example, `mo.ui.slider()` has a value that is its current position on an-interval, while `mo.ui.button()` has a value that can be configured to-count the number of times it has been clicked, or to toggle between `True` and-`False`. Additionally, interacting with UI elements bound to global variables-[automatically executes cells](guides/interactivity) that reference those-variables, letting you react to changes by just reading their-`value` attributes. This functional paradigm is the preferred way of-reacting to UI interactions in marimo. So if you-think you need to use `mo.state`, make sure to first read the [guide on-interactivity](/guides/interactivity.md). Chances are, the reactive execution-built into UI elements will suffice. (For example, [you don't need reactive-state to handle a button click](/recipes.md#working-with-buttons).)+ **You likely don't need reactive state**. UI elements already have built-in+ state, their associated value, which you can access with their `value` attribute.+ For example, `mo.ui.slider()` has a value that is its current position on an+ interval, while `mo.ui.button()` has a value that can be configured to+ count the number of times it has been clicked, or to toggle between `True` and+ `False`. Additionally, interacting with UI elements bound to global variables+ [automatically executes cells](guides/interactivity) that reference those+ variables, letting you react to changes by just reading their+ `value` attributes. This functional paradigm is the preferred way of+ reacting to UI interactions in marimo. So if you+ think you need to use `mo.state`, make sure to first read the [guide on+ interactivity](../guides/interactivity.md). Chances are, the reactive execution+ built into UI elements will suffice. (For example, [you don't need reactive+ state to handle a button click](../recipes.md#working-with-buttons).)-That said, here are some signs you might need `mo.state`:-- you need to maintain historical state related to a UI element that can't- be computed from its built-in `value` (_e.g._, all values the user has- ever input into a form)-- you need to synchronize two different UI elements (_e.g._, so that- interacting with either one controls the other)-- you need to introduce cycles across cells+ That said, here are some signs you might need `mo.state`:+ - you need to maintain historical state related to a UI element that can't+ be computed from its built-in `value` (_e.g._, all values the user has+ ever input into a form)+ - you need to synchronize two different UI elements (_e.g._, so that+ interacting with either one controls the other)+ - you need to introduce cycles across cells-If one of these cases applies to you, then read on. `mo.state` lets you-make all kinds of interesting applications, but like mutable state in general,-it can complicate notebook development and has the potential to-introduce hard-to-find bugs.-```+ If one of these cases applies to you, then read on. `mo.state` lets you+ make all kinds of interesting applications, but like mutable state in general,+ it can complicate notebook development and has the potential to+ introduce hard-to-find bugs.-```{eval-rst}-.. autofunction:: marimo.state-```+::: marimo.statediff --git a/docs/api/status.md b/docs/api/status.mdindex 12cc2d30ad..0186632bdf 100644--- a/docs/api/status.md+++ b/docs/api/status.md@@ -9,59 +9,60 @@ databases, or APIs.You can display a progress bar while iterating over a collection, similarto `tqdm`.-```{eval-rst}-.. marimo-embed::- :size: medium+/// marimo-embed+ size: medium- @app.cell- def __():- rerun = mo.ui.button("Rerun")- rerun- return+```python+def __():+ rerun = mo.ui.button("Rerun")+ rerun+ return- @app.cell- async def __():- import asyncio- rerun- for _ in mo.status.progress_bar(- range(10),- title="Loading",- subtitle="Please wait",- show_eta=True,- show_rate=True- ):- await asyncio.sleep(0.5)- return+async def __():+ import asyncio+ rerun+ for _ in mo.status.progress_bar(+ range(10),+ title="Loading",+ subtitle="Please wait",+ show_eta=True,+ show_rate=True+ ):+ await asyncio.sleep(0.5)+ return```-```{eval-rst}-.. autofunction:: marimo.status.progress_bar-```+///++::: marimo.status.progress_bar## Spinner-```{eval-rst}-.. marimo-embed::- :size: medium+/// marimo-embed+ size: medium- @app.cell- def __():- rerun = mo.ui.button("Rerun")- rerun- return+```python+def __():+ rerun = mo.ui.button("Rerun")+ rerun+ return- @app.cell- async def __():- import asyncio- rerun- with mo.status.spinner(title="Loading...") as _spinner:- await asyncio.sleep(1)- _spinner.update("Almost done")- await asyncio.sleep(1)- _spinner.update("Done")- return+async def __():+ import asyncio+ rerun+ with mo.status.spinner(title="Loading...") as _spinner:+ await asyncio.sleep(1)+ _spinner.update("Almost done")+ await asyncio.sleep(1)+ _spinner.update("Done")+ return```-```{eval-rst}-.. autofunction:: marimo.status.spinner-```+///++::: marimo.status.spinner+diff --git a/docs/assets/vscode-marimo.png b/docs/assets/vscode-marimo.pngnew file mode 100644index 0000000000..35d5a6368dBinary files /dev/null and b/docs/assets/vscode-marimo.png differdiff --git a/docs/blocks.py b/docs/blocks.pynew file mode 100644index 0000000000..a5cc5d6dff--- /dev/null+++ b/docs/blocks.py@@ -0,0 +1,104 @@+import textwrap+import xml.etree.ElementTree as etree+from typing import Any, Dict, List, Union, cast+import urllib.parse++from pymdownx.blocks import BlocksExtension # type: ignore+from pymdownx.blocks.block import Block, type_string_in # type: ignore+++class MarimoEmbedBlock(Block):+ NAME: str = "marimo-embed"+ OPTIONS: Dict[str, List[Union[str, Any]]] = {+ "size": ["medium", type_string_in(["small", "medium", "large"])],+ "app_width": ["wide", type_string_in(["wide", "full", "compact"])],+ "mode": ["read", type_string_in(["read", "edit"])],+ }++ def on_create(self, parent: etree.Element) -> etree.Element:+ # Create container div+ container = etree.SubElement(parent, "div")+ container.set("class", "marimo-embed-container")+ return container++ def on_add(self, block: etree.Element) -> etree.Element:+ return block++ def on_end(self, block: etree.Element) -> None:+ # Extract the Python code+ code = block.text.strip() if block.text else ""++ # Remove ```python if present+ if code.startswith("```python"):+ code = code[9:] # first 9 characters are ```python+ code = code[:-3] # last 3 characters are ```++ # Dedent the code+ code = textwrap.dedent(code)++ # Create iframe element+ size: str = cast(str, self.options["size"])+ app_width: str = cast(str, self.options["app_width"])+ mode: str = cast(str, self.options["mode"])+ url = create_marimo_iframe(code=code, app_width=app_width, mode=mode)++ # Clear existing content+ block.text = None+ for child in block:+ block.remove(child)++ # Add iframe+ iframe = etree.SubElement(block, "iframe")+ iframe.set("class", f"demo {size}")+ iframe.set("src", url)+ iframe.set(+ "allow",+ "camera; geolocation; microphone; fullscreen; autoplay; encrypted-media; picture-in-picture; clipboard-read; clipboard-write",+ )+ iframe.set("width", "100%")+ iframe.set("height", "400px")+ iframe.set("frameborder", "0")+ iframe.set("style", "display: block; margin: 0 auto;")++ def on_markdown(self) -> str:+ return "raw"+++def uri_encode_component(code: str) -> str:+ return urllib.parse.quote(code, safe="~()*!.'")+++def create_marimo_iframe(+ *,+ code: str,+ mode: str = "read",+ app_width: str = "wide",+) -> str:+ header = "\n".join(+ [+ "import marimo",+ f'app = marimo.App(width="{app_width}")',+ "",+ ]+ )+ footer = "\n".join(+ [+ "",+ "@app.cell",+ "def __():",+ " import marimo as mo",+ " return",+ ]+ )+ body = header + code + footer+ encoded_code = uri_encode_component(body)+ return f"https://marimo.app/?code={encoded_code}&embed=true&mode={mode}"+++class MarimoBlocksExtension(BlocksExtension):+ def extendMarkdownBlocks(self, md: Any, block_mgr: Any) -> None:+ block_mgr.register(MarimoEmbedBlock, self.getConfigs())+++def makeExtension(*args: Any, **kwargs: Any) -> MarimoBlocksExtension:+ return MarimoBlocksExtension(*args, **kwargs)diff --git a/docs/community.md b/docs/community.mdindex ee43f033fc..fc5182d342 100644--- a/docs/community.md+++ b/docs/community.md@@ -1,8 +1,15 @@# Community-```{eval-rst}-.. readmepart:: Community-```+We're building a community. Come hang out with us!++- 🌟 [Star us on GitHub](https://github.com/marimo-team/marimo)+- 💬 [Chat with us on Discord](https://marimo.io/discord?ref=readme)+- 📧 [Subscribe to our Newsletter](https://marimo.io/newsletter)+- ☁️ [Join our Cloud Waitlist](https://marimo.io/cloud)+- ✏️ [Start a GitHub Discussion](https://github.com/marimo-team/marimo/discussions)+- 🦋 [Follow us on Bluesky](https://bsky.app/profile/marimo.io)+- 🐦 [Follow us on Twitter](https://twitter.com/marimo_io)+- 🕴️ [Follow us on LinkedIn](https://www.linkedin.com/company/marimo-io)## Shieldsdiff --git a/docs/examples.md b/docs/examples.mdindex c623945843..6b90e3c07f 100644--- a/docs/examples.md+++ b/docs/examples.md@@ -3,7 +3,7 @@We have a large [library ofexamples](https://github.com/marimo-team/marimo/tree/main/examples) in ourrepo. Each example [encapsulates its own Python dependencies in a package-sandbox](/guides/editor_features/package_management.md), making it easy to run.+sandbox](guides/editor_features/package_management.md), making it easy to run.We've deployed some of these examples at our [publicgallery](https://marimo.io/@public).diff --git a/docs/faq.md b/docs/faq.mdindex 0ccf9f2b97..3305e35c6d 100644--- a/docs/faq.md+++ b/docs/faq.md@@ -331,15 +331,15 @@ Use [`mo.show_code`](/api/outputs.md#marimo.show_code).### How do I create an output with a dynamic number of UI elements?-Use [`mo.ui.array`](/api/inputs/array.md#marimo.ui.array),-[`mo.ui.dictionary`](/api/inputs/dictionary.md#marimo.ui.dictionary), or-[`mo.ui.batch`](/api/inputs/batch.md#marimo.ui.batch) to create a UI element+Use [`mo.ui.array`](api/inputs/array.md#marimo.ui.array),+[`mo.ui.dictionary`](api/inputs/dictionary.md#marimo.ui.dictionary), or+[`mo.ui.batch`](api/inputs/batch.md#marimo.ui.batch) to create a UI elementthat wraps a dynamic number of other UI elements.If you need custom-formatting, use [`mo.ui.batch`](/api/inputs/batch.md#marimo.ui.batch), otherwise-use [`mo.ui.array`](/api/inputs/array.md#marimo.ui.array) or-[`mo.ui.dictionary`](/api/inputs/dictionary.md#marimo.ui.dictionary).+formatting, use [`mo.ui.batch`](api/inputs/batch.md#marimo.ui.batch), otherwise+use [`mo.ui.array`](api/inputs/array.md#marimo.ui.array) or+[`mo.ui.dictionary`](api/inputs/dictionary.md#marimo.ui.dictionary).For usage examples, see the[recipes for grouping UI elements together](/recipes.md#grouping-ui-elements-together).@@ -375,9 +375,9 @@ mo.vstack([mo.ui.button(on_change=lambda _: print("I was called")) for _ in rangIn such cases (when you want to output a dynamic number of UI elements),you need to use-[`mo.ui.array`](/api/inputs/array.md#marimo.ui.array),-[`mo.ui.dictionary`](/api/inputs/dictionary.md#marimo.ui.dictionary), or-[`mo.ui.batch`](/api/inputs/batch.md#marimo.ui.batch).+[`mo.ui.array`](api/inputs/array.md#marimo.ui.array),+[`mo.ui.dictionary`](api/inputs/dictionary.md#marimo.ui.dictionary), or+[`mo.ui.batch`](api/inputs/batch.md#marimo.ui.batch).See the[recipes for grouping UI elements together](/recipes.md#grouping-ui-elements-together)@@ -412,10 +412,10 @@ This is necessary because [in Python, closures are late-binding](https://docs.pyOur "SQL" cells are really just Python under the hood to keep notebooks as pure Python scripts. By default, we use `f-strings` for SQL strings, which allows for parameterized SQL like `SELECT * from table where value < {min}`.-To escape real `{`/`}` that you don't want parameterized, use double `{{...}}`:+To escape real `{` / `}` that you don't want parameterized, use double `\{\{...\}\}`:```sql-SELECT unnest([{{'a': 42, 'b': 84}}, {{'a': 100, 'b': NULL}}]);+SELECT unnest([\{\{'a': 42, 'b': 84\}\}, \{\{'a': 100, 'b': NULL\}\}]);```<a name="faq-annotations"></a>diff --git a/docs/getting_started/index.md b/docs/getting_started/index.mdindex c4beb7567f..19e7bacf67 100644--- a/docs/getting_started/index.md+++ b/docs/getting_started/index.md@@ -1,19 +1,9 @@# Getting Started-```{eval-rst}-.. toctree::- :maxdepth: 2- :hidden:-- installation- quickstart- key_concepts-```-These tutorials will help you get started with marimo-| Guide | Description |-| :------------------ | :------------------------------------------------------------------------------------------------------ |-| {doc}`installation` | Installing marimo |-| {doc}`quickstart` | Create notebooks, run apps, and more from the marimo command-line |-| {doc}`key_concepts` | A tour of key features and concepts |+| Guide | Description |+|-------|-------------|+| [Installation](installation.md) | Installing marimo |+| [Quickstart](quickstart.md) | Create notebooks, run apps, and more from the marimo command-line |+| [Key Concepts](key_concepts.md) | A tour of key features and concepts |diff --git a/docs/getting_started/installation.md b/docs/getting_started/installation.mdindex a3b5ba12ad..9cff848d30 100644--- a/docs/getting_started/installation.md+++ b/docs/getting_started/installation.md@@ -1,66 +1,63 @@# Installation-Before installing marimo, we recommend creating and activating a Python[virtual environment](https://docs.python.org/3/tutorial/venv.html#creating-virtual-environments).-```{dropdown} Setting up a virtual environment--Python uses virtual environments to minimize conflicts among packages.-Here's a quickstart for `pip` users. If you use `conda`, please use a [`conda`-environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands)-instead.+??? note "Setting up a virtual environment"-Run the following in the terminal:+ Python uses virtual environments to minimize conflicts among packages.+ Here's a quickstart for `pip` users. If you use `conda`, please use a [`conda`+ environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands)+ instead.+ Run the following in the terminal:-- create an environment with `python -m venv marimo-env`-- activate the environment:- - macOS/Unix: `source marimo-env/bin/activate`- - Windows: `marimo-env\Scripts\activate`+ - create an environment with `python -m venv marimo-env`+ - activate the environment:+ - macOS/Unix: `source marimo-env/bin/activate`+ - Windows: `marimo-env\Scripts\activate`-_Make sure the environment is activated before installing marimo and when-using marimo._ Install other packages you may need, such as numpy, pandas, matplotlib,-and altair, in this environment. When you're done, deactivate the environment-with `deactivate` in the terimnal.+ _Make sure the environment is activated before installing marimo and when+ using marimo._ Install other packages you may need, such as numpy, pandas, matplotlib,+ and altair, in this environment. When you're done, deactivate the environment+ with `deactivate` in the terimnal.-Learn more from the [official Python tutorial](https://docs.python.org/3/tutorial/venv.html#creating-virtual-environments).+ Learn more from the [official Python tutorial](https://docs.python.org/3/tutorial/venv.html#creating-virtual-environments).-:::{admonition} Using uv?-:class: tip+/// admonition | Using uv?+ type: tip[uv](https://github.com/astral-sh/uv) is a next-generation Python packageinstaller and manager that is 10-100x faster than pip, and also makes it easyto install Python and manage projects. With `uv`, creating a virtualenvironment is as easy as `uv venv`.-:::-```+///To install marimo, run the following in a terminal:-::::{tab-set}-:::{tab-item} install with pip+/// tab | install with pip```bashpip install marimo```-:::-:::{tab-item} install with uv+///++/// tab | install with uv```bashuv pip install marimo```-:::-:::{tab-item} install with conda+///++/// tab | install with conda```bashconda install -c conda-forge marimo```-:::-::::+///To check if the install worked, run@@ -70,7 +67,8 @@ marimo tutorial introA tutorial notebook should open in your browser.-```{admonition} Installation issues?+/// admonition | Installation issues?+ type: noteHaving installation issues? Reach out to us [at GitHub](https://github.com/marimo-team/marimo/issues) or [on Discord](https://marimo.io/discord?ref=docs).-```+///diff --git a/docs/getting_started/key_concepts.md b/docs/getting_started/key_concepts.mdindex 28dfd036dc..ea690ea983 100644--- a/docs/getting_started/key_concepts.md+++ b/docs/getting_started/key_concepts.md@@ -13,21 +13,19 @@ elements in a reproducible **notebook environment**.marimo notebooks are **reactive**: they automatically react to your codechanges and UI interactions and keep your notebook up-to-date, not unlike aspreadsheet. This makes your notebooks reproducibile, [eliminating hidden-state](/faq.md#faq-problems); it's also what enables marimo notebooks to double as+state](../faq.md#faq-problems); it's also what enables marimo notebooks to double asapps and Python scripts.-```{admonition} Working with expensive notebooks-:class: important+!!! important "Working with expensive notebooks"-If you don't want cells to run automatically, the [runtime can be-configured](/guides/configuration/runtime_configuration.md) to be lazy, only-running cells when you ask for them to be run and marking affected cells as-stale. **See our guide on working with [expensive-notebooks](/guides/expensive_notebooks.md) for more tips.**-```+ If you don't want cells to run automatically, the [runtime can be+ configured](../guides/configuration/runtime_configuration.md) to be lazy, only+ running cells when you ask for them to be run and marking affected cells as+ stale. **See our guide on working with [expensive+ notebooks](../guides/expensive_notebooks.md) for more tips.****Create your first notebook.** After [installing-marimo](/getting_started/installation.md), create your first notebook with+marimo](../getting_started/installation.md), create your first notebook with```bashmarimo edit my_notebook.py@@ -35,7 +33,6 @@ marimo edit my_notebook.pyat the command-line.-**The marimo library**.We recommend starting each marimo notebook with a cell containing a singleline of code,@@ -81,19 +78,15 @@ cell's code just once, creating a directed acyclic graph based on theglobal names each cell defines and reads. This is how data flowsin a marimo notebook.+!!! warning "Minimize variable mutation."-```{admonition} Minimize variable mutation.-:class: warning--marimo's understanding of your code is based on variable definitions and-references; marimo does not track mutations to objects at runtime. For this-reason, if you need to mutate a variable (such as adding a new column to a-dataframe), you should perform the mutation in the same cell as the one that-defines it.--Learn more in our [reactivity guide](/guides/reactivity.md#reactivity-mutations).-```+ marimo's understanding of your code is based on variable definitions and+ references; marimo does not track mutations to objects at runtime. For this+ reason, if you need to mutate a variable (such as adding a new column to a+ dataframe), you should perform the mutation in the same cell as the one that+ defines it.+Learn more in our [reactivity guide](../guides/reactivity.md#reactivity-mutations).For more on reactive execution, open the dataflow tutorial@@ -101,7 +94,7 @@ For more on reactive execution, open the dataflow tutorialmarimo tutorial dataflow```-or read the [reactivity guide](/guides/reactivity.md).+or read the [reactivity guide](../guides/reactivity.md).### Visualizing outputs@@ -121,7 +114,7 @@ other marimo elements to build rich composite outputs:The marimo library also comes with elements for laying out outputs, including[`mo.hstack`](#marimo.hstack), [`mo.vstack`](#marimo.vstack),-[`mo.accordion`](#marimo.accordion), [`mo.ui.tabs`](#marimo.ui.tabs), [`mo.sidebar`](#marimo.sidebar),+[`mo.accordion`](#marimo.accordion), [`mo.ui.tabs`](#marimo.ui.tabs), [`mo.sidebar`](#sidebar),[`mo.nav_menu`](#marimo.nav_menu), [`mo.ui.table`](#marimo.ui.table),and [many more](https://docs.marimo.io/api/layouts/index.html).@@ -133,12 +126,12 @@ marimo tutorial plotsmarimo tutorial layout```-or read the [visualizing outputs guide](/guides/outputs.md).+or read the [visualizing outputs guide](../guides/outputs.md).### Creating interactive elementsThe marimo library comes with many interactive stateful elements in-[`marimo.ui`](/api/inputs/index), including simple ones like sliders, dropdowns, text fields, and file+[`marimo.ui`](../api/inputs/index), including simple ones like sliders, dropdowns, text fields, and fileupload areas, as well as composite ones like forms, arrays, and dictionariesthat can wrap other UI elements.@@ -164,12 +157,10 @@ global variables._ Use composite elements like [`mo.ui.array`](marimo.ui.array)[`mo.ui.dictionary`](marimo.ui.dictionary) if the set of UI elements is notknown until runtime.-```{admonition} Using buttons to execute cells-:class: tip+!!! tip "Using buttons to execute cells"-Use [`mo.ui.run_button`](marimo.ui.run_button) to create a button that-triggers computation when clicked; see our recipes for [an example](/recipes#create-a-button-that-triggers-computation-when-clicked).-```+ Use [`mo.ui.run_button`](marimo.ui.run_button) to create a button that+ triggers computation when clicked; see our recipes for [an example](../recipes#create-a-button-that-triggers-computation-when-clicked).For more on interactive elements, run the UI tutorial@@ -177,7 +168,7 @@ For more on interactive elements, run the UI tutorialmarimo tutorial ui```-or read the [interactivity guide](/guides/interactivity.md).+or read the [interactivity guide](../guides/interactivity.md).### Querying dataframes and databases with SQL@@ -203,7 +194,7 @@ To learn more, run the SQL tutorialmarimo tutorial sql```-or read the [SQL guide](/guides/working_with_data/sql.md).+or read the [SQL guide](../guides/working_with_data/sql.md).## Running notebooks as applications@@ -219,7 +210,7 @@ marimo run my_notebook.py```The default renderer just hides the notebook code and concatenates outputs-vertically. But marimo also supports [other layouts](/guides/apps.md),+vertically. But marimo also supports [other layouts](../guides/apps.md),such as slides and grid.## Running notebooks as scripts@@ -231,4 +222,4 @@ can be executed as a script from the command-line:python my_notebook.py```-You can also [pass command-line arguments](/guides/scripts.md) to scripts.+You can also [pass command-line arguments](../guides/scripts.md) to scripts.diff --git a/docs/getting_started/quickstart.md b/docs/getting_started/quickstart.mdindex b956bbf304..aaaab93720 100644--- a/docs/getting_started/quickstart.md+++ b/docs/getting_started/quickstart.md@@ -50,23 +50,19 @@ marimo convert your_notebook.ipynb -o your_notebook.pyThen open the notebook with `marimo edit your_notebook.py`-:::{admonition} Disable autorun on startup-:class: tip+!!! tip "Disable autorun on startup"+ marimo automatically runs notebooks when they are opened. If this+ is a problem for you (not all Jupyter notebooks are designed to be run on+ startup), you can disable autorun on startup via [user configuration](../guides/configuration/runtime_configuration.md).-marimo automatically runs notebooks when they are opened. If this-is a problem for you (not all Jupyter notebooks are designed to be run on-startup), you can disable autorun on startup via [user configuration](/guides/configuration/runtime_configuration.md).+ 1. Type `marimo config show` to get the location of your config file.+ 2. If no config file exists, create it at `~/.marimo.toml` or `$XDG_CONFIG_HOME/marimo/marimo.toml`.+ 3. Update your config to include the following:-1. Type `marimo config show` to get the location of your config file.-2. If no config file exists, create it at `~/.marimo.toml` or `$XDG_CONFIG_HOME/marimo/marimo.toml`.-3. Update your config to include the following:--```toml-[runtime]-auto_instantiate = false-```--:::+ ```toml+ [runtime]+ auto_instantiate = false+ ```## Export marimo notebooks to other file formats@@ -83,36 +79,36 @@ and markdown.Some features require additional dependencies, which are not installed by default. This includes:-- [SQL cells](/guides/working_with_data/sql.md)+- [SQL cells](../guides/working_with_data/sql.md)- Charts in the datasource viewer-- [AI features](/guides/editor_features/ai_completion.md)+- [AI features](../guides/editor_features/ai_completion.md)- Format on saveTo install the optional dependencies, run:-::::{tab-set}-:::{tab-item} install with pip+/// tab | install with pip```bashpip install "marimo[recommended]"```-:::-:::{tab-item} install with uv+///++/// tab | install with uv```bashuv pip install "marimo[recommended]"```-:::-:::{tab-item} install with conda+///++/// tab | install with conda```bashconda install -c conda-forge marimo duckdb altair polars openai ruff```-:::-::::+///This will install: `duckdb`, `altair`, `polars`, `openai`, and `ruff`.@@ -129,8 +125,8 @@ _Get started with Copilot_:_Note_: Copilot is not yet available in our conda distribution; please installmarimo from `PyPI` if you need Copilot.-marimo also comes with support for [other copilots](/guides/editor_features/ai_completion.md#codeium-copilot),-and a built-in [AI assistant](/guides/editor_features/ai_completion.md#generate-code-with-our-ai-assistant) that helps you write code.+marimo also comes with support for [other copilots](../guides/editor_features/ai_completion.md#codeium-copilot),+and a built-in [AI assistant](../guides/editor_features/ai_completion.md#generate-code-with-our-ai-assistant) that helps you write code.## Try our VS Code extension@@ -142,6 +138,6 @@ all marimo notebooks in your current directory.<div align="center"><figure>-<img src="/_static/vscode-marimo.png"/>+<img src="/assets/vscode-marimo.png" alt="VS Code extension for marimo"/></figure></div>diff --git a/docs/guides/best_practices.md b/docs/guides/best_practices.mdindex 60216abbb6..766ae9bbc3 100644--- a/docs/guides/best_practices.md+++ b/docs/guides/best_practices.md@@ -1,4 +1,3 @@-# Best practicesHere are best practices for writing marimo notebooks.@@ -22,56 +21,51 @@ when working with expensive notebooks. For example, prevent a cell from runninguntil a button is clicked using [`mo.ui.run_button`](#marimo.ui.run_button) and[`mo.stop`](#marimo.stop).-```{admonition} Expensive notebooks-:class: caution--For more tips on working with expensive notebooks, see the-associated [guide](/guides/expensive_notebooks.md).-```+!!! caution "Expensive notebooks"+ For more tips on working with expensive notebooks, see the+ associated [guide](../guides/expensive_notebooks.md).**Use Python modules.** If your notebook gets too long, split complex logicinto helper Python modules and import them into your notebook. Use marimo'sbuilt-in [module-reloading](/guides/configuration/runtime_configuration.md#on-module-change)+reloading](../guides/configuration/runtime_configuration.md#on-module-change)to automatically bring changes from your modules into your notebook.**Minimize mutations.** marimo does not track mutations to objects. Try toonly mutate an object in the cell that creates it, or create new objectsinstead of mutating existing ones.-:::{dropdown} Example--_Don't_ split up declarations and mutations over multiple cells. For example, _don't-do this:_+??? example "Example"-```python-l = [1, 2, 3]-```+ _Don't_ split up declarations and mutations over multiple cells. For example, _don't+ do this:_-```python-l.append(new_item())-```+ ```python+ l = [1, 2, 3]+ ```-Instead, _do_ **declare and mutate in the same cell**:+ ```python+ l.append(new_item())+ ```-```python-l = [1, 2, 3]-...-l.append(new_item())-```+ Instead, _do_ **declare and mutate in the same cell**:-or, if working in multiple cells, **declare a new variable based on the old-one**:+ ```python+ l = [1, 2, 3]+ ...+ l.append(new_item())+ ```-```python-l = [1, 2, 3]-```+ or, if working in multiple cells, **declare a new variable based on the old+ one**:-```python-extended_list = l + [new_item()]-```+ ```python+ l = [1, 2, 3]+ ```-:::+ ```python+ extended_list = l + [new_item()]+ ```**Write idempotent cells.**Write cells whose outputs and behavior are the samediff --git a/docs/guides/coming_from/index.md b/docs/guides/coming_from/index.mdindex 2fc001f5f3..646fd28301 100644--- a/docs/guides/coming_from/index.md+++ b/docs/guides/coming_from/index.md@@ -1,30 +1,15 @@# Coming from other tools-```{eval-rst}-.. toctree::- :maxdepth: 2- :hidden:-- streamlit- jupytext- papermill-```-marimo is a **single tool** that replaces `jupyter`, `streamlit`, `jupytext`,`ipywidgets`, `papermill`, and more.+| Guide | Description |+|-------|-------------|+| [Streamlit](streamlit.md) | Transitioning from Streamlit |+| [Jupytext](jupytext.md) | Transitioning from Jupytext |+| [Papermill](papermill.md) | Transitioning from Papermill |--| Guide | Description |-| :--------------- | :----------------------------------- |-| {doc}`streamlit` | Transitioning from Streamlit |-| {doc}`jupytext` | Transitioning from Jupytext |-| {doc}`papermill` | Transitioning from Papermill |--```{admonition} Coming from Jupyter?-:class: important--See our [coming from Jupyter guide](/guides/coming_from/jupyter.md).-```+!!! important "Coming from Jupyter?"+ See our [coming from Jupyter guide](../guides/coming_from/jupyter.md).diff --git a/docs/guides/coming_from/jupyter.md b/docs/guides/coming_from/jupyter.mdindex b3a24267ba..1cd9eb07bb 100644--- a/docs/guides/coming_from/jupyter.md+++ b/docs/guides/coming_from/jupyter.md@@ -13,7 +13,7 @@ other. As a result a Jupyter notebook can easilyaccumulate "hidden state" (and hidden bugs) --- you might accidentally executecells out of order, or you might run (or delete) a cell but forget to re-runcells that depended on its variables. Because of this, Jupyter notebooks-suffer from a [reproducibility crisis](/faq.md#faq-problems), with over+suffer from a [reproducibility crisis](../faq.md#faq-problems), with overa third of Jupyter notebooks on GitHub failing to reproduce.Unlike Jupyter, **marimo** notebooks understand how different blocks of@@ -29,51 +29,52 @@ help you adapt to marimo's execution model.**### Configure marimo's runtime-[Configure marimo's runtime](/guides/configuration/runtime_configuration.md) to+[Configure marimo's runtime](../configuration/runtime_configuration.md) tonot autorun on startup or on cell execution.Even when autorun is disabled, marimo still tracks dependencies across cells,marking dependents of a cell as stale when you run it. You can click a single-button to run all your stale cells and bring your notebook back up-to-date.+button to run all your stale cells and bring your notebook back up-to-date.### Stop execution with `mo.stop`-Use [`mo.stop`](#marimo.stop) to stop a cell from executing if a condition+Use [`mo.stop`](../../api/control_flow.md#marimo.stop) to stop a cell from executing if a conditionis met:-```+```python# if condition is True, the cell will stop executing after mo.stop() returnsmo.stop(condition)# this won't be called if condition is Trueexpensive_function_call()```-Use [`mo.stop()`](#marimo.stop) in conjunction with-[`mo.ui.run_button()`](#marimo.ui.run_button) to require a button press for+Use [`mo.stop()`](../../api/control_flow.md#marimo.stop) in conjunction with+[`mo.ui.run_button()`](../../api/inputs/run_button.md) to require a button press forexpensive cells:-```{eval-rst}-.. marimo-embed::- :size: medium-- @app.cell- def __():- run_button = mo.ui.run_button()- run_button- return-- @app.cell- def __():- mo.stop(not run_button.value, mo.md("Click 👆 to run this cell"))- mo.md("You clicked the button! 🎉")- return+/// marimo-embed+ size: medium++```python+def __():+ run_button = mo.ui.run_button()+ run_button+ return++def __():+ mo.stop(not run_button.value, mo.md("Click 👆 to run this cell"))+ mo.md("You clicked the button! 🎉")+ return```+///+### Working with expensive notebooksFor more tips on adapting to marimo's execution model, see our guide-on [working with expensive notebooks](/guides/expensive_notebooks).-+on [working with expensive notebooks](expensive_notebooks.md).## Adapting to marimo's restriction on redefining variables@@ -127,12 +128,12 @@ augmented_df["another_column"] = [3, 4]## Adapting to marimo's file formatmarimo stores notebooks as Python, not JSON. This lets you version notebooks-with git, [execute them as scripts](/guides/scripts.md), and import named+with git, [execute them as scripts](scripts.md), and import namedcells into other Python files. However, it does mean that your notebook outputs(e.g., plots) are not stored in the file.If you'd like to keep a visual record of your notebook work, [enable-the "Auto-download as HTML" setting](/guides/configuration), which will+the "Auto-download as HTML" setting](configuration/index.md), which willperiodically snapshot your notebook as HTML to a `__marimo__` folder in thenotebook directory.@@ -140,7 +141,7 @@ notebook directory.Convert Jupyter notebooks to marimo notebooks at the command-line:-```+```bashmarimo convert your_notebook.ipynb -o your_notebook.py```@@ -165,13 +166,12 @@ subprocess.run(["ls", "-l"])Use marimo's package management sidebar panel to install packages to your currentenvironment. Learn more in our [package management-guide](/guides/editor_features/package_management.md).+guide](../editor_features/package_management.md).## Interactive guideThis guide contains additional tips to help you adapt to marimo. Fun fact: theguide is itself a marimo notebook!-<iframe src="https://marimo.app/l/z0aerp?embed=true" class="demo xxlarge" frameBorder="0"></iframe>diff --git a/docs/guides/coming_from/jupytext.md b/docs/guides/coming_from/jupytext.mdindex 052cdb093e..f9255b029b 100644--- a/docs/guides/coming_from/jupytext.md+++ b/docs/guides/coming_from/jupytext.md@@ -9,113 +9,59 @@ on IPython/Jupyter. Here's a comparison to help you transition smoothly.## Notebook Format-:::{list-table}-:widths: 50 50--* * **Jupytext**- * **marimo**-* * Jupytext uses comments or special markers to define cell types in notebooks.- * Notebooks are pure Python (`.py`) files by default, using- standard Python syntax, such as decorators and functions, to define cells.-:::+| Jupytext | marimo |+|----------|--------|+| Jupytext uses comments or special markers to define cell types in notebooks. | Notebooks are pure Python (`.py`) files by default, using standard Python syntax, such as decorators and functions, to define cells. |## Converting Jupyter notebooks### From `.ipynb`-:::{list-table}-:widths: 50 50--* * **Jupytext**- * **marimo**-* * `jupytext --to py notebook.ipynb`- * `marimo convert notebook.ipynb > notebook.py`-:::--:::{admonition} From py:percent notebooks to marimo notebooks-:class: tip+| Jupytext | marimo |+|----------|--------|+| `jupytext --to py notebook.ipynb` | `marimo convert notebook.ipynb > notebook.py` |-If you have a Python file encoded in the [py:percent](https://jupytext.readthedocs.io/en/latest/#text-notebooks)-format, you can convert it to a marimo notebook in two steps:+!!! tip "From py:percent notebooks to marimo notebooks"+ If you have a Python file encoded in the [py:percent](https://jupytext.readthedocs.io/en/latest/#text-notebooks)+ format, you can convert it to a marimo notebook in two steps:-```-jupytext --to notebook.ipynb percent_notebook.py-marimo convert notebook.ipynb > marimo_notebook.py-```--:::+ ```+ jupytext --to notebook.ipynb percent_notebook.py+ marimo convert notebook.ipynb > marimo_notebook.py+ ```### To `.ipynb`-:::{list-table}-:widths: 50 50--* * **Jupytext**- * **marimo**-* * `jupytext --to notebook.ipynb notebook.py`- * `marimo export ipynb notebook.py > notebook.ipynb`-:::+| Jupytext | marimo |+|----------|--------|+| `jupytext --to notebook.ipynb notebook.py` | `marimo export ipynb notebook.py > notebook.ipynb` |## Editing Notebooks-:::{list-table}-:widths: 50 50--* * **Jupytext**- * **marimo**-* * Requires synchronization between `.ipynb` and `.py` files.- * Edit marimo notebooks files directly in the marimo editor (`marimo edit- notebook.py`), and changes are read from and written to the same file.-:::+| Jupytext | marimo |+|----------|--------|+| Requires synchronization between `.ipynb` and `.py` files. | Edit marimo notebooks files directly in the marimo editor (`marimo edit notebook.py`), and changes are read from and written to the same file. |## Executing Notebooks-:::{list-table}-:widths: 50 50--* * **Jupytext**- * **marimo**-* * Use Jupyter to edit notebooks interactively, or Papermill to execute notebooks- from the command line.- * In addition to running notebooks interactively (`marimo- notebook.py`), you can run notebooks as scripts (`python notebook.py`) or as apps- (`marimo run notebook.py`), passing values to them with marimo's built-in support- for [CLI args](/api/cli_args.md).-:::+| Jupytext | marimo |+|----------|--------|+| Use Jupyter to edit notebooks interactively, or Papermill to execute notebooks from the command line. | In addition to running notebooks interactively (`marimo notebook.py`), you can run notebooks as scripts (`python notebook.py`) or as apps (`marimo run notebook.py`), passing values to them with marimo's built-in support for [CLI args](../../api/cli_args.md). |## Version Control-:::{list-table}-:widths: 50 50--* * **Jupytext**- * **marimo**-* * Jupyter notebooks are stored as JSON by default, making them difficult to- meaningfully version with git. Use Jupytext to pair and synchronize- jupyter notebooks with text representations for smaller git diffs.- * Notebooks are already in `.py` format, making them git-friendly- by default. Small changes to the notebook are guaranteed to yield small- diffs.-:::+| Jupytext | marimo |+|----------|--------|+| Jupyter notebooks are stored as JSON by default, making them difficult to meaningfully version with git. Use Jupytext to pair and synchronize jupyter notebooks with text representations for smaller git diffs. | Notebooks are already in `.py` format, making them git-friendly by default. Small changes to the notebook are guaranteed to yield small diffs. |## Markdown and Code Cells-:::{list-table}-:widths: 50 50--* * **Jupytext**- * **marimo**-* * Uses special markers or formats to distinguish cell types. Magical syntax is required.- * Uses `mo.md("...")` for Markdown content, and interpolate Python values with `mo.md(f"...")`; no magical syntax.-:::+| Jupytext | marimo |+|----------|--------|+| Uses special markers or formats to distinguish cell types. Magical syntax is required. | Uses `mo.md("...")` for Markdown content, and interpolate Python values with `mo.md(f"...")`; no magical syntax. |## Deployment-:::{list-table}-:widths: 50 50--* * **Jupytext**- * **marimo**-* * Requires migrating to other libraries like Voila or Streamlit for deployment.- * Can be deployed as interactive web apps with `marimo run`.-:::+| Jupytext | marimo |+|----------|--------|+| Requires migrating to other libraries like Voila or Streamlit for deployment. | Can be deployed as interactive web apps with `marimo run`. |diff --git a/docs/guides/coming_from/papermill.md b/docs/guides/coming_from/papermill.mdindex 77ebdbed86..6e000c7c59 100644--- a/docs/guides/coming_from/papermill.md+++ b/docs/guides/coming_from/papermill.md@@ -16,7 +16,7 @@ and injecting values at runtime.marimo offers two main ways to parameterize notebooks:1. **Command Line Arguments**:- Use [`mo.cli_args`](/api/cli_args.md) to access command-line arguments passed to your notebook.+ Use [`mo.cli_args`](../../api/cli_args.md) to access command-line arguments passed to your notebook.```pythonimport marimo as mo@@ -75,7 +75,7 @@ programmatically.1. **Running a named cell**:After naming a cell in your file, you can run it using the- [cell execution API](/api/cell.md#marimo.Cell.run).+ [cell execution API](../../api/cell.md#marimo.Cell.run).```pythonfrom my_notebook import my_cell@@ -86,7 +86,7 @@ programmatically.```This API also allows for parametrizing the inputs to the cell; to learn more,- make sure to checkout [the example](#marimo.Cell.run) in our API reference.+ make sure to checkout [the example](../../api/cell.md#marimo.Cell.run) in our API reference.2. **Using subprocess**:diff --git a/docs/guides/coming_from/streamlit.md b/docs/guides/coming_from/streamlit.mdindex c02a82027d..15c18696f6 100644--- a/docs/guides/coming_from/streamlit.md+++ b/docs/guides/coming_from/streamlit.md@@ -30,7 +30,7 @@ In addition, marimo is much more performant than streamlit.- marimo's structure allows for more fine-grained reactivity.- Unlike streamlit files, marimo files can be executed as Python scripts from thecommand-line, and can be imported and used as a module by other Python- programs. For example, other programs can [reuse cells](#marimo.Cell.run) from+ programs. For example, other programs can [reuse cells](../../api/cell.md#marimo.Cell.run) froma marimo notebook.4. **UI Elements**:@@ -47,7 +47,7 @@ you reuse widgets that were originally developed for the Jupyter ecosystem,5. **Built-in Editor**:-- marimo includes a [built-in editor](/guides/editor_features/index.md) for notebooks, designed specifically+- marimo includes a [built-in editor](../editor_features/index.md) for notebooks, designed specificallyfor working with data.- Streamlit relies on external editors.- Both approaches have their pros and cons.@@ -56,7 +56,7 @@ for working with data.- marimo's notebook environment allows for iterative and interactivedevelopment and exploration, letting it serve as your daily driver for- working with data. marimo even has native support for [SQL](/guides/working_with_data/sql.md).+ working with data. marimo even has native support for [SQL](../working_with_data/sql.md).- Streamlit is exclusively used for building standalone data apps.## Common Streamlit Features in marimodiff --git a/docs/guides/configuration/index.md b/docs/guides/configuration/index.mdindex 4689256bde..fde2f862bc 100644--- a/docs/guides/configuration/index.md+++ b/docs/guides/configuration/index.md@@ -1,15 +1,5 @@# Configuration-```{eval-rst}-.. toctree::- :maxdepth: 2- :hidden:-- runtime_configuration- theming- html_head-```-marimo offers two types of configuration: User Configuration and AppConfiguration. Both can be easily managed through the Settings menu in themarimo editor.@@ -22,8 +12,8 @@ App Configuration is specific to each notebook and is stored in the `notebook.py- Notebook width- Notebook title-- [Custom CSS](/guides/configuration/theming.md)-- [Custom HTML Head](/guides/configuration/html_head.md)+- [Custom CSS](theming.md)+- [Custom HTML Head](html_head.md)- Automatically download HTML snapshotsConfigure these settings through the notebook menu (⚙️) in the top-right corner.@@ -42,16 +32,16 @@ marimo UI for a more user-friendly experience.You can customize the following settings:-- [Runtime](/guides/configuration/runtime_configuration.md), including whether notebooks autorun-- [Hotkeys](/guides/editor_features/hotkeys.md)+- [Runtime](runtime_configuration.md), including whether notebooks autorun+- [Hotkeys](../editor_features/hotkeys.md)- Completion (auto-completion, AI copilot, etc.)- Display (theme, font size, output placement, etc.)- Autosave-- [Package management](/guides/editor_features/package_management.md#package-management)+- [Package management](../editor_features/package_management.md#package-management)- Server settings-- [VIM keybindings](/guides/editor_features/overview.md#vim-keybindings)+- [VIM keybindings](../editor_features/overview.md#vim-keybindings)- Formatting settings-- [AI assistance](/guides/editor_features/ai_completion.md)+- [AI assistance](../editor_features/ai_completion.md)- Experimental features### User configuration filediff --git a/docs/guides/configuration/runtime_configuration.md b/docs/guides/configuration/runtime_configuration.mdindex d959f388b3..10832be22b 100644--- a/docs/guides/configuration/runtime_configuration.md+++ b/docs/guides/configuration/runtime_configuration.md@@ -5,19 +5,17 @@ runs cells.<video controls width="100%" height="100%" align="center" src="/_static/docs-runtime-config.mp4"> </video>--## On startupBy default, marimo notebooks run automatically on startup; just how the command-```+```bashpython main.py```executes a script,-```+```bashmarimo edit notebook.py```@@ -45,16 +43,14 @@ all stale cells.**When should I use lazy evaluation?** Choosing the lazy runtime can be helpfulwhen working on notebooks with expensive cells.-:::{admonition} Tip: speed up expensive notebooks with marimo's smart caching-:class: tip+!!! tip "Tip: speed up expensive notebooks with marimo's smart caching"-In addition to runtime configuration, marimo also provides [opt-in caching](/guides/caching.md)+In addition to runtime configuration, marimo also provides [opt-in caching](caching.md)to help you work with expensive or side-effectful notebooks. marimo'scan cache expensive functions in memory and expensive blocks of code to disk,letting you skip entire sections of your code and automatically loadingvariables in memory on notebook startup. Read our [caching-guide](/api/caching.md) to learn more.-:::+guide](caching.md) to learn more._When sharing a notebook as an app with `marimo run`, this setting hasno effect._@@ -66,27 +62,22 @@ edit Python files. Based on static analysis, the reloader only runs cellsaffected by your edits. The reloader is recursive, meaning that marimo tracksmodifications for modules imported by your notebook's imported modules too.-:::{admonition} Why autoreload?-:class: tip+!!! tip "Why autoreload?"Autoreloading enables a workflow that many developers findproductive: develop complex logic in Python modules, and use the marimonotebook as a DAG or main script that orchestrates your logic.-:::Autoreloading comes in two types:1. **autorun**: automatically re-runs cells affected by module modification.-<figure><video controls loop width="100%" height="100%" align="center" src="/_static/docs-module-reloading.mp4"> </video><figcaption align="center">When set to autorun, marimo's reloader automatically run cells when you edit Python files.</figcaption></figure>--2. **lazy**: marks cells affected by module- modifications as stale, letting you know which cells need to be re-run.+2. **lazy**: marks cells affected by module modifications as stale, letting you know which cells need to be re-run.<figure><video controls loop width="100%" height="100%" align="center" src="/_static/docs-module-reloading-lazy.mp4"> </video>diff --git a/docs/guides/configuration/theming.md b/docs/guides/configuration/theming.mdindex 7d39b8690e..deef94b874 100644--- a/docs/guides/configuration/theming.md+++ b/docs/guides/configuration/theming.md@@ -18,11 +18,9 @@ We support only a few CSS variables as part of the "public API" for theming. The--marimo-heading-font```-```{admonition} Other CSS Variables-:class: warning+!!! warning "Other CSS Variables"We cannot guarantee that other CSS variables or classnames will be stable across versions.-```## Example@@ -47,7 +45,7 @@ Here is an example of a custom CSS file that changes the font of the notebook:You can further customize your notebook by adding custom HTML in the `<head>` section of your notebook. This allows you to add additional functionality to your notebook, such as analytics, custom fonts, meta tags, or external scripts.-See the [Custom HTML Head](/guides/configuration/html_head.md) guide for more details.+See the [Custom HTML Head](html_head.md) guide for more details.## Community Themesdiff --git a/docs/guides/deploying/index.md b/docs/guides/deploying/index.mdindex abb65f1383..62557c2824 100644--- a/docs/guides/deploying/index.md+++ b/docs/guides/deploying/index.md@@ -9,28 +9,24 @@ You can deploy marimo in three ways:3. programmatically, which allows you serve **read-only** marimo appsas part of other ASGI applications, for example using FastAPI.-```{admonition} Sharing lightweight notebooks on the web-:class: tip+!!! tip "Sharing lightweight notebooks on the web"+ To share notebooks on the public web, try using [our online playground](https://marimo.new). Our playground runs entirely in the browser -- no+ backend required, via [WASM](../../guides/wasm.md).-To share notebooks on the public web, try using [our online playground-](https://marimo.new). Our playground runs entirely in the browser -- no-backend required, via [WASM](/guides/wasm.md).+ Or, to share notebooks with email-based authorization, you can also+ try our free [community cloud](https://marimo.io/sign-up), which is+ also powered by WASM.-Or, to share notebooks with email-based authorization, you can also-try our free [community cloud](https://marimo.io/sign-up), which is-also powered by WASM.--WASM notebooks support most but not all Python features and packages.-```+ WASM notebooks support most but not all Python features and packages.## Deploying an edit serverHere are a few ways to deploy an edit server on a remote instance:-1. With [ssh-port forwarding](/faq.md#faq-remote), using `marimo edit --headless`.-2. Via docker and our [prebuilt containers](/guides/prebuilt_containers.md).-3. Via a deployment service [such as Railway](/guides/deploying/deploying_railway.md).-4. [Behind JupyterHub](/faq.md#faq-jupyter-hub).+1. With [ssh-port forwarding](../../faq.md#faq-remote), using `marimo edit --headless`.+2. Via docker and our [prebuilt containers](../../guides/prebuilt_containers.md).+3. Via a deployment service [such as Railway](deploying_railway.md).+4. [Behind JupyterHub](../../faq.md#faq-jupyter-hub).## Deploying as read-only apps@@ -38,12 +34,12 @@ These guides help you deploy marimo notebooks as read-only apps.| | || :------------------------------ | :------------------------------------------------------- |-| {doc}`programmatically` | Programmatically run and customize read-only marimo apps |-| {doc}`deploying_docker` | Deploy with Docker |-| {doc}`authentication` | Authentication and security |-| {doc}`deploying_public_gallery` | Deploy to our public gallery |-| {doc}`deploying_hugging_face` | Deploy to Hugging Face |-| {doc}`deploying_ploomber` | Deploy to Ploomber Cloud |+| [programmatically](programmatically.md) | Programmatically run and customize read-only marimo apps |+| [deploying_docker](deploying_docker.md) | Deploy with Docker |+| [authentication](authentication.md) | Authentication and security |+| [deploying_public_gallery](deploying_public_gallery.md) | Deploy to our public gallery |+| [deploying_hugging_face](deploying_hugging_face.md) | Deploy to Hugging Face |+| [deploying_ploomber](deploying_ploomber.md) | Deploy to Ploomber Cloud |### Health and status endpointsdiff --git a/docs/guides/editor_features/ai_completion.md b/docs/guides/editor_features/ai_completion.mdindex 0be3f37cbe..8311e3a4fb 100644--- a/docs/guides/editor_features/ai_completion.md+++ b/docs/guides/editor_features/ai_completion.md@@ -16,11 +16,9 @@ _Get started with Copilot_:1. Install [Node.js](https://nodejs.org/en/download).2. Enable Copilot via the settings menu in the marimo editor.-```{admonition} Installation Requirement-:class: note+!!! note "Installation Requirement"Copilot is not yet available in our conda distribution; please installmarimo using ``pip`` if you need Copilot.-```## Codeium Copilot@@ -88,12 +86,14 @@ You can customize how the AI assistant behaves by adding rules in the marimo set</div>For example, you can add rules about:+- Preferred plotting libraries (matplotlib, plotly, altair)- Data handling practices- Code style conventions- Error handling preferencesExample custom rules:+```Use plotly for interactive visualizations and matplotlib for static plotsPrefer polars over pandas for data manipulation due to better performance@@ -113,10 +113,12 @@ For plotting:```To locate your configuration file, run:+```bashmarimo config show```-At the top, the path to your `marimo.toml` file will be shown. You can Ctrl/Cmd+click the path to open it in your editor. For more information about configuration, see the [Configuration Guide](/guides/configuration/index).++At the top, the path to your `marimo.toml` file will be shown. You can Ctrl/Cmd+click the path to open it in your editor. For more information about configuration, see the [Configuration Guide](../guides/configuration/index).Below we describe how to connect marimo to your AI provider. Once enabled, you can generate entirely new cells by clicking the "Generate with AI" button at the bottom of your notebook. You can also refactor existing cells by inputting `Ctrl/Cmd-Shift-e` in a cell, opening an input to modify the cell using AI.@@ -185,25 +187,30 @@ Ollama allows you to run open-source LLMs on your local machine. To integrate Ol1. Download and install [Ollama](https://ollama.com/).2. Download the model you want to use:+```bash# View available models at https://ollama.com/libraryollama pull llama3.1ollama pull codellama # recommended for code generation-+# View your installed modelsollama ls```+3. Start the Ollama server in a terminal:+```bashollama serve# In a new terminalollama run codellama # or any model from ollama ls```-4. Visit http://127.0.0.1:11434 to confirm that the server is running.++4. Visit <http://127.0.0.1:11434> to confirm that the server is running.> **Note**: If you get a "port already in use" error, you may need to close an existing Ollama instance. On Windows, click the up arrow in the taskbar, find the Ollama icon, and select "Quit". This is a known issue (see [Ollama Issue #3575](https://github.com/ollama/ollama/issues/3575)). Once you've closed the existing Ollama instance, you should be able to run `ollama serve` successfully.5. Open a new terminal and start marimo:+```bashmarimo edit notebook.py```diff --git a/docs/guides/editor_features/index.md b/docs/guides/editor_features/index.mdindex 72a033c2c5..a904b5f03d 100644--- a/docs/guides/editor_features/index.md+++ b/docs/guides/editor_features/index.md@@ -1,27 +1,16 @@# Editor features-```{eval-rst}-.. toctree::- :maxdepth: 2- :hidden:-- overview- package_management- ai_completion- hotkeys-```-The **marimo editor** is the browser-based IDE in which you write marimonotebooks. We've taken a batteries-included approach to designing the editor:it comes _packed_ with features to make you productive when workingwith code and data.-| Guide | Description |-| :------------------------ | :----------------------------------------------- |-| {doc}`overview` | An overview of editor features and configuration |-| {doc}`package_management` | Using package managers in marimo |-| {doc}`ai_completion` | Code with the help of a language model |-| {doc}`hotkeys` | Our hotkeys |+| Guide | Description |+|-------|-------------|+| [Overview](overview.md) | An overview of editor features and configuration |+| [Package Management](package_management.md) | Using package managers in marimo |+| [AI Completion](ai_completion.md) | Code with the help of a language model |+| [Hotkeys](hotkeys.md) | Our hotkeys |Highlights include:diff --git a/docs/guides/editor_features/overview.md b/docs/guides/editor_features/overview.mdindex fa995bdb0f..f3c9dccf96 100644--- a/docs/guides/editor_features/overview.md+++ b/docs/guides/editor_features/overview.md@@ -20,7 +20,7 @@ To access these settings, click the gear icon in the top-right of the editor:A non-exhaustive list of settings:- Outputs above or below code cells-- [Disable/enable autorun](/guides/reactivity.md#runtime-configuration)+- [Disable/enable autorun](../reactivity.md#runtime-configuration)- Package installation- Vim keybindings- Dark mode@@ -28,9 +28,9 @@ A non-exhaustive list of settings:- Auto-complete- Editor font-size- Code formatting with ruff/black-- [GitHub Copilot](/guides/editor_features/ai_completion.md)-- [LLM coding assistant](/guides/editor_features/ai_completion.md)-- [Module autoreloading](/guides/configuration/runtime_configuration.md#on-module-change)+- [GitHub Copilot](ai_completion.md)+- [LLM coding assistant](ai_completion.md)+- [Module autoreloading](../configuration/runtime_configuration.md#on-module-change)### Vim keybindings@@ -83,9 +83,7 @@ create.## Keyboard shortcutsWe've kept some well-known [keyboard-shortcuts](/guides/editor_features/hotkeys.md) for notebooks (`Ctrl-Enter`,-`Shift-Enter`), dropped others, and added a few of our own. Hit-`Ctrl/Cmd-Shift-H` to pull up the shortcuts.+shortcuts](hotkeys.md) for notebooks (`Ctrl-Enter`, `Shift-Enter`), dropped others, and added a few of our own. Hit `Ctrl/Cmd-Shift-H` to pull up the shortcuts.We know keyboard shortcuts are very personal; you can remap them in theconfiguration.@@ -109,7 +107,7 @@ _Missing a command? File a## Share on our online playground-Get a link to share your notebook via our [online playground](/guides/wasm.md):+Get a link to share your notebook via our [online playground](../wasm.md):<div align="center"><figure>diff --git a/docs/guides/editor_features/package_management.md b/docs/guides/editor_features/package_management.mdindex ab8457a3bb..c7f7d768bd 100644--- a/docs/guides/editor_features/package_management.md+++ b/docs/guides/editor_features/package_management.md@@ -4,11 +4,9 @@ marimo supports package management for `pip, rye, uv, poetry, pixi`. When marimoOnce the module is installed, all cells that depend on the module will be rerun.-```{admonition} Package Installation-:class: note+!!! note "Package Installation"-We use some heuristic for guessing the package name in your registry (e.g. PyPI) from the module name. It is possible that the package name is different from the module name. If you encounter an error, please file an issue or help us by adding your mapping [directly to the codebase](https://github.com/marimo-team/marimo/blob/main/marimo/_runtime/packages/module_name_to_pypi_name.py).-```+ We use some heuristic for guessing the package name in your registry (e.g. PyPI) from the module name. It is possible that the package name is different from the module name. If you encounter an error, please file an issue or help us by adding your mapping [directly to the codebase](https://github.com/marimo-team/marimo/blob/main/marimo/_runtime/packages/module_name_to_pypi_name.py).## Running `marimo` in a sandbox environment (`uv` only)diff --git a/docs/guides/expensive_notebooks.md b/docs/guides/expensive_notebooks.mdindex f634ad7f38..3d9e04d7d7 100644--- a/docs/guides/expensive_notebooks.md+++ b/docs/guides/expensive_notebooks.md@@ -9,33 +9,33 @@ accidentally running.Use [`mo.stop`](#marimo.stop) to stop a cell from executing if a conditionis met:-```+````# if condition is True, the cell will stop executing after mo.stop() returnsmo.stop(condition)# this won't be called if condition is Trueexpensive_function_call()-```Use [`mo.stop()`](#marimo.stop) in conjunction with[`mo.ui.run_button()`](#marimo.ui.run_button) to require a button press forexpensive cells:-```{eval-rst}-.. marimo-embed::- :size: medium-- @app.cell- def __():- run_button = mo.ui.run_button()- run_button- return-- @app.cell- def __():- mo.stop(not run_button.value, mo.md("Click 👆 to run this cell"))- mo.md("You clicked the button! 🎉")- return+/// marimo-embed+ size: medium++```python+def __():+ run_button = mo.ui.run_button()+ run_button+ return++def __():+ mo.stop(not run_button.value, mo.md("Click 👆 to run this cell"))+ mo.md("You clicked the button! 🎉")+ return```+///## Configure how marimo runs cells@@ -43,7 +43,7 @@ expensive cells:If you habitually work with very expensive notebooks, you can[disable automatic-execution](/guides/configuration/runtime_configuration.md#on-cell-change). When+execution](../guides/configuration/runtime_configuration.md#on-cell-change). Whenautomatic execution is disabled, when you run a cell, marimomarks dependent cells as stale instead of running them automatically.@@ -51,14 +51,14 @@ marks dependent cells as stale instead of running them automatically.marimo autoruns notebooks on startup, with `marimo edit notebook.py` behavinganalogously to `python notebook.py`. This can also be disabled through the-[notebook settings](/guides/configuration/runtime_configuration.md#on-startup).+[notebook settings](../guides/configuration/runtime_configuration.md#on-startup).### Disable individual cellsmarimo lets you temporarily disable cells from automatically running. This ishelpful when you want to edit one part of a notebook without triggeringexecution of other parts. See the-[reactivity guide](/guides/reactivity.md#disabling-cells) for more info.+[reactivity guide](../guides/reactivity.md#disabling-cells) for more info.## Caching@@ -74,7 +74,6 @@ import modef compute_predictions(problem_parameters):# do some expensive computations and return a value...-```When `compute_predictions` is called with a value of`problem_parameters` it hasn't seen, it will compute the predictions and store@@ -82,26 +81,25 @@ them in an in-memory cache. The next time it is called with the sameparameters, instead of recomputing the predictions, it will return thepreviously computed value from the cache.-:::{dropdown} Comparison to `functools.cache`+??? note "Comparison to `functools.cache`"-`mo.cache` is like `functools.cache` but smarter. `functools` will sometimes-evict values from the cache when it doesn't need to.+ `mo.cache` is like `functools.cache` but smarter. `functools` will sometimes+ evict values from the cache when it doesn't need to.-In particular, consider the case when a cell defining a `@mo.cache`-d function-re-runs due to an ancestor of it running, or a UI element value changing.-`mo.cache` will use sophisticated analysis of the dataflow graph to determine-whether or not the decorated function has changed, and if it hasn't, it's-cache won't be invalidated. In contrast, on re-run a `functools` cache is-always invalidated, because `functools` has no knowledge about the structure-of marimo's dataflow graph.+ In particular, consider the case when a cell defining a `@mo.cache`-d function+ re-runs due to an ancestor of it running, or a UI element value changing.+ `mo.cache` will use sophisticated analysis of the dataflow graph to determine+ whether or not the decorated function has changed, and if it hasn't, it's+ cache won't be invalidated. In contrast, on re-run a `functools` cache is+ always invalidated, because `functools` has no knowledge about the structure+ of marimo's dataflow graph.-Conversely, `mo.cache` knows to invalidate the cache if closed over variables-change, whereas `functools.cache` doesn't, yielding incorrect cache hits.+ Conversely, `mo.cache` knows to invalidate the cache if closed over variables+ change, whereas `functools.cache` doesn't, yielding incorrect cache hits.-`mo.cache` is slightly slower than `functools.cache`, but in most applications-the overhead is negligible. For performance critical code, where the decorated-function will be called in a tight loop, prefer `functools.cache`.-:::+ `mo.cache` is slightly slower than `functools.cache`, but in most applications+ the overhead is negligible. For performance critical code, where the decorated+ function will be called in a tight loop, prefer `functools.cache`.### Save and load from disk with `mo.persistent_cache`@@ -123,7 +121,6 @@ with mo.persistent_cache(name="my_cache"):# will be loaded from disk.my_variable = some_expensive_function()...-```Roughly speaking, `mo.persistent_cache` registers a cache hit when the cellis not stale, meaning its code hasn't changed and neither have its ancestors.@@ -142,7 +139,6 @@ import marimo as modata = db.query("SELECT * FROM data")mo.lazy(mo.ui.table(data))-```In this example, `mo.ui.table(data)` will not be rendered on the frontend until is it in the viewport.For example, an element can be out of the viewport due to scroll, inside a tab that is not selected, or inside an accordion that is not open.@@ -161,10 +157,10 @@ def expensive_component():accordion = mo.ui.accordion({"Charts": mo.lazy(expensive_component)})-```In this example, we pass a function to `mo.lazy` instead of a component. Thisfunction will only be called when the user opens the accordion. In this way,`expensive_component` lazily computed and we only query the database when theuser needs to see the data. This can be useful when the data is expensive tocompute and the user may not need to see it immediately.+````diff --git a/docs/guides/exporting.md b/docs/guides/exporting.mdindex 92bfd8ef7c..b6d6ba9b08 100644--- a/docs/guides/exporting.md+++ b/docs/guides/exporting.md@@ -41,12 +41,10 @@ marimo export html notebook.py -o notebook.html --watchWhen you export from the command line, marimo runs your notebook to produceits visual outputs before saving as HTML.-```{admonition} Note-:class: note+!!! note "Note"If any cells error during the export process, the status code will be non-zero. However, the export result may still be generated, with the error included in the output.Errors can be ignored by appending `|| true` to the command, e.g. `marimo export html notebook.py || true`.-```## Export to a Python script@@ -57,13 +55,11 @@ their dependency graph.marimo export script notebook.py -o notebook.script.py```-```{admonition} Top-level await not supported-:class: warning+!!! warning "Top-level await not supported"Exporting to a flat Python script does not support top-level await. If you havetop-level await in your notebook, you can still execute the notebook as ascript with `python notebook.py`.-```## Export to markdown@@ -151,12 +147,10 @@ Options:- `--output`: Directory to save the HTML and required assets- `--show-code/--no-show-code`: Whether to initially show or hide the code in the notebook-```{admonition} Note-:class: note+!!! note "Note"The exported file must be served over HTTP to function correctly - it cannot be opened directly from the filesystem (file://).Your server must also serve the assets in the `assets` directory, next to the HTML file. For this reason, we recommend using the online playground if possible: <https://marimo.app>.-```### Testing the export@@ -209,12 +203,10 @@ jobs:## 🏝️ Embed marimo outputs in HTML using Islands-```{admonition} Preview-:class: note+!!! note "Preview"Islands are an early feature. While the API likely won't change, there are some improvements we'd like to make before we consider them stable.Please let us know on [GitHub](https://github.com/marimo-team/marimo/issues) if you run into any issues or have any feedback!-```marimo islands are a way to embed marimo outputs and/or python code in your HTML that will become interactive when the page is loaded. This is useful for creating interactive blog posts, tutorials, and educational materials, all powered by marimo's reactive runtime.@@ -222,17 +214,15 @@ Check out an [example island-powered document](./island_example.md).### Islands in action-```{admonition} Advanced topic!-:class: warning+!!! warning "Advanced topic!"Islands are an advanced concept that is meant to be a building block for creating integrations with existing tools such as static site generators or documentation tools.-```In order to use marimo islands, you need to import the necessary JS/CSS headers in your HTML file, and use our custom HTML tags to define the islands.```html<head>- <!-- marimo js/ccs -->+ <!-- marimo js/ccs --<script type="module" src="https://cdn.jsdelivr.net/npm/@marimo-team/islands@<version>/dist/main.js"></script><linkhref="https://cdn.jsdelivr.net/npm/@marimo-team/islands@<version>/dist/style.css"@@ -270,9 +260,4 @@ In order to use marimo islands, you need to import the necessary JS/CSS headersWhile you can generate the HTML code for islands yourself, it it recommend to use our `MarimoIslandGenerator` class to generate the HTML code for you.-```{eval-rst}-.. autoclass:: marimo.MarimoIslandGenerator- :members:-- .. autoclasstoc::-```+::: marimo.MarimoIslandGeneratordiff --git a/docs/guides/index.md b/docs/guides/index.mdindex 3dd48e99a1..e2af7405e9 100644--- a/docs/guides/index.md+++ b/docs/guides/index.md@@ -1,56 +1,29 @@# Guides-```{eval-rst}-.. toctree::- :maxdepth: 2- :hidden:-- reactivity- interactivity- outputs- coming_from/jupyter- expensive_notebooks- working_with_data/index- editor_features/index- configuration/index- apps- scripts- coming_from/index- integrating_with_marimo/index- state- wasm- exporting- deploying/index- best_practices- troubleshooting-```-These guides cover marimo's core concepts.-```{admonition} Learn by doing!-:class: tip+!!! tip "Learn by doing!"-Prefer a hands-on learning experience? marimo comes packaged with interactive-tutorials that you can launch with `marimo tutorial` at the command line.-```+ Prefer a hands-on learning experience? marimo comes packaged with interactive+ tutorials that you can launch with `marimo tutorial` at the command line.| Guide | Description || :----------------------------------- | :----------------------------------------------------------- |-| {doc}`reactivity` | How marimo runs cells |-| {doc}`interactivity` | Using interactive UI elements |-| {doc}`outputs` | Creating markdown, plots, and other visual outputs |-| {doc}`/guides/coming_from/jupyter` | Tips for transitioning from Jupyter |-| {doc}`expensive_notebooks` | Tips for working with expensive notebooks |-| {doc}`working_with_data/index` | Using SQL cells, no-code dataframe tools, and reactive plots |-| {doc}`editor_features/index` | View variables, dataframe schemas, docstrings, and more |-| {doc}`configuration/index` | Configure various settings |-| {doc}`apps` | Running notebooks as apps |-| {doc}`scripts` | Running notebooks as scripts |-| {doc}`coming_from/index` | Transitioning from Jupyter and other tools |-| {doc}`integrating_with_marimo/index` | Rich displays of objects, custom UI plugins |-| {doc}`state` | Advanced: mutable reactive state |-| {doc}`wasm` | Create notebooks in our online playground |-| {doc}`exporting` | Exporting notebooks to HTML and flat scripts |-| {doc}`deploying/index` | Deploying marimo notebooks and apps |-| {doc}`best_practices` | Best practices to help you get the most out of marimo |-| {doc}`troubleshooting` | Troubleshooting notebooks |+| [reactivity](reactivity.md) | How marimo runs cells |+| [interactivity](interactivity.md) | Using interactive UI elements |+| [outputs](outputs.md) | Creating markdown, plots, and other visual outputs |+| [coming_from/jupyter](coming_from/jupyter.md) | Tips for transitioning from Jupyter |+| [expensive_notebooks](expensive_notebooks.md) | Tips for working with expensive notebooks |+| [working_with_data/index](working_with_data/index.md) | Using SQL cells, no-code dataframe tools, and reactive plots |+| [editor_features/index](editor_features/index.md) | View variables, dataframe schemas, docstrings, and more |+| [configuration/index](configuration/index.md) | Configure various settings |+| [apps](apps.md) | Running notebooks as apps |+| [scripts](scripts.md) | Running notebooks as scripts |+| [coming_from/index](coming_from/index.md) | Transitioning from Jupyter and other tools |+| [integrating_with_marimo/index](integrating_with_marimo/index.md) | Rich displays of objects, custom UI plugins |+| [state](state.md) | Advanced: mutable reactive state |+| [wasm](wasm.md) | Create notebooks in our online playground |+| [exporting](exporting.md) | Exporting notebooks to HTML and flat scripts |+| [deploying/index](deploying/index.md) | Deploying marimo notebooks and apps |+| [best_practices](best_practices.md) | Best practices to help you get the most out of marimo |+| [troubleshooting](troubleshooting.md) | Troubleshooting notebooks |diff --git a/docs/guides/integrating_with_marimo/custom_ui_plugins.md b/docs/guides/integrating_with_marimo/custom_ui_plugins.mdindex 44b5a673e7..9b0cef9c34 100644--- a/docs/guides/integrating_with_marimo/custom_ui_plugins.md+++ b/docs/guides/integrating_with_marimo/custom_ui_plugins.md@@ -1,2 +1 @@-```{include} /api/inputs/anywidget.md-```+[Visit the AnyWidget API docs](../../api/inputs/anywidget.md) for more information.diff --git a/docs/guides/integrating_with_marimo/displaying_objects.md b/docs/guides/integrating_with_marimo/displaying_objects.mdindex d6d6e73e39..36b36237a2 100644--- a/docs/guides/integrating_with_marimo/displaying_objects.md+++ b/docs/guides/integrating_with_marimo/displaying_objects.md@@ -2,7 +2,7 @@marimo has built-in rich representations of many objects, including nativePython objects like lists and dicts as well as marimo objects like [UI-elements](/guides/interactivity.md) and libraries, including matplotlib,+elements](../interactivity.md) and libraries, including matplotlib,seaborn, Plotly, altair pandas, and more. These rich representations aredisplayed for the last expression of a cell, or when using[`mo.output.append`](#marimo.output.append).@@ -27,7 +27,7 @@ to visualize the object as an output.For example:-```+```pythonclass Dice:def _display_(self):import random@@ -84,17 +84,17 @@ a tuple of two strings, the [mime type](https://developer.mozilla.org/en-US/docs**Examples.**-```{eval-rst}-.. marimo-embed::- :size: medium- :mode: edit+/// marimo-embed+ size: medium+ mode: edit- @app.cell(hide_code=True)- def __():+```python[email protected](hide_code=True)+def __():mo.md("**JSON**")- @app.cell- def __():+def __():import jsonclass MyJSONObject(object):@@ -106,12 +106,12 @@ a tuple of two strings, the [mime type](https://developer.mozilla.org/en-US/docsMyJSONObject({"hello": "world"})- @app.cell(hide_code=True)- def __():[email protected](hide_code=True)+def __():mo.md("**HTML**")- @app.cell- def __():+def __():class Colorize(object):def __init__(self, text: str) -> None:self.text = text@@ -124,12 +124,12 @@ a tuple of two strings, the [mime type](https://developer.mozilla.org/en-US/docsColorize("Hello!")- @app.cell(hide_code=True)- def __():[email protected](hide_code=True)+def __():mo.md("**Image**")- @app.cell- def __():+def __():class Image(object):def __init__(self, url: str) -> None:self.url = url@@ -140,6 +140,8 @@ a tuple of two strings, the [mime type](https://developer.mozilla.org/en-US/docsImage("https://raw.githubusercontent.com/marimo-team/marimo/main/docs/_static/marimo-logotype-thick.svg")```+///+## Option 4: Add a formatter to the marimo repoThe recommended way to render rich displays of objects in marimo is todiff --git a/docs/guides/integrating_with_marimo/index.md b/docs/guides/integrating_with_marimo/index.mdindex 171cd4b55c..dd01503525 100644--- a/docs/guides/integrating_with_marimo/index.md+++ b/docs/guides/integrating_with_marimo/index.md@@ -1,29 +1,18 @@# Integrating with marimo-```{eval-rst}-.. toctree::- :maxdepth: 2- :hidden:-- displaying_objects- custom_ui_plugins-```-These guides will help you integrate your objects with marimo and hookinto marimo's reactive execution engine for UI plugins.Still need help? Reach out to us on [Discord](https://marimo.io/discord?ref=docs) or[GitHub issues](https://github.com/marimo-team/marimo/issues).-```{admonition} Checking if running in a marimo notebook-:class: tip+!!! tip "Checking if running in a marimo notebook"-You can check if Python is running in a marimo notebook with-[`mo.running_in_notebook`](#marimo.running_in_notebook). This can be helpful-when developing library code that integrates with marimo.-```+ You can check if Python is running in a marimo notebook with+ [`mo.running_in_notebook`](#marimo.running_in_notebook). This can be helpful+ when developing library code that integrates with marimo.-| | |-| :------------------------ | :------------------------------------------------------------------------ |-| {doc}`displaying_objects` | Richly display objects by hooking into marimo's media viewer |-| {doc}`custom_ui_plugins` | Build custom UI plugins that hook into marimo's reactive execution engine |+| Guide | Description |+|-------|-------------|+| [Displaying Objects](displaying_objects.md) | Richly display objects by hooking into marimo's media viewer |+| [Custom UI Plugins](custom_ui_plugins.md) | Build custom UI plugins that hook into marimo's reactive execution engine |diff --git a/docs/guides/interactivity.md b/docs/guides/interactivity.mdindex d44b07a246..725f40779b 100644--- a/docs/guides/interactivity.md+++ b/docs/guides/interactivity.md@@ -2,7 +2,7 @@One of marimo's most powerful features is its first-class support forinteractive, stateful user interface (UI) elements, or "widgets": create them using-[`marimo.ui`](/api/inputs/index/). **Interacting with a UI element bound to a+[`marimo.ui`](../api/inputs/index/). **Interacting with a UI element bound to aglobal variable automatically runs all cells that reference it.**<div align="center">@@ -18,12 +18,9 @@ Every UI element you make using `marimo.ui` has a value, accessible via itsvariable, its value is sent back to Python. A single rule determines whathappens next:-```{admonition} Interaction rule-:class: important--When a UI element assigned to a global variable is interacted with, marimo-automatically runs all cells that reference the variable (but don't define it).-```+!!! important "Interaction rule"+ When a UI element assigned to a global variable is interacted with, marimo+ automatically runs all cells that reference the variable (but don't define it).In the clip at the top of this page, interacting with the slider in thesecond cell re-runs the third cell (which outputs markdown) because it@@ -42,7 +39,6 @@ in [markdown](#marimo.md) using Python f-strings, like so:```python3slider = mo.ui.slider(1, 10)mo.md(f"Choose a value: {slider})")-```## Composite elements@@ -88,4 +84,4 @@ value on form submission.You can build your own reactive and interactive UI elements using[anywidget](https://github.com/manzt/anywidget)! See [our docs on-building custom UI elements](/guides/integrating_with_marimo/custom_ui_plugins.md) to learn more.+building custom UI elements](../guides/integrating_with_marimo/custom_ui_plugins.md) to learn more.diff --git a/docs/guides/island_example.md b/docs/guides/island_example.mdindex 6f89ee99f7..97931130d6 100644--- a/docs/guides/island_example.md+++ b/docs/guides/island_example.md@@ -24,12 +24,10 @@crossorigin="anonymous"/>-```{admonition} Preview-:class: note+!!! note "Preview"Islands are an early feature. While the API likely won't change, there are some improvements we'd like to make before we consider them stable.Please let us know on [GitHub](https://github.com/marimo-team/marimo/issues) if you run into any issues or have any feedback!-```> This content below is powered by marimo's reactive runtime. It will become interactive after initializing the marimo runtime.@@ -74,45 +72,43 @@ Please let us know on [GitHub](https://github.com/marimo-team/marimo/issues) if<hr style="margin: 20px 0;" />-````{dropdown} See the HTML+??? example "See the HTML"-```html-<marimo-island data-app-id="main" data-cell-id="Hbol" data-reactive="true">- <marimo-cell-output></marimo-cell-output>- <marimo-cell-code hidden>import%20marimo%20as%20mo</marimo-cell-code>-</marimo-island>-<marimo-island data-app-id="main" data-cell-id="MJUe" data-reactive="true">- <marimo-cell-output>- <marimo-ui-element object-id="MJUe-0" random-id="0a0beb44-f946-450d-a690-678a45aeb110">- <marimo-slider- data-initial-value="2"- data-label="null"- data-start="0"- data-stop="10"- data-steps="[]"- data-debounce="false"- data-orientation='"horizontal"'- data-show-value="false"- data-full-width="false"- ></marimo-slider>- </marimo-ui-element>- </marimo-cell-output>- <marimo-cell-code hidden>slider%20%3D%20mo.ui.slider(0%2C%2010,value=2)%3B%20slider</marimo-cell-code>-</marimo-island>-<marimo-island data-app-id="main" data-cell-id="vblA" data-reactive="true">- <marimo-cell-output>- <span class="markdown"><span class="paragraph">Hello, islands! 🏝️🏝️</span></span>- </marimo-cell-output>- <marimo-ui-element object-id="9c045fc3-f483-4024-ad01-cbf8f06cd7b7" random-id="9c045fc3-f483-4024-ad01-cbf8f06cd7b7">- <marimo-code-editor- data-initial-value='"mo.md(f'Hello, islands! {\"\ud83c\udfdd\ufe0f\" * slider.value}')"'- data-label="null"- data-language='"python"'- data-placeholder='""'- data-disabled="false"- ></marimo-code-editor>- </marimo-ui-element>-</marimo-island>-```--````+ ```html+ <marimo-island data-app-id="main" data-cell-id="Hbol" data-reactive="true">+ <marimo-cell-output></marimo-cell-output>+ <marimo-cell-code hidden>import%20marimo%20as%20mo</marimo-cell-code>+ </marimo-island>+ <marimo-island data-app-id="main" data-cell-id="MJUe" data-reactive="true">+ <marimo-cell-output>+ <marimo-ui-element object-id="MJUe-0" random-id="0a0beb44-f946-450d-a690-678a45aeb110">+ <marimo-slider+ data-initial-value="2"+ data-label="null"+ data-start="0"+ data-stop="10"+ data-steps="[]"+ data-debounce="false"+ data-orientation='"horizontal"'+ data-show-value="false"+ data-full-width="false"+ ></marimo-slider>+ </marimo-ui-element>+ </marimo-cell-output>+ <marimo-cell-code hidden>slider%20%3D%20mo.ui.slider(0%2C%2010,value=2)%3B%20slider</marimo-cell-code>+ </marimo-island>+ <marimo-island data-app-id="main" data-cell-id="vblA" data-reactive="true">+ <marimo-cell-output>+ <span class="markdown"><span class="paragraph">Hello, islands! 🏝️🏝️</span></span>+ </marimo-cell-output>+ <marimo-ui-element object-id="9c045fc3-f483-4024-ad01-cbf8f06cd7b7" random-id="9c045fc3-f483-4024-ad01-cbf8f06cd7b7">+ <marimo-code-editor+ data-initial-value='"mo.md(f'Hello, islands! {\"\ud83c\udfdd\ufe0f\" * slider.value}')"'+ data-label="null"+ data-language='"python"'+ data-placeholder='""'+ data-disabled="false"+ ></marimo-code-editor>+ </marimo-ui-element>+ </marimo-island>+ ```diff --git a/docs/guides/outputs.md b/docs/guides/outputs.mdindex dc8a3581bd..7a9537c7ec 100644--- a/docs/guides/outputs.md+++ b/docs/guides/outputs.md@@ -3,7 +3,7 @@The last expression of a cell is its visual output, rendered above the cell.Outputs are included in the "app" or read-only view of the notebook. marimocomes out of the box a number of elements to help you make rich outputs,-documented in the [API reference](/api/index/).+documented in the [API reference](../api/index/).<div align="center"><figure>@@ -13,7 +13,7 @@ documented in the [API reference](/api/index/).## Markdown-Markdown is written with the marimo library function [`mo.md`](/api/markdown/).+Markdown is written with the marimo library function [`mo.md`](../api/markdown/).Writing markdown programmatically lets you make dynamic markdown: interpolatePython values into markdown strings, conditionally render your markdown, andembed markdown in other objects.@@ -44,11 +44,11 @@ mo.md(```Notice that marimo knows how to render marimo objects in markdown: you can just-embed them in [`mo.md()`](/api/markdown) using an f-string, and marimo will+embed them in [`mo.md()`](../api/markdown) using an f-string, and marimo willfigure out how to display them!For other objects, like matplotlib plots, wrap-them in [`mo.as_html()`](#marimo.as_html) to tap into marimo's+them in [`mo.as_html()`](api/html/#marimo.as_html) to tap into marimo'smedia viewer:```python@@ -95,12 +95,13 @@ Use [`mo.status.progress_bar`](#marimo.status.progress_bar) and# mo.status.progress_bar is similar to TQDMfor i in mo.status.progress_bar(range(10)):print(i)+```## Mediamarimo comes with functions to display media, including images, audio,-video, pdfs, and more. See the [API docs](/api/media/index.md) for more info.+video, pdfs, and more. See the [API docs](../api/media/index.md) for more info.## Imperatively adding outputs@@ -108,7 +109,7 @@ While a cell's output is its last expression, it can at times be helpfulto imperatively add to the output area while a cell is running. marimoprovides utility functions like[`mo.output.append`](#marimo.output.append) for accomplishing this; see the-[API docs](/api/outputs.md) for more information.+[API docs](api/outputs.md) for more information.## Console Outputs@@ -126,7 +127,7 @@ with mo.redirect_stdout():marimo also includes utility functions for [capturing standard out](#marimo.capture_stdout) and [standarderror](#marimo.capture_stderr) without redirecting them. See the [API-docs](/api/outputs.md#console-outputs) for more.+docs](api/outputs.md#console-outputs) for more.## Threading@@ -134,7 +135,7 @@ To create a thread that can reliably communicate outputs to the frontend,use [`mo.Thread`](#marimo.Thread), which has exactly the same API asas `threading.Thread`.-If you need to forward outputs from threads spawned by third-party code, try+If you need to forward outputs from threads spawned by third-party code, trypatching `threading.Thread`:```pythondiff --git a/docs/guides/reactivity.md b/docs/guides/reactivity.mdindex 79fec0f7e1..fc293800b7 100644--- a/docs/guides/reactivity.md+++ b/docs/guides/reactivity.md@@ -9,23 +9,17 @@ the page.Reactive execution is based on a single rule:-```{admonition} Runtime Rule-:class: important--When a cell is run, marimo automatically runs all other cells that-**reference** any of the global variables it **defines**.-```--```{admonition} Working with expensive notebooks-:class: tip--marimo gives you tools that make it easy to work with expensive notebooks. For-example, the [runtime can be-configured](#/guides/configuration/runtime_configuration.md) to be lazy, only-running cells when you ask for them to be run and marking affected cells as-stale instead of auto-running them. **See our guide on working with [expensive-notebooks](/guides/expensive_notebooks.md) for more tips.**-```+!!! important "Runtime Rule"+ When a cell is run, marimo automatically runs all other cells that+ **reference** any of the global variables it **defines**.++!!! tip "Working with expensive notebooks"+ marimo gives you tools that make it easy to work with expensive notebooks. For+ example, the [runtime can be+ configured](../configuration/runtime_configuration.md) to be lazy, only+ running cells when you ask for them to be run and marking affected cells as+ stale instead of auto-running them. **See our guide on working with [expensive+ notebooks](expensive_notebooks.md) for more tips.**## References and definitions@@ -36,12 +30,9 @@ dependencies. marimo creates this graph by statically analyzing each cell- references, the global variables it reads but doesn't define;- definitions, the global variables it defines.-```{admonition} Global variables-:class: tip--A variable can refer to any Python object. Functions, classes, and imported-names are all variables.-```+!!! tip "Global variables"+ A variable can refer to any Python object. Functions, classes, and imported+ names are all variables.There is an edge from one cell to another if the latter cell references anyglobal variables defined by the former cell. The rule for reactive execution@@ -53,13 +44,10 @@ run automatically.To make sure your notebook is DAG, marimo requires that every globalvariable be defined by only one cell.-```{admonition} Local variables-:class: important--Variables prefixed with an underscore are local to a cell (_.e.g._, `_x`). You-can use this in a pinch to fix multiple definition errors, but try instead to-refactor your code.-```+!!! important "Local variables"+ Variables prefixed with an underscore are local to a cell (_.e.g._, `_x`). You+ can use this in a pinch to fix multiple definition errors, but try instead to+ refactor your code.This rule encourages you to keep the number of global variables in yourprogram small, which is generally considered good practice.@@ -118,21 +106,17 @@ _Don't_ do this:```pythonl = [1]-``````pythonl.append(2)-```_Instead_, do this:```pythonl = [1]-``````pythonextended_list = l + [2]-```**Mutate variables in the cells that define them.**@@ -140,35 +124,29 @@ _Don't_ do this:```pythondf = pd.DataFrame({"my_column": [1, 2]})-``````pythondf["another_column"] = [3, 4]-```_Instead_, do this:```pythondf = pd.DataFrame({"my_column": [1, 2]})df["another_column"] = [3, 4]-```--```{admonition} Why not track mutations?-:class: note-Tracking mutations reliably is a fundamentally impossible task in Python; marimo-could never detect all mutations, and even if we could, reacting to mutations could-result in surprising re-runs of notebook cells. The simplicity of marimo's-static analysis approach, based only on variable definitions and references,-makes marimo easy to understand and encourages well-organized notebook code.-```+!!! note "Why not track mutations?"+ Tracking mutations reliably is a fundamentally impossible task in Python; marimo+ could never detect all mutations, and even if we could, reacting to mutations could+ result in surprising re-runs of notebook cells. The simplicity of marimo's+ static analysis approach, based only on variable definitions and references,+ makes marimo easy to understand and encourages well-organized notebook code.## Runtime configurationThrough the notebook settings menu, you can configure how and when marimo runscells. In particular, you can disable autorun on startup, disable autorunon cell execution, and enable a powerful module autoreloader. Read our-[runtime configuration guide](/guides/configuration/runtime_configuration.md) to learn more.+[runtime configuration guide](../configuration/runtime_configuration.md) to learn more.## Disabling cellsdiff --git a/docs/guides/scripts.md b/docs/guides/scripts.mdindex 5c6966380c..374791b61c 100644--- a/docs/guides/scripts.md+++ b/docs/guides/scripts.md@@ -12,16 +12,12 @@ like writing to disk. Print statements and other console outputs will showup in your terminal.You can pass arguments to your notebook at the command-line: see-the [docs page on CLI args](/api/cli_args.md) to learn more.+the [docs page on CLI args](../api/cli_args.md) to learn more.---:::{admonition} Producing notebook outputs-:class: note+!!! note "Producing notebook outputs"To run as a script while also producing HTML of the notebook outputs, use```bashmarimo export html notebook.py -o notebook.html```-:::diff --git a/docs/guides/state.md b/docs/guides/state.mdindex ce33085ff8..afd7ff6e78 100644--- a/docs/guides/state.md+++ b/docs/guides/state.md@@ -1,39 +1,36 @@# Reactive state-```{admonition} Advanced topic!-:class: warning--This guide covers reactive state (`mo.state`), an advanced topic.--**You likely don't need reactive state**. UI elements already have built-in-state, their associated value, which you can access with their `value` attribute.-For example, `mo.ui.slider()` has a value that is its current position on an-interval, while `mo.ui.button()` has a value that can be configured to-count the number of times it has been clicked, or to toggle between `True` and-`False`. Additionally, interacting with UI elements bound to global variables-[automatically executes cells](guides/interactivity) that reference those-variables, letting you react to changes by just reading their-`value` attributes. This functional paradigm is the preferred way of-reacting to UI interactions in marimo. So if you-think you need to use `mo.state`, make sure to first read the [guide on-interactivity](/guides/interactivity.md). Chances are, the reactive execution-built into UI elements will suffice. (For example, [you don't need reactive-state to handle a button click](/recipes.md#working-with-buttons).)---That said, here are some signs you might need `mo.state`:-- you need to maintain historical state related to a UI element that can't- be computed from its built-in `value` (_e.g._, all values the user has- ever input into a form)-- you need to synchronize two different UI elements (_e.g._, so that- interacting with either one controls the other)-- you need to introduce cycles across cells--If one of these cases applies to you, then read on. `mo.state` lets you make-all kinds of interesting applications, but like mutable state in general,-it can complicate notebook development and has the potential to-introduce hard-to-find bugs.-```+!!! warning "Advanced topic!"+ This guide covers reactive state (`mo.state`), an advanced topic.++ **You likely don't need reactive state**. UI elements already have built-in+ state, their associated value, which you can access with their `value` attribute.+ For example, `mo.ui.slider()` has a value that is its current position on an+ interval, while `mo.ui.button()` has a value that can be configured to+ count the number of times it has been clicked, or to toggle between `True` and+ `False`. Additionally, interacting with UI elements bound to global variables+ [automatically executes cells](guides/interactivity) that reference those+ variables, letting you react to changes by just reading their+ `value` attributes. This functional paradigm is the preferred way of+ reacting to UI interactions in marimo. So if you+ think you need to use `mo.state`, make sure to first read the [guide on+ interactivity](../guides/interactivity.md). Chances are, the reactive execution+ built into UI elements will suffice. (For example, [you don't need reactive+ state to handle a button click](../recipes.md#working-with-buttons).)+++ That said, here are some signs you might need `mo.state`:+ - you need to maintain historical state related to a UI element that can't+ be computed from its built-in `value` (_e.g._, all values the user has+ ever input into a form)+ - you need to synchronize two different UI elements (_e.g._, so that+ interacting with either one controls the other)+ - you need to introduce cycles across cells++ If one of these cases applies to you, then read on. `mo.state` lets you make+ all kinds of interesting applications, but like mutable state in general,+ it can complicate notebook development and has the potential to+ introduce hard-to-find bugs.You can build powerful, interactive notebooks and apps using just `mo.ui` andreactivity.@@ -60,28 +57,23 @@ But sometimes, you might want interactions to mutate state:</figure></div>-For cases like these, marimo provides the function [`mo.state()`](/api/state),+For cases like these, marimo provides the function [`mo.state()`](../api/state.md),which creates a state object and returns a getter and setter function. When youcall the setter function in one cell, all other cells that reference the getterfunction **via a global variable** are automatically run (similar to UIelements).-```{admonition} State and UI elements are similar-:class: note-+!!! note "State and UI elements are similar"State is analogous to UI elements. When you interactwith a UI element, all cells that reference that element via a global variablerun automatically with the new value. In the same way, when you update statevia the setter, all other cells that reference the getter viaa global variable run automatically with the new value.-State is particularly useful when used in conjunction with a `UIElement`'s-`on_change` callback to run side effects based on user input.-```+ State is particularly useful when used in conjunction with a `UIElement`'s+ `on_change` callback to run side effects based on user input.-## Creating state--[`mo.state()`](/api/state) takes an initial state value as its argument, creates+[`mo.state()`](../api/state.md) takes an initial state value as its argument, createsa state object, and returns- a getter function for reading the state@@ -93,12 +85,9 @@ For exaxmple,get_counter, set_counter = mo.state(0)```-```{admonition} Assign state to global variables!-:class: attention--When using `mo.state()`, **you must assign the state getter to a global-variable**. This is similar to UI elements work.-```+!!! attention "Assign state to global variables!"+ When using `mo.state()`, **you must assign the state getter to a global+ variable**. This is similar to UI elements work.## Reading state@@ -126,13 +115,10 @@ set_counter(lambda count: count + 1)A single rule determines what happens next:-```{admonition} State reactivity rule-:class: tip--When a state setter function is called in one cell, marimo-automatically runs all _other_ cells that reference any **global** variables-assigned to the state getter.-```+!!! tip "State reactivity rule"+ When a state setter function is called in one cell, marimo+ automatically runs all _other_ cells that reference any **global** variables+ assigned to the state getter.This rule has some important aspects:@@ -151,13 +137,10 @@ Every UI element takes an optional `on_change` callback, a function that takesthe new value of the element and does anything with it. You can use the setterfunction in an `on_change` callback to mutate state.-```{admonition} Use state sparingly-:class: note--You can get far using just `mo.ui`, without state. But judiciously using-state can simplify the implementation of highly interactive notebooks/apps, and-also enables new use cases. The next few examples showcase good uses of state.-```+!!! note "Use state sparingly"+ You can get far using just `mo.ui`, without state. But judiciously using+ state can simplify the implementation of highly interactive notebooks/apps, and+ also enables new use cases. The next few examples showcase good uses of state.### Example: counter@@ -196,8 +179,8 @@ mo.md(f"""The counter's current value is **{get_counter()}**!- This cell runs automatically on button click, even though it- doesn't reference either button.+ This cell runs automatically on button click, even though it+ doesn't reference either button.""")```@@ -241,26 +224,21 @@ x_plus_one = mo.ui.number([x, x_plus_one]```-```{admonition} Create tied UI elements in separate cells-:class: note--Notice that we created the slider and number elements in different cells.-When tying elements, this is necessary, because calling a setter-in a cell queues all _other_ cells reading the state to run, not including-the one that just called the setter.-```+!!! note "Create tied UI elements in separate cells"+ Notice that we created the slider and number elements in different cells.+ When tying elements, this is necessary, because calling a setter+ in a cell queues all _other_ cells reading the state to run, not including+ the one that just called the setter.-```{admonition} Cycles at runtime-:class: warning-You can use state to introduce cycles across cells at runtime. This lets-you tie multiple UI elements together, for example. Just be careful not to-introduce an infinite loop!+!!! warning "Cycles at runtime"+ You can use state to introduce cycles across cells at runtime. This lets+ you tie multiple UI elements together, for example. Just be careful not to+ introduce an infinite loop!-marimo programs are statically parsed into directed acyclic graphs (DAGs)-involving cells, and state doesn't change that. Think of state setters-as hooking into the DAG: at runtime, when they're invoked (and only when-they're invoked), they trigger additional computation.-```+ marimo programs are statically parsed into directed acyclic graphs (DAGs)+ involving cells, and state doesn't change that. Think of state setters+ as hooking into the DAG: at runtime, when they're invoked (and only when+ they're invoked), they trigger additional computation.### Example: todo list@@ -315,7 +293,7 @@ clear_tasks_button = mo.ui.button()```-```+```pythontask_list = mo.ui.array([mo.ui.checkbox(value=task.done, label=task.name) for task in get_tasks()],label="tasks",@@ -325,7 +303,7 @@ task_list = mo.ui.array()```-```+```pythonmo.hstack([task_entry_box, add_task_button, clear_tasks_button], justify="start")diff --git a/docs/guides/troubleshooting.md b/docs/guides/troubleshooting.mdindex f953aeb735..b9cbc99bde 100644--- a/docs/guides/troubleshooting.md+++ b/docs/guides/troubleshooting.md@@ -1,6 +1,6 @@# Troubleshooting-This guide covers common issues and unexpected behaviors you might encounter when using marimo notebooks, along with ways to debug and resolve them. If your issue isn't covered here, try checking our [FAQ](/guides/faq.md).+This guide covers common issues and unexpected behaviors you might encounter when using marimo notebooks, along with ways to debug and resolve them. If your issue isn't covered here, try checking our [FAQ](../faq.md).## Why aren't my cells running?@@ -12,7 +12,7 @@ marimo doesn't track mutations to objects. If you're modifying an object in oneInstead of mutating objects across cells, try creating new objects or performing all mutations within the same cell.-[Read more about reactivity](/guides/reactivity.md).+[Read more about reactivity](../guides/reactivity.md).### Verify cell connectionsdiff --git a/docs/guides/wasm.md b/docs/guides/wasm.mdindex 62f4c54f42..becec89ffc 100644--- a/docs/guides/wasm.md+++ b/docs/guides/wasm.md@@ -15,29 +15,23 @@ having to install Python on your machine.**Try our playground!** Just navigate to[https://marimo.new](https://marimo.new).-```{admonition} WASM?-:class: note+!!! note "WASM?"-marimo-in-the-browser is powered by a technology called-[WebAssembly](https://webassembly.org/), or "WASM" for short. Hence the-name "WASM notebook".-```+ marimo-in-the-browser is powered by a technology called+ [WebAssembly](https://webassembly.org/), or "WASM" for short. Hence the+ name "WASM notebook".-```{admonition} When should I use WASM notebooks?-:class: note+!!! note "When should I use WASM notebooks?"-WASM notebooks are excellent for sharing your work, quickly experimenting with-code and models, doing lightweight data exploration, authoring blog posts,-tutorials, and educational materials, and even building tools. They are-not well-suited for notebooks that do heavy computation.-```+ WASM notebooks are excellent for sharing your work, quickly experimenting with+ code and models, doing lightweight data exploration, authoring blog posts,+ tutorials, and educational materials, and even building tools. They are+ not well-suited for notebooks that do heavy computation.-```{admonition} Issues?-:class: warning+!!! warning "Issues?"-WASM notebooks are a new feature. If you run into-problems, please open a [GitHub issue](https://github.com/marimo-team/marimo/issues).-```+ WASM notebooks are a new feature. If you run into+ problems, please open a [GitHub issue](https://github.com/marimo-team/marimo/issues).## Creating and sharing WASM notebooks@@ -52,13 +46,11 @@ Think of [marimo.new](https://marimo.new) as your own personalscratchpad for experimenting with code, data, and models and for prototypingtools, available to you at all times and on all devices.-```{admonition} Saving WASM notebooks-:class: tip+!!! tip "Saving WASM notebooks"When you save a WASM notebook, a copy of your code is saved to yourweb browser's local storage. When you return to [marimo.app](https://marimo.app),the last notebook you worked on will be re-opened.-```### Creating shareable permalinks@@ -99,14 +91,12 @@ In one cell, import micropip:```pythonimport micropip-```In the next one, install packages:```pythonawait micropip.install("plotly")import plotly-```**Try it!** A WASM notebook is embedded below. Try installing a package.@@ -168,7 +158,6 @@ providing your users with an interactive code playground.height="300"frameborder="0"></iframe>-```<iframe src="https://marimo.app/l/aojjhb?embed=true" width="100%" height="300" class="demo" frameBorder="0"></iframe>@@ -184,7 +173,6 @@ URL to your notebook](#creating-and-sharing-wasm-notebooks), then put it in an iheight="300"frameborder="0"></iframe>-```<iframe src="https://marimo.app/l/c7h6pz?embed=true" width="100%" height="600" class="demo" frameBorder="0"></iframe>@@ -203,7 +191,6 @@ You can optionally render embedded notebooks in read-only mode by appendingheight="300"frameborder="0"></iframe>-```<iframe src="https://marimo.app/l/c7h6pz?mode=read&embed=true" width="100%" height="600" class="demo" frameBorder="0"></iframe>diff --git a/docs/guides/working_with_data/dataframes.md b/docs/guides/working_with_data/dataframes.mdindex a852c2fbba..227e117a51 100644--- a/docs/guides/working_with_data/dataframes.md+++ b/docs/guides/working_with_data/dataframes.md@@ -17,16 +17,15 @@ marimo lets you page through, search, sort, and filter dataframes, making itextremely easy to get a feel for your data.<figure>-<video autoplay controls loop width="100%" height="100%" align="center" src="/_static/docs-df.mp4">-</video>+<video autoplay controls loop width="100%" height="100%" align="center" src="/_static/docs-df.mp4">+</video><figcaption>marimo brings dataframes to life.</figcaption></figure>Display dataframes by including them in the last expression of thecell, just like any other object.-::::{tab-set}-:::{tab-item} pandas+/// tab | pandas```pythonimport pandas as pd@@ -36,8 +35,11 @@ df = pd.read_json()df```-:::-:::{tab-item} polars++///++/// tab | polars+```pythonimport polars as pl@@ -46,35 +48,38 @@ df = pl.read_json()df```-:::-::::-To opt out of the rich dataframe viewer, use [`mo.plain`](marimo.plain):+///++To opt out of the rich dataframe viewer, use [`mo.plain`](../../api/outputs.md#marimo.plain):++/// tab | pandas-::::{tab-set}-:::{tab-item} pandas```pythondf = pd.read_json(- "https://raw.githubusercontent.com/vega/vega-datasets/master/data/cars.json"+"https://raw.githubusercontent.com/vega/vega-datasets/master/data/cars.json")mo.plain(df)```-:::-:::{tab-item} polars++///++/// tab | polars+```pythondf = pl.read_json(- "https://raw.githubusercontent.com/vega/vega-datasets/master/data/cars.json"+"https://raw.githubusercontent.com/vega/vega-datasets/master/data/cars.json")mo.plain(df)```-:::-::::++///## Transforming dataframes### No-code transformations-Use [`mo.ui.dataframe`](/api/inputs/dataframe/) to interactively+Use [`mo.ui.dataframe`](../../api/inputs/dataframe.md) to interactivelytransform a dataframe with a GUI, no coding required. When you're done, youcan copy the code that the GUI generated for you and paste it into yournotebook.@@ -86,9 +91,8 @@ notebook.</figure></div>+/// tab | pandas-::::{tab-set}-:::{tab-item} pandas```python# Cell 1import marimo as mo@@ -104,8 +108,11 @@ transformed_df# transformed_df.value holds the transformed dataframetransformed_df.value```-:::-:::{tab-item} polars++///++/// tab | polars+```python# Cell 1import marimo as mo@@ -121,8 +128,8 @@ transformed_df# transformed_df.value holds the transformed dataframetransformed_df.value```-:::-::::++///<div align="center"><figure>@@ -135,8 +142,10 @@ transformed_df.valueCreate custom filters with marimo UI elements, like sliders and dropdowns.-::::{tab-set}-:::{tab-item} pandas+///++/// tab | pandas+```python# Cell 1 - create a dataframedf = pd.DataFrame({"person": ["Alice", "Bob", "Charlie"], "age": [20, 30, 40]})@@ -153,8 +162,11 @@ age_filterfiltered_df = df[df["age"] < age_filter.value]mo.ui.table(filtered_df)```-:::-:::{tab-item} polars++///++/// tab | polars+```pythonimport marimo as moimport polars as pl@@ -176,17 +188,15 @@ mo.hstack([age_filter, city_filter])filtered_df = df.filter((pl.col("age") <= age_filter.value) & (pl.col("city") == city_filter.value))mo.ui.table(filtered_df)```-:::-::::+///-## Select dataframe rows+## Select dataframe rows {#selecting-dataframes}-Display dataframes as interactive, [selectable-charts](/guides/working_with_data/plotting) using-[`mo.ui.altair_chart`](marimo.ui.altair_chart) or-[`mo.ui.plotly`](marimo.ui.plotly), or as a row-selectable table with-(`mo.ui.table`)(marimo.ui.table). Select points in the chart, or select a table+Display dataframes as interactive, [selectable charts](plotting.md) using+[`mo.ui.altair_chart`](../../api/plotting.md#marimo.ui.altair_chart) or+[`mo.ui.plotly`](../../api/plotting.md#marimo.ui.plotly), or as a row-selectable table with+[`mo.ui.table`](../../api/inputs/table.md). Select points in the chart, or select a tablerow, and your selection is _automatically sent to Python as a subset of the originaldataframe_.@@ -197,9 +207,10 @@ dataframe_.</figure></div>+///++/// tab | pandas-::::{tab-set}-:::{tab-item} pandas```python# Cell 1 - display a dataframeimport marimo as mo@@ -214,8 +225,11 @@ table# Cell 2 - display the selectiontable.value```-:::-:::{tab-item} polars++///++/// tab | polars+```python# Cell 1 - display a dataframeimport marimo as mo@@ -230,8 +244,8 @@ table# Cell 2 - display the selectiontable.value```-:::-::::++///## Example notebookdiff --git a/docs/guides/working_with_data/index.md b/docs/guides/working_with_data/index.mdindex 8c47279992..d8e8be7783 100644--- a/docs/guides/working_with_data/index.md+++ b/docs/guides/working_with_data/index.md@@ -1,21 +1,11 @@# Working with data-```{eval-rst}-.. toctree::- :maxdepth: 2- :hidden:-- sql- dataframes- plotting-```-These guides introduce you to marimo's features for working with data,including SQL cells, no-code dataframe transformation tools, and plots whoseselections are automatically sent back to Python.-| | |-| :---------------- | :---------------------------------------------------- |-| {doc}`sql` | Use SQL to query dataframes, databases, CSVs, etc. |-| {doc}`dataframes` | Filter, search, and transform dataframes without code |-| {doc}`plotting` | Send plot selections to Python |+| Guide | Description |+|-------|-------------|+| [SQL](sql.md) | Use SQL to query dataframes, databases, CSVs, etc. |+| [Dataframes](dataframes.md) | Filter, search, and transform dataframes without code |+| [Plotting](plotting.md) | Send plot selections to Python |diff --git a/docs/guides/working_with_data/plotting.md b/docs/guides/working_with_data/plotting.mdindex 37750c01ec..135ee98b5b 100644--- a/docs/guides/working_with_data/plotting.md+++ b/docs/guides/working_with_data/plotting.md@@ -5,66 +5,64 @@ Plotly, Altair, and HoloViews. Just import your plotting library of choice anduse it as you normally would.For Altair and Plotly plots, marimo does something special: use-[`mo.ui.altair_chart`](../api/plotting.md#marimo.ui.altair_chart) or-[`mo.ui.plotly`](../api/plotting.md#marimo.ui.plotly) to connect frontend+[`mo.ui.altair_chart`](../../api/plotting.md#marimo.ui.altair_chart) or+[`mo.ui.plotly`](../../api/plotting.md#marimo.ui.plotly) to connect frontendselections to Python!-```{admonition} Reactive plots!-:class: important+!!! important "Reactive plots!"-marimo supports reactive plots via-[`mo.ui.altair_chart`](../api/plotting.md#marimo.ui.altair_chart) and-[`mo.ui.plotly`](../api/plotting.md#marimo.ui.plotly)! Select and-filter with your mouse, and marimo _automatically makes the selected data-available in Python as a Pandas dataframe_!-```+ marimo supports reactive plots via+ [`mo.ui.altair_chart`](../../api/plotting.md#marimo.ui.altair_chart) and+ [`mo.ui.plotly`](../../api/plotting.md#marimo.ui.plotly)! Select and+ filter with your mouse, and marimo _automatically makes the selected data+ available in Python as a Pandas dataframe_!## Reactive plots! ⚡-```{admonition} Requirements-:class: warning+!!! warning "Requirements"Reactive plots currently require Altair or Plotly. Install with `pip installaltair` or `pip install plotly`, depending on which library you are using.Selections in plotly are limited to scatter plots, treemaps charts, and sunbursts charts, while Altair supportsa larger class of plots for selections.-```### Altair-```{eval-rst}-.. marimo-embed::- :size: large-- @app.cell- async def __():- import pandas as pd- import pyodide- import micropip- import json- await micropip.install('altair')- import altair as alt- return-- @app.cell- def __():- cars = pd.DataFrame(json.loads(- pyodide.http.open_url('https://vega.github.io/vega-datasets/data/cars.json').read()- ))-- chart = mo.ui.altair_chart(alt.Chart(cars).mark_point().encode(- x='Horsepower',- y='Miles_per_Gallon',- color='Origin'- ))- return-- @app.cell- def __():- mo.vstack([chart, mo.ui.table(chart.value)])- return+/// marimo-embed+ size: large++```python+async def __():+ import pandas as pd+ import pyodide+ import micropip+ import json+ await micropip.install('altair')+ import altair as alt+ return++def __():+ cars = pd.DataFrame(json.loads(+ pyodide.http.open_url('https://vega.github.io/vega-datasets/data/cars.json').read()+ ))++ chart = mo.ui.altair_chart(alt.Chart(cars).mark_point().encode(+ x='Horsepower',+ y='Miles_per_Gallon',+ color='Origin'+ ))+ return++def __():+ mo.vstack([chart, mo.ui.table(chart.value)])+ return```-Use [`mo.ui.altair_chart`](../api/plotting.md#marimo.ui.altair_chart) to easily+///++Use [`mo.ui.altair_chart`](../../api/plotting.md#marimo.ui.altair_chart) to easilycreate interactive, selectable plots: _selections you make on the frontend areautomatically made available as Pandas dataframes in Python._@@ -74,7 +72,7 @@ automatically made available as Pandas dataframes in Python._</figure></div>-Wrap an Altair chart in [`mo.ui.altair_chart`](../api/plotting.md#marimo.ui.altair_chart)+Wrap an Altair chart in [`mo.ui.altair_chart`](../../api/plotting.md#marimo.ui.altair_chart)to make it **reactive**: select data on the frontend, access it via the chart's`value` attribute (`chart.value`).@@ -143,12 +141,9 @@ for marimo's reactive charting capabilities.##### Concepts-```{admonition} Learn by doing? Skip this section!-:class: warning--This section summarizes the main concepts used by Altair (and Vega-Lite).-Feel free to skip this section and return later.-```+!!! warning "Learn by doing? Skip this section!"+ This section summarizes the main concepts used by Altair (and Vega-Lite).+ Feel free to skip this section and return later.Our choice to use the Vega-Lite specification was driven by its robust datamodel, which is well-suited for data analysis. Some key concepts are summarized@@ -183,21 +178,20 @@ encoding, marimo will add a legend and a click selection.#### Automatic Selections-By default [`mo.ui.altair_chart`](../api/plotting.md#marimo.ui.altair_chart)+By default [`mo.ui.altair_chart`](../../api/plotting.md#marimo.ui.altair_chart)will make the chart and legend selectable. Depending on the mark type, thechart will either have a `point` or `interval` ("brush") selection. When usingnon-positional encodings (color, size, etc),-[`mo.ui.altair_chart`](../api/plotting.md#marimo.ui.altair_chart) will also+[`mo.ui.altair_chart`](../../api/plotting.md#marimo.ui.altair_chart) will alsomake the legend selectable.Selection configurable through `*_selection` params in-[`mo.ui.altair_chart`](../api/plotting.md#marimo.ui.altair_chart). See the [API-docs](../api/plotting.md#marimo.ui.altair_chart) for details.+[`mo.ui.altair_chart`](../../api/plotting.md#marimo.ui.altair_chart). See the [API+docs](../../api/plotting.md#marimo.ui.altair_chart) for details.-```{admonition} Note-You may still add your own selection parameters via Altair or Vega-Lite.-marimo will not override your selections.-```+!!! note+ You may still add your own selection parameters via Altair or Vega-Lite.+ marimo will not override your selections.#### Altair transformations@@ -214,48 +208,46 @@ conda install -c conda-forge "vegafusion-python-embed>=1.4.0" "vegafusion>=1.4.0### Plotly-```{admonition} mo.ui.plotly only supports scatter plots, treemaps charts, and sunbursts charts-:class: warning--marimo can render any Plotly plot, but [`mo.ui.plotly`](#marimo.ui.plotly) only-supports reactive selections for scatter plots, treemaps charts, and sunbursts charts. If you require other kinds of-selection, consider using [`mo.ui.altair_chart`](#marimo.ui.altair_chart).-```--```{eval-rst}-.. marimo-embed::- :size: large-- @app.cell(hide_code=True)- async def __():- import micropip- await micropip.install("pandas")- await micropip.install("plotly")- import plotly.express as px- return micropip, px+!!! warning "mo.ui.plotly only supports scatter plots, treemaps charts, and sunbursts charts"+ marimo can render any Plotly plot, but [`mo.ui.plotly`](../../api/plotting.md#marimo.ui.plotly) only+ supports reactive selections for scatter plots, treemaps charts, and sunbursts charts. If you require other kinds of+ selection, consider using [`mo.ui.altair_chart`](../../api/plotting.md#marimo.ui.altair_chart).- @app.cell- def __(px):- plot = mo.ui.plotly(- px.scatter(x=[0, 1, 4, 9, 16], y=[0, 1, 2, 3, 4], width=600, height=300)- )- plot- return plot+/// marimo-embed+ size: large-- @app.cell- def __(plot):- plot.value- return+```python[email protected](hide_code=True)+async def __():+ import micropip+ await micropip.install("pandas")+ await micropip.install("plotly")+ import plotly.express as px+ return micropip, px+++def __(px):+ plot = mo.ui.plotly(+ px.scatter(x=[0, 1, 4, 9, 16], y=[0, 1, 2, 3, 4], width=600, height=300)+ )+ plot+ return plot+++def __(plot):+ plot.value+ return```-Use [`mo.ui.plotly`](../api/plotting.md#marimo.ui.plotly) to create+///++Use [`mo.ui.plotly`](../../api/plotting.md#marimo.ui.plotly) to createselectable Plotly plots whose values are sent back to Python on selection.-```{eval-rst}-.. autofunction:: marimo.ui.plotly-```+::: marimo.ui.plotly## matplotlib@@ -283,5 +275,5 @@ If you want to output the plot in the console area, use `plt.show()` or### Interactive plotsTo make matplotlib plots interactive, use-[mo.mpl.interactive](/api/plotting.md#marimo.mpl.interactive).+[mo.mpl.interactive](../../api/plotting.md#marimo.mpl.interactive).(Matplotlib plots are not yet reactive.)diff --git a/docs/guides/working_with_data/sql.md b/docs/guides/working_with_data/sql.mdindex 672da77ca7..80b3f4be2b 100644--- a/docs/guides/working_with_data/sql.md+++ b/docs/guides/working_with_data/sql.md@@ -7,36 +7,34 @@ the query result back as a Python dataframe.To create a SQL cell, you first need to install additional dependencies,including [duckdb](https://duckdb.org/):-::::{tab-set}-:::{tab-item} install with pip+/// tab | install with pip```bashpip install "marimo[sql]"```-:::-:::{tab-item} install with uv+///++/// tab | install with uv```bashuv pip install "marimo[sql]"```-:::-:::{tab-item} install with conda+///++/// tab | install with conda```bashconda install -c conda-forge marimo duckdb polars```-:::-::::+///-```{admonition} Examples-:class: tip+!!! tip "Examples"-For example notebooks, check out-[`examples/sql/` on GitHub](https://github.com/marimo-team/marimo/tree/main/examples/sql/).-```+ For example notebooks, check out+ [`examples/sql/` on GitHub](https://github.com/marimo-team/marimo/tree/main/examples/sql/).## Examplediff --git a/docs/index.md b/docs/index.mdindex 88d78147c1..668f22dcef 100644--- a/docs/index.md+++ b/docs/index.md@@ -2,45 +2,41 @@<img src="_static/marimo-logotype-thick.svg" width="210px"></p>-# marimo-marimo is a reactive Python notebook: run a cell or interact with a UIelement, and marimo automatically runs dependent cells (or [marks them as-stale](/guides/reactivity.md#runtime-configuration)), keeping code and outputs+stale](guides/reactivity.md#runtime-configuration)), keeping code and outputsconsistent and preventing bugs before they happen. Every marimo notebook isstored as pure Python, executable as a script, and deployable as an app.-```{admonition} Built from the ground up-:class: tip+/// admonition | Built from the ground up+ type: tip-marimo was built from the ground up to solve <a-href="/faq.html#faq-jupyter">well-known problems associated with traditional-notebooks</a>.-```+marimo was built from the ground up to solve <a href="faq.html#faq-jupyter">well-known problems associated with traditional notebooks</a>.+///-::::{tab-set}-:::{tab-item} install with pip+/// tab | install with pip```bashpip install marimo && marimo tutorial intro```-:::-:::{tab-item} install with uv+///++/// tab | install with uv```bashuv pip install marimo && marimo tutorial intro```-:::-:::{tab-item} install with conda+///++/// tab | install with conda```bashconda install -c conda-forge marimo && marimo tutorial intro```-:::-::::+///Developer experience is core to marimo, with an emphasis onreproducibility, maintainability, composability, and shareability.@@ -48,18 +44,18 @@ reproducibility, maintainability, composability, and shareability.## Highlights- 🚀 **batteries-included:** replaces `jupyter`, `streamlit`, `jupytext`, `ipywidgets`, `papermill`, and more-- ⚡️ **reactive**: run a cell, and marimo reactively [runs all dependent cells](/guides/reactivity.md) or <a href="#expensive-notebooks">marks them as stale</a>-- 🖐️ **interactive:** [bind sliders, tables, plots, and more](/guides/interactivity.md) to Python — no callbacks required-- 🔬 **reproducible:** [no hidden state](/guides/reactivity.md#no-hidden-state), deterministic execution, [built-in package management](/guides/editor_features/package_management.md)-- 🏃 **executable:** [execute as a Python script](/guides/scripts.md), parameterized by CLI args-- 🛜 **shareable**: [deploy as an interactive web app](guides/apps.md) or [slides](/guides/apps.md#slides-layout), [run in the browser via WASM](/guides/wasm.md)-- 🛢️ **designed for data**: query dataframes and databases [with SQL](/guides/working_with_data/sql.md), filter and search [dataframes](/guides/working_with_data/dataframes.md)+- ⚡️ **reactive**: run a cell, and marimo reactively [runs all dependent cells](guides/reactivity.md) or <a href="#expensive-notebooks">marks them as stale</a>+- 🖐️ **interactive:** [bind sliders, tables, plots, and more](guides/interactivity.md) to Python — no callbacks required+- 🔬 **reproducible:** [no hidden state](guides/reactivity.md#no-hidden-state), deterministic execution, [built-in package management](guides/editor_features/package_management.md)+- 🏃 **executable:** [execute as a Python script](guides/scripts.md), parameterized by CLI args+- 🛜 **shareable**: [deploy as an interactive web app](guides/apps.md) or [slides](guides/apps.md#slides-layout), [run in the browser via WASM](guides/wasm.md)+- 🛢️ **designed for data**: query dataframes and databases [with SQL](guides/working_with_data/sql.md), filter and search [dataframes](guides/working_with_data/dataframes.md)- 🐍 **git-friendly:** notebooks are stored as `.py` files-- ⌨️ **a modern editor**: [GitHub Copilot](/guides/editor_features/ai_completion.md#github-copilot), [AI assistants](/guides/editor_features/ai_completion.md#using-ollama), vim keybindings, variable explorer, and [more](/guides/editor_features/index.md)+- ⌨️ **a modern editor**: [GitHub Copilot](guides/editor_features/ai_completion.md#github-copilot), [AI assistants](guides/editor_features/ai_completion.md#using-ollama), vim keybindings, variable explorer, and [more](guides/editor_features/index.md)## A reactive programming environment-marimo guarantees your notebook code, outputs, and program state are consistent. This [solves many problems](/faq.md#faq-problems) associated with traditional notebooks like Jupyter.+marimo guarantees your notebook code, outputs, and program state are consistent. This [solves many problems](faq.md#faq-problems) associated with traditional notebooks like Jupyter.**A reactive programming environment.**Run a cell and marimo _reacts_ by automatically running the cells that@@ -73,16 +69,16 @@ memory, eliminating hidden state.**Compatible with expensive notebooks.** marimo lets you [configure the runtimeto be-lazy](/guides/configuration/runtime_configuration.md),+lazy](guides/configuration/runtime_configuration.md),marking affected cells as stale instead of automatically running them. Thisgives you guarantees on program state while preventing accidental execution ofexpensive cells.**Synchronized UI elements.** Interact with [UI-elements](/guides/interactivity.md) like [sliders](/api/inputs/slider.md#slider),-[dropdowns](/api/inputs/dropdown.md), [dataframe-transformers](/api/inputs/dataframe.md), and [chat-interfaces](/api/inputs/chat.md), and the cells that+elements](guides/interactivity.md) like [sliders](api/inputs/slider.md#slider),+[dropdowns](api/inputs/dropdown.md), [dataframe+transformers](api/inputs/dataframe.md), and [chat+interfaces](api/inputs/chat.md), and the cells thatuse them are automatically re-run with their latest values.<img src="https://raw.githubusercontent.com/marimo-team/marimo/main/docs/_static/readme-ui.gif" width="700px" />@@ -91,13 +87,13 @@ use them are automatically re-run with their latest values.sort](https://docs.marimo.io/guides/working_with_data/dataframes.html)millions of rows blazingly fast, no code required.-<img src="/_static/docs-df.gif">+<img src="_static/docs-df.gif">**Performant runtime.** marimo runs only those cells that need to be run bystatically analyzing your code.**Dynamic markdown and SQL.** Use markdown to tell dynamic stories that depend on-Python data. Or build [SQL](/guides/working_with_data/sql.md) queries+Python data. Or build [SQL](guides/working_with_data/sql.md) queriesthat depend on Python values and execute them against dataframes, databases,CSVs, Google Sheets, or anything else using our built-in SQL engine, whichreturns the result as a Python dataframe.@@ -113,14 +109,14 @@ Organize your notebooks to best fit the stories you'd like to tell.**Built-in package management.** marimo has built-in support for all majorpackage managers, letting you install packages on import. marimo can even[serialize package-requirements](/guides/editor_features/package_management.md#auto-add-inline-script-metadata-uv-only)+requirements](guides/editor_features/package_management.md#auto-add-inline-script-metadata-uv-only)in notebook files, and auto install them in-[isolated venv sandboxes](/guides/editor_features/package_management.md#running-marimo-in-a-sandbox-environment-uv-only).+[isolated venv sandboxes](guides/editor_features/package_management.md#running-marimo-in-a-sandbox-environment-uv-only).**Batteries-included.** marimo comes with GitHub Copilot, AI assistants, Ruffcode formatting, HTML export, fast code completion, a [VS Codeextension](https://marketplace.visualstudio.com/items?itemName=marimo-team.vscode-marimo),-an interactive dataframe viewer, and [many more](/guides/editor_features/index.md)+an interactive dataframe viewer, and [many more](guides/editor_features/index.md)quality-of-life features.## Quickstart@@ -174,7 +170,7 @@ marimo tutorial --help## Questions?-See our [FAQ](/faq.md).+See our [FAQ](faq.md).## Learn more@@ -184,7 +180,7 @@ For example, here's an embedding visualizer made in marimo<img src="https://raw.githubusercontent.com/marimo-team/marimo/main/docs/_static/embedding.gif" width="700px" />-Check out our [guides](/guides/index.md), our [example+Check out our [guides](guides/index.md), our [examplegallery](https://marimo.io/gallery), and our[`examples/`](https://github.com/marimo-team/marimo/tree/main/examples) onGitHub to learn more.@@ -192,38 +188,38 @@ GitHub to learn more.<table border="0"><tr><td>- <a target="_blank" href="/getting_started/key_concepts.md">- <img src="/_static/reactive.gif" style="max-height: 150px; width: auto; display: block" />+ <a target="_blank" href="getting_started/key_concepts.md">+ <img src="_static/reactive.gif" style="max-height: 150px; width: auto; display: block" /></a></td><td>- <a target="_blank" href="/api/inputs/index.md">+ <a target="_blank" href="api/inputs/index.md"><img src="https://raw.githubusercontent.com/marimo-team/marimo/main/docs/_static/readme-ui.gif" style="max-height: 150px; width: auto; display: block" /></a></td><td>- <a target="_blank" href="/guides/working_with_data/plotting.md">+ <a target="_blank" href="guides/working_with_data/plotting.md"><img src="https://raw.githubusercontent.com/marimo-team/marimo/main/docs/_static/docs-intro.gif" style="max-height: 150px; width: auto; display: block" /></a></td><td>- <a target="_blank" href="/api/layouts/index.md">+ <a target="_blank" href="api/layouts/index.md"><img src="https://raw.githubusercontent.com/marimo-team/marimo/main/docs/_static/outputs.gif" style="max-height: 150px; width: auto; display: block" /></a></td></tr><tr><td>- <a target="_blank" href="/getting_started/key_concepts.md"> Tutorial </a>+ <a target="_blank" href="getting_started/key_concepts.md"> Tutorial </a></td><td>- <a target="_blank" href="/api/inputs/index.md"> Inputs </a>+ <a target="_blank" href="api/inputs/index.md"> Inputs </a></td><td>- <a target="_blank" href="/guides/working_with_data/plotting.md"> Plots </a>+ <a target="_blank" href="guides/working_with_data/plotting.md"> Plots </a></td><td>- <a target="_blank" href="/api/layouts/index.md"> Layout </a>+ <a target="_blank" href="api/layouts/index.md"> Layout </a></td></tr><tr>@@ -232,7 +228,6 @@ GitHub to learn more.<img src="https://marimo.io/shield.svg"/></a></td>- <td><a target="_blank" href="https://marimo.app/l/0ue871"><img src="https://marimo.io/shield.svg"/></a>@@ -298,42 +293,3 @@ for the better.<p align="right"><img src="https://raw.githubusercontent.com/marimo-team/marimo/main/docs/_static/marimo-logotype-horizontal.png" height="200px"></p>--<h3>Table of Contents</h3>--```{eval-rst}-.. toctree::- :maxdepth: 2-- getting_started/index- guides/index- recipes- api/index- faq- examples- integrations/index- community-```--```{eval-rst}-.. toctree::- :caption: Links- :maxdepth: 2-- GitHub <https://github.com/marimo-team/marimo>- Gallery <https://marimo.io/gallery>- Discord <https://marimo.io/discord?ref=docs>- Give Feedback <https://marimo.io/feedback>- Newsletter <https://marimo.io/newsletter>- Twitter <https://twitter.com/marimo_io>- Bluesky <https://bsky.app/profile/marimo.io>- Awesome marimo <https://github.com/marimo-team/awesome-marimo>- Marimo Cloud Waitlist <https://marimo.io/cloud>- Blog <https://marimo.io/blog>-```--<h3>Index</h3>--```{eval-rst}-* :ref:`genindex`-```diff --git a/docs/integrations/index.md b/docs/integrations/index.mdindex 43241ed403..846e5ff766 100644--- a/docs/integrations/index.md+++ b/docs/integrations/index.md@@ -1,21 +1,10 @@# Integrations-```{eval-rst}-.. toctree::- :maxdepth: 2- :hidden:-- motherduck- google_cloud_storage- google_cloud_bigquery- google_sheets-```-It is easy to integrate your preferred data sources or data warehouses with marimo. Since marimo is strictly Python, you can utilize any Python library to access your data. In this section, we provide some examples of how to integrate with popular data sources.-| | |-| :--------------------------- | :------------------------------------- |-| {doc}`motherduck` | Integrating with MotherDuck |-| {doc}`google_cloud_storage` | Integrating with Google Cloud Storage |-| {doc}`google_cloud_bigquery` | Integrating with Google Cloud BigQuery |-| {doc}`google_sheets` | Integrating with Google Sheets |+| Integration | Description |+|-------------|-------------|+| [MotherDuck](motherduck.md) | Integrating with MotherDuck |+| [Google Cloud Storage](google_cloud_storage.md) | Integrating with Google Cloud Storage |+| [Google Cloud BigQuery](google_cloud_bigquery.md) | Integrating with Google Cloud BigQuery |+| [Google Sheets](google_sheets.md) | Integrating with Google Sheets |diff --git a/docs/integrations/motherduck.md b/docs/integrations/motherduck.mdindex d5313f2df1..6028b35018 100644--- a/docs/integrations/motherduck.md+++ b/docs/integrations/motherduck.md@@ -6,30 +6,28 @@To use MotherDuck as a data source, you'll need to install the `marimo[sql]` Python package.-::::{tab-set}-:::{tab-item} install with pip+/// tab | install with pip```bashpip install "marimo[sql]"```-:::-:::{tab-item} install with uv+///++/// tab | install with uv```bashuv pip install "marimo[sql]"```-:::-:::{tab-item} install with conda+///++/// tab | install with conda```bashconda install -c conda-forge marimo duckdb polars```-:::-::::-To connect to MotherDuck, import `duckdb` and `ATTACH` your MotherDuck database.```pythondiff --git a/docs/overrides/main.html b/docs/overrides/main.htmlnew file mode 100644index 0000000000..7a6be2f23f--- /dev/null+++ b/docs/overrides/main.html@@ -0,0 +1,15 @@+{% extends "base.html" %} {% block announce %}+<!-- Add your announcement here -->+<span class="twemoji"> {% include ".icons/material/new-box.svg" %} </span>+<strong>New:</strong> Check out our latest features in the <a href="/latest">documentation</a>! {% endblock %} {% block+extrahead %} {{ super() }}+<!-- Add any custom head elements here -->+<meta property="og:type" content="website" />+<meta property="og:site_name" content="Marimo Documentation" />+<meta+ property="og:title"+ content="{% if page.meta and page.meta.title %}{{ page.meta.title }}{% elif page.title %}{{ page.title }}{% else %}{{ config.site_name }}{% endif %}"+/>+{% endblock %} {% block scripts %} {{ super() }}+<!-- Add any custom scripts here -->+{% endblock %}diff --git a/docs/pyproject.toml b/docs/pyproject.tomlnew file mode 100644index 0000000000..60c361e595--- /dev/null+++ b/docs/pyproject.toml@@ -0,0 +1,11 @@+[build-system]+build-backend = "hatchling.build"+requires = ["hatchling"]++[project]+dependencies = []+name = "docs"+version = "0.0.1"++[tool.hatch.build.targets.wheel]+include = ["blocks.py"]diff --git a/docs/recipes.md b/docs/recipes.mdindex 1d1647b9c2..7870506f89 100644--- a/docs/recipes.md+++ b/docs/recipes.md@@ -458,7 +458,7 @@ examples, form, output### Create a button that triggers computation when clicked**Use cases.** To trigger a computation on button click and only on button-click, use [`mo.ui.run_button()`](/api/inputs/run_button.md).+click, use [`mo.ui.run_button()`](api/inputs/run_button.md).**Recipe.**diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.cssnew file mode 100644index 0000000000..c8f4dfd32d--- /dev/null+++ b/docs/stylesheets/extra.css@@ -0,0 +1,79 @@+/* Adjust the max width of the content */+.md-grid {+ max-width: 1440px;+}++/* Custom styling for code blocks */+.highlight {+ background-color: var(--md-code-bg-color);+ border-radius: 4px;+}++/* Custom styling for admonitions */+.admonition {+ border-left-width: 4px !important;+}++/* Custom font sizes for better readability */+.md-typeset {+ font-size: 0.75rem;+ line-height: 1.6;+}++.md-typeset h1 {+ font-size: 2em;+ font-weight: 600;+}++/* Custom styling for tables */+.md-typeset table:not([class]) {+ font-size: 0.75rem;+}++/* Custom styling for navigation */+.md-nav {+ font-size: 0.7rem;+}++/* Custom styling for code annotations */+.md-annotation__index {+ font-family: var(--md-code-font-family);+}++.md-header__topic {+ visibility: hidden;+}++.md-header__button.md-logo {+ margin: 0;+ padding: 0;+ height: 100%;+}++.md-header__button.md-logo img,+.md-header__button.md-logo svg {+ height: 55px;+}++iframe.demo {+ width: 100%;+ height: 250px;+ border: 1px solid var(--md-code-bg-color);+ border-radius: 5px;+}++iframe.demo.medium {+ height: 400px;+}++iframe.demo.large {+ height: 600px;+}++iframe.demo.xlarge {+ height: 900px;+}++iframe.demo.xxlarge {+ height: 1200px;+}diff --git a/marimo/_plugins/__init__.py b/marimo/_plugins/__init__.pynew file mode 100644index 0000000000..e69de29bb2diff --git a/marimo/_plugins/ui/_impl/chat/__init__.py b/marimo/_plugins/ui/_impl/chat/__init__.pynew file mode 100644index 0000000000..e69de29bb2diff --git a/marimo/_plugins/ui/_impl/dataframes/__init__.py b/marimo/_plugins/ui/_impl/dataframes/__init__.pynew file mode 100644index 0000000000..e69de29bb2diff --git a/mkdocs.yml b/mkdocs.ymlnew file mode 100644index 0000000000..514afcb58e--- /dev/null+++ b/mkdocs.yml@@ -0,0 +1,296 @@+edit_uri: edit/main/docs/+copyright: '© marimo 2024'+extra:+ generator: false+ social:+ - icon: fontawesome/brands/github+ link: https://github.com/marimo-team/marimo+ - icon: fontawesome/brands/discord+ link: https://marimo.io/discord?ref=docs+ - icon: material/email-newsletter+ link: https://marimo.io/newsletter+ - icon: material/forum+ link: https://marimo.hall.community+ - icon: fontawesome/brands/mastodon+ link: https://mastodon.social/@marimo_io+ - icon: fontawesome/brands/twitter+ link: https://twitter.com/marimo_io+ - icon: fontawesome/brands/linkedin+ link: https://www.linkedin.com/company/marimo-io+ - icon: fontawesome/brands/python+ link: https://pypi.org/project/marimo/+extra_css:+ - stylesheets/extra.css+markdown_extensions:+ - admonition+ - attr_list+ - def_list+ - footnotes+ - md_in_html+ - meta+ - toc:+ permalink: true+ - pymdownx.arithmatex:+ generic: true+ - pymdownx.blocks.admonition+ - pymdownx.betterem:+ smart_enable: all+ - pymdownx.caret+ - pymdownx.details+ - pymdownx.emoji: null+ - pymdownx.highlight:+ anchor_linenums: true+ line_spans: __span+ pygments_lang_class: true+ - pymdownx.inlinehilite+ - pymdownx.keys+ - pymdownx.magiclink+ - pymdownx.mark+ - pymdownx.smartsymbols+ - pymdownx.superfences:+ custom_fences:+ - class: mermaid+ name: mermaid+ - pymdownx.blocks.tab:+ alternate_style: true+ - pymdownx.tasklist:+ custom_checkbox: true+ - pymdownx.tilde+ - blocks:MarimoBlocksExtension+nav:+ - Marimo: index.md+ - Getting Started:+ - Overview: getting_started/index.md+ - Installation: getting_started/installation.md+ - Quickstart: getting_started/quickstart.md+ - Key Concepts: getting_started/key_concepts.md++ - User Guide:+ - Overview: guides/index.md+ - Reactive execution: guides/reactivity.md+ - Interactive elements: guides/interactivity.md+ - Visualizing outputs: guides/outputs.md+ - Migrating from Jupyter: guides/coming_from/jupyter.md+ - Expensive notebooks: guides/expensive_notebooks.md+ - SQL, dataframes, and plots:+ - Overview: guides/working_with_data/index.md+ - DataFrames: guides/working_with_data/dataframes.md+ - SQL: guides/working_with_data/sql.md+ - Plotting: guides/working_with_data/plotting.md+ - Run notebooks as apps: guides/apps.md+ - Run notebooks as scripts: guides/scripts.md+ - Export to HTML and other formats: guides/exporting.md+ - Run notebooks with WebAssembly: guides/wasm.md+ - Deploy notebooks:+ - Overview: guides/deploying/index.md+ - Authentication: guides/deploying/authentication.md+ - Docker: guides/deploying/deploying_docker.md+ - HuggingFace: guides/deploying/deploying_hugging_face.md+ - Ploomber: guides/deploying/deploying_ploomber.md+ - Public gallery: guides/deploying/deploying_public_gallery.md+ - Railway: guides/deploying/deploying_railway.md+ - Prebuilt containers: guides/deploying/prebuilt_containers.md+ - Programmatic: guides/deploying/programmatically.md+ - Editor features:+ - Overview: guides/editor_features/index.md+ - AI Completion: guides/editor_features/ai_completion.md+ - Hotkeys: guides/editor_features/hotkeys.md+ - Package Management: guides/editor_features/package_management.md+ - Configuration:+ - Overview: guides/configuration/index.md+ - Runtime configuration: guides/configuration/runtime_configuration.md+ - HTML head: guides/configuration/html_head.md+ - Theming: guides/configuration/theming.md+ - Coming from other tools:+ - Overview: guides/coming_from/index.md+ - Jupytext: guides/coming_from/jupytext.md+ - Papermill: guides/coming_from/papermill.md+ - Streamlit: guides/coming_from/streamlit.md+ - Extending marimo:+ - Overview: guides/integrating_with_marimo/index.md+ - Custom UI plugins: guides/integrating_with_marimo/custom_ui_plugins.md+ - Displaying objects: guides/integrating_with_marimo/displaying_objects.md+ - State management: guides/state.md+ - Best practices: guides/best_practices.md+ - Troubleshooting: guides/troubleshooting.md+ - API Reference:+ - Overview: api/index.md+ - Markdown: api/markdown.md+ - Inputs:+ - Overview: api/inputs/index.md+ - AnyWidget: api/inputs/anywidget.md+ - Array: api/inputs/array.md+ - Batch: api/inputs/batch.md+ - Button: api/inputs/button.md+ - Chat: api/inputs/chat.md+ - Checkbox: api/inputs/checkbox.md+ - Code Editor: api/inputs/code_editor.md+ - Data Explorer: api/inputs/data_explorer.md+ - DataFrame: api/inputs/dataframe.md+ - Dates: api/inputs/dates.md+ - Dictionary: api/inputs/dictionary.md+ - Dropdown: api/inputs/dropdown.md+ - File: api/inputs/file.md+ - File Browser: api/inputs/file_browser.md+ - Form: api/inputs/form.md+ - Microphone: api/inputs/microphone.md+ - Multiselect: api/inputs/multiselect.md+ - Navigation Menu: api/inputs/nav_menu.md+ - Number: api/inputs/number.md+ - Radio: api/inputs/radio.md+ - Range Slider: api/inputs/range_slider.md+ - Refresh: api/inputs/refresh.md+ - Run Button: api/inputs/run_button.md+ - Slider: api/inputs/slider.md+ - Switch: api/inputs/switch.md+ - Table: api/inputs/table.md+ - Tabs: api/inputs/tabs.md+ - Text: api/inputs/text.md+ - Text Area: api/inputs/text_area.md+ - Control Flow: api/control_flow.md+ - Layouts:+ - Overview: api/layouts/index.md+ - Accordion: api/layouts/accordion.md+ - Callout: api/layouts/callout.md+ - Carousel: api/layouts/carousel.md+ - Justify: api/layouts/justify.md+ - Lazy: api/layouts/lazy.md+ - Plain: api/layouts/plain.md+ - Routes: api/layouts/routes.md+ - Sidebar: api/layouts/sidebar.md+ - Stacks: api/layouts/stacks.md+ - Tree: api/layouts/tree.md+ - Plotting: api/plotting.md+ - Media:+ - Overview: api/media/index.md+ - Audio: api/media/audio.md+ - Download: api/media/download.md+ - Image: api/media/image.md+ - PDF: api/media/pdf.md+ - Plain Text: api/media/plain_text.md+ - Video: api/media/video.md+ - Progress Bars and Status: api/status.md+ - Outputs: api/outputs.md+ - Diagrams: api/diagrams.md+ - HTML: api/html.md+ - Query Parameters: api/query_params.md+ - Command Line Arguments: api/cli_args.md+ - Caching: api/caching.md+ - State: api/state.md+ - App: api/app.md+ - Cell: api/cell.md+ - Miscellaneous: api/miscellaneous.md+ - Examples:+ - Notebooks: examples.md+ - Recipes: recipes.md+ - Islands: guides/island_example.md+ - Community:+ - Overview: community.md+ - FAQ: faq.md+ - Contributing: https://github.com/marimo-team/marimo/blob/main/CONTRIBUTING.md+ - Code of Conduct: https://github.com/marimo-team/marimo/blob/main/CODE_OF_CONDUCT.md+ - Integrations:+ - Overview: integrations/index.md+ - BigQuery: integrations/google_cloud_bigquery.md+ - Google Cloud Storage: integrations/google_cloud_storage.md+ - Google Sheets: integrations/google_sheets.md+ - MotherDuck: integrations/motherduck.md+plugins:+ - search+ - social:+ cards_layout_options:+ background_color: '#FFFFFF'+ color: '#000000'+ font_family: Roboto+ - tags+ - redirects:+ redirect_maps: {}+ - mkdocstrings:+ handlers:+ python:+ paths: [.]+ load_external_modules: true+ import:+ - url: https://docs.python.org/3/objects.inv+ domains: [py, std]+ options:+ preload_modules:+ - starlette+ filters:+ - '!^_'+ # General+ allow_inspection: false+ show_bases: true+ show_source: false+ find_stubs_package: true+ # Headings+ heading_level: 2+ show_root_heading: true+ # Members+ inherited_members: true+ # Docstrings+ merge_init_into_class: true+ show_if_no_docstring: true+ docstring_section_style: spacy+ docstring_style: google+ # Signatures+ separate_signature: true+ unwrap_annotated: true+ annotations_path: brief+ line_length: 60+ modernize_annotations: true+ signature_crossrefs: true+ show_symbol_type_heading: true+ show_symbol_type_toc: true+ show_signature_annotations: true+ - autorefs+repo_name: marimo-team/marimo+repo_url: https://github.com/marimo-team/marimo+site_description: A library for making reactive notebooks and apps+site_name: marimo+site_url: https://docs.marimo.io+theme:+ favicon: _static/favicon-32x32.png+ features:+ - announce.dismiss # dismissible announcements+ - content.code.copy # add copy button to code blocks+ - header.autohide # auto-hide header on scroll+ - navigation.indexes # section index pages+ - navigation.instant # faster page loads+ - navigation.path # show navigation breadcrumb path+ - navigation.tabs # show navigation as tabs+ - navigation.tabs.sticky # keep navigation tabs visible when scrolling+ - navigation.top # back to top button+ - navigation.tracking # updates URL as you scroll+ - navigation.footer # links to previous/next page, helpful for small screens+ - search.highlight # highlight search results+ - search.share # shareable search links+ - search.suggest # search suggestions+ - toc.follow # auto-scroll TOC+ font:+ code:+ - Roboto Mono+ text:+ - Inter+ - Roboto+ logo: _static/marimo-logotype-horizontal.png+ name: material+ palette:+ - media: (prefers-color-scheme)+ toggle:+ icon: material/brightness-7+ name: Switch to light mode+ - media: '(prefers-color-scheme: light)'+ primary: white+ accent: teal+ scheme: default+ toggle:+ icon: material/brightness-4+ name: Switch to dark mode+ - media: '(prefers-color-scheme: dark)'+ primary: black+ accent: teal+ scheme: slate+ toggle:+ icon: material/brightness-7+ name: Switch to system preferencediff --git a/pyproject.toml b/pyproject.tomlindex 986eb74767..797e784f14 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -102,17 +102,21 @@ dev = []docs = [- "pypandoc~=1.13",- "autoclasstoc~=1.6.0",- # furo raises an error during docs build when sphinx is upgraded- "sphinx~=7.0.1",- "sphinx-copybutton~=0.5.2",- "sphinx-new-tab-link~=0.5.3",- "sphinx-sitemap~=2.6.0",- "sphinx-design~=0.5.0",- "sphinx-autobuild~=2024.10.3",- "myst_parser~=3.0.1",- "furo==2024.8.6",+ "mkdocs>=1.6.1",+ "mkdocs-material>=9.5.49",+ "mkdocstrings[python]>=0.27.0",+ "mkdocs-material-extensions>=1.3.1",+ "mkdocs-autorefs>=1.0.1",+ "mkdocs-git-revision-date-localized-plugin>=1.2.4",+ "mkdocs-minify-plugin>=0.8.0",+ "mkdocs-glightbox>=0.3.7",+ "mkdocs-macros-plugin>=1.3.0",+ "mkdocs-redirects>=1.0.0",+ "mike>=2.0.0", # for versioning+ "pillow>=10.2.0", # for social cards+ "cairosvg>=2.7.1", # for social cards+ "mdx-include>=1.4.2",+ "pymdown-extensions>=10.7",][tool.hatch]@@ -241,12 +245,15 @@ extra-dependencies = [python = ["3.9", "3.10", "3.11", "3.12"][tool.hatch.envs.docs]-features = ["docs"]+features = ["dev", "docs"]+dependencies = [+ "docs @ file://docs",+][tool.hatch.envs.docs.scripts]-build = "sphinx-build {args:docs/ docs/_build}"-autobuild = "sphinx-autobuild {args:docs/ docs/_build}"-clean = "cd docs && make clean"+build = "mkdocs build {args}"+serve = "mkdocs serve --clean {args}"+deploy = "mkdocs gh-deploy --force {args}"[tool.ruff]line-length = 79