Skip to content

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

docs: export, publishing, deploying refactor (#8581)

Akshay Agrawal770ebed74127
diff --git a/docs/_static/docs-gallery.png b/docs/_static/docs-gallery.png
new file mode 100644
index 0000000000..f5b1a1dde6
Binary files /dev/null and b/docs/_static/docs-gallery.png differ
diff --git a/docs/_static/docs-html-autoexport.png b/docs/_static/docs-html-autoexport.png
new file mode 100644
index 0000000000..2558df71dc
Binary files /dev/null and b/docs/_static/docs-html-autoexport.png differ
diff --git a/docs/_static/docs-html-export.png b/docs/_static/docs-html-export.png
index 55af505343..386e831288 100644
Binary files a/docs/_static/docs-html-export.png and b/docs/_static/docs-html-export.png differ
diff --git a/docs/_static/docs-jupyter-autoexport.png b/docs/_static/docs-jupyter-autoexport.png
new file mode 100644
index 0000000000..683266d395
Binary files /dev/null and b/docs/_static/docs-jupyter-autoexport.png differ
diff --git a/docs/_static/docs-jupyterhub.png b/docs/_static/docs-jupyterhub.png
new file mode 100644
index 0000000000..949b8150ce
Binary files /dev/null and b/docs/_static/docs-jupyterhub.png differ
diff --git a/docs/_static/docs-md-export.png b/docs/_static/docs-md-export.png
new file mode 100644
index 0000000000..6e0ad5e397
Binary files /dev/null and b/docs/_static/docs-md-export.png differ
diff --git a/docs/_static/docs-pdf-export.png b/docs/_static/docs-pdf-export.png
new file mode 100644
index 0000000000..baa9aef612
Binary files /dev/null and b/docs/_static/docs-pdf-export.png differ
diff --git a/docs/blocks.py b/docs/blocks.py
index 8173209476..7d3930d19c 100644
--- a/docs/blocks.py
+++ b/docs/blocks.py
@@ -1,7 +1,8 @@
import textwrap
import xml.etree.ElementTree as etree
from typing import Any, Dict, List, Union, cast
-import urllib.parse
+
+import lzstring
from pymdownx.blocks import BlocksExtension # type: ignore
from pymdownx.blocks.block import (
@@ -73,8 +74,8 @@ class MarimoEmbedBlock(BaseMarimoBlock):
app_width: str = cast(str, self.options["app_width"])
mode: str = cast(str, self.options["mode"])
show_chrome: bool = cast(bool, self.options["show-chrome"])
- url = create_marimo_app_url(
- code=create_marimo_app_code(code=code, app_width=app_width),
+ url = create_marimo_wasm_url(
+ code=create_marimo_wasm_code(code=code, app_width=app_width),
mode=mode,
show_chrome=show_chrome,
)
@@ -103,7 +104,7 @@ class MarimoEmbedFileBlock(BaseMarimoBlock):
mode: str = cast(str, self.options["mode"])
show_chrome: bool = cast(bool, self.options["show-chrome"])
- url = create_marimo_app_url(
+ url = create_marimo_wasm_url(
code=code, mode=mode, show_chrome=show_chrome
)
self._create_iframe(block, url)
@@ -130,11 +131,10 @@ class MarimoEmbedFileBlock(BaseMarimoBlock):
code_block.text = code
-def uri_encode_component(code: str) -> str:
- return urllib.parse.quote(code, safe="~()*!.'")
+_lz = lzstring.LZString()
-def create_marimo_app_code(
+def create_marimo_wasm_code(
*,
code: str,
app_width: str = "medium",
@@ -162,11 +162,11 @@ def create_marimo_app_code(
return header + mo_cell + code
-def create_marimo_app_url(
+def create_marimo_wasm_url(
code: str, mode: str = "edit", show_chrome: bool = False
) -> str:
- encoded_code = uri_encode_component(code)
- return f"https://marimo.app/?code={encoded_code}&embed=true&mode={mode}&show-chrome={'true' if show_chrome else 'false'}"
+ compressed = _lz.compressToEncodedURIComponent(code)
+ return f"https://marimo.app/?embed=true&mode={mode}&show-chrome={'true' if show_chrome else 'false'}#code/{compressed}"
class MarimoBlocksExtension(BlocksExtension):
diff --git a/docs/faq.md b/docs/faq.md
index 3d1956853b..8ddaaaaec3 100644
--- a/docs/faq.md
+++ b/docs/faq.md
@@ -540,8 +540,8 @@ marimo edit --host 0.0.0.0
### How do I use marimo behind JupyterHub?
-JupyterHub can be configured to launch marimo using the [`jupyter-marimo-proxy`
-package](https://github.com/jyio/jupyter-marimo-proxy).
+JupyterHub can be configured to launch marimo using the
+[`marimo-jupyter-extension`](https://github.com/marimo-team/marimo-jupyter-extension).
<a name="faq-jupyter-book"></a>
diff --git a/docs/getting_started/quickstart.md b/docs/getting_started/quickstart.md
index af9bcbab0c..4bec2fb5a0 100644
--- a/docs/getting_started/quickstart.md
+++ b/docs/getting_started/quickstart.md
@@ -94,7 +94,7 @@ Use
marimo export
```
-to [export marimo notebooks](../guides/exporting.md) to other file formats,
+to [export marimo notebooks](../guides/exporting/index.md) to other file formats,
including HTML, IPYNB, and markdown.
## Install optional dependencies for more features
diff --git a/docs/guides/apps.md b/docs/guides/apps.md
index 6cf9448208..cdf1f5d06e 100644
--- a/docs/guides/apps.md
+++ b/docs/guides/apps.md
@@ -80,9 +80,6 @@ Enable the grid editor in the app preview, via a dropdown:
If you prefer a slideshow-like experience, you can use the slides layout. Enable the slides layout in the app preview, via the same dropdown as above.
-!!! info "See slides layout in action"
- Check out this [example notebook](https://marimo.io/p/@gvarnavides/stem-probes) that runs in slides mode, powered by our [Community Cloud](publishing/community_cloud/index.md).
-
Unlike the grid layout, the slides are much less customizable:
- The order of the slides is determined by the order of the cells in the notebook.
diff --git a/docs/guides/deploying/deploying_public_gallery.md b/docs/guides/deploying/deploying_public_gallery.md
deleted file mode 100644
index 455f73836a..0000000000
--- a/docs/guides/deploying/deploying_public_gallery.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Deploy to our public gallery
-
-If you would like to deploy your application to our [public
-gallery](https://marimo.io/gallery), please reach out on
-[Discord](https://marimo.io/discord?ref=docs).
-
-You can also easily share your notebooks on the public web using [WASM
-notebooks](../../guides/wasm.md), which run entirely in the browser, no backend
-required.
diff --git a/docs/guides/deploying/index.md b/docs/guides/deploying/index.md
index 0e90cfec7d..f29d4f88c9 100644
--- a/docs/guides/deploying/index.md
+++ b/docs/guides/deploying/index.md
@@ -1,47 +1,41 @@
-# Deploying
+# Deploy notebook servers or apps
-You can deploy marimo in three ways:
+marimo can be deployed as an "edit" server for creating, running, and editing
+notebooks, or an app server for serving read-only web apps. For convenience,
+you can use our [pre-built containers](prebuilt_containers.md).
-1. via an **edit server**, which allows you to create and edit notebooks. On
- the CLI, this is launched with `marimo edit`, and is similar to `jupyter notebook`.
-2. via a **run server**, which allows you serve marimo notebooks as read-only
- web apps. On the CLI, this is launched with `marimo run notebook.py`
-3. programmatically, which allows you serve **read-only** marimo apps
- as part of other ASGI applications, for example using FastAPI.
+!!! tip "Sharing notebooks on the public web"
+ To share notebooks on the public web without managing infrastructure, try
+ [molab](../molab.md), our free cloud-hosted notebook environment
-!!! 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).
+## Notebook servers
- 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.
+Deploy an edit server (`marimo edit`) to let users create and edit notebooks
+on a remote instance.
- WASM notebooks support most but not all Python features and packages.
+| Guide | Description |
+| ----- | ----------- |
+| [JupyterHub](jupyterhub.md) | Run marimo inside JupyterHub with our JupyterLab extension |
+| [Kubernetes](deploying_kubernetes.md) | Deploy on Kubernetes |
+| [SkyPilot](deploying_skypilot.md) | Deploy on cloud VMs with SkyPilot |
+| [Slurm](deploying_slurm.md) | Run on HPC clusters with Slurm |
-## Deploying an edit server
+You can also deploy an edit server with [ssh port forwarding](../../faq.md#faq-remote)
+using `marimo edit --headless`.
-Here are a few ways to deploy an edit server on a remote instance:
+## Apps
-1. With [ssh-port forwarding](../../faq.md#faq-remote), using `marimo edit --headless`.
-2. Via docker and our [prebuilt containers](prebuilt_containers.md).
-3. Via a deployment service [such as Railway](deploying_railway.md).
-4. Via [SkyPilot](deploying_skypilot.md).
-5. [On Slurm/HPC clusters](deploying_slurm.md).
-6. [Behind JupyterHub](../../faq.md#faq-jupyter-hub).
+Deploy notebooks as read-only web apps (`marimo run`) or embed them in
+other applications.
-## Deploying as read-only apps
-
-These guides help you deploy marimo notebooks as read-only apps.
-
-| | |
-| :------------------------------ | :------------------------------------------------------- |
-| [programmatically](./programmatically.md) | Programmatically run and customize read-only marimo apps |
-| [deploying_docker](./deploying_docker.md) | Deploy with Docker |
-| [deploying_slurm](./deploying_slurm.md) | Run on HPCs/SUNK with slurm |
-| [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 |
+| Guide | Description |
+| ----- | ----------- |
+| [FastAPI](programmatically.md) | Programmatically run marimo apps as part of ASGI applications |
+| [Authentication](authentication.md) | Authentication and security |
+| [Docker](deploying_docker.md) | Deploy with Docker |
+| [HuggingFace](deploying_hugging_face.md) | Deploy to Hugging Face Spaces |
+| [Railway](deploying_railway.md) | Deploy to Railway |
+| [nginx](deploying_nginx.md) | Deploy behind nginx |
### Health and status endpoints
diff --git a/docs/guides/deploying/jupyterhub.md b/docs/guides/deploying/jupyterhub.md
new file mode 100644
index 0000000000..6598fad42d
--- /dev/null
+++ b/docs/guides/deploying/jupyterhub.md
@@ -0,0 +1,73 @@
+# JupyterHub
+
+> For full documentation, visit the
+> [marimo-jupyter-extension repository](https://github.com/marimo-team/marimo-jupyter-extension).
+
+The [marimo JupyterLab extension](https://github.com/marimo-team/marimo-jupyter-extension)
+integrates marimo into JupyterLab and JupyterHub, letting you launch
+marimo notebooks directly from JupyterLab's launcher, manage running sessions,
+and convert Jupyter notebooks to marimo format.
+
+<figure>
+ <img src="/_static/docs-jupyterhub.png" alt="marimo JupyterLab extension showing sidebar and editor" />
+ <figcaption>marimo running in a JupyterHub deployment, in JupyterLab.</figcaption>
+</figure>
+
+## Features
+
+- **Launcher integration**: marimo appears in the JupyterLab launcher with its own icon
+- **First-class notebook support**: double-click `_mo.py` files to open directly in marimo
+- **Sidebar panel**: monitor server status, view running sessions with kill buttons, and access quick actions
+- **Environment selection**: choose from available Python environments when creating notebooks; the extension discovers Jupyter kernel specs, letting you use your own venvs or conda environments.
+- **Context menus**: right-click `.py` files to edit with marimo, or `.ipynb` files to convert to marimo format
+- **Sandbox mode**: run marimo in isolated environments with `uvx`
+
+### File type handling
+
+| File Type | Double-click | Right-click |
+|-----------|-------------|-------------|
+| `_mo.py` | Opens in marimo | "Edit with marimo" |
+| `.py` | Opens in standard editor | "Edit with marimo" |
+| `.ipynb` | Opens in Jupyter | "Convert to marimo" |
+
+## Installation
+
+### Single environment
+
+```bash
+uv pip install 'marimo[sandbox]>=0.19.11' marimo-jupyter-extension
+```
+
+### JupyterHub (multiple environments)
+
+| Package | Install location | Why |
+|---------|-----------------|-----|
+| `marimo` | User's environment | Access user's packages |
+| `marimo-jupyter-extension` | Jupyter's environment | Jupyter must import it |
+
+## Configuration
+
+Configure the extension in `jupyterhub_config.py`:
+
+```python
+# Explicit marimo path
+c.MarimoProxyConfig.marimo_path = "/opt/bin/marimo"
+
+# Or use uvx mode (sandbox)
+c.MarimoProxyConfig.uvx_path = "/usr/local/bin/uvx"
+
+# Startup timeout (default: 60s)
+c.MarimoProxyConfig.timeout = 120
+```
+
+## Troubleshooting
+
+| Issue | Solution |
+|-------|----------|
+| marimo icon missing | Install `marimo-jupyter-extension` in Jupyter's environment |
+| marimo fails to launch | Ensure marimo is in PATH or configure `MarimoProxyConfig.marimo_path` |
+| Modules not found | Install marimo in the same environment as your packages |
+| Sandbox features not working | Upgrade to `marimo[sandbox]>=0.19.11` |
+
+For more troubleshooting tips, see the
+[full documentation](https://github.com/marimo-team/marimo-jupyter-extension).
diff --git a/docs/guides/deploying/scheduled.md b/docs/guides/deploying/scheduled.md
deleted file mode 100644
index 4ba4155ed0..0000000000
--- a/docs/guides/deploying/scheduled.md
+++ /dev/null
@@ -1,45 +0,0 @@
-# Running marimo notebooks as scheduled jobs
-
-marimo notebooks are stored as Python files, so any system that can schedule a Python script can schedule a marimo notebook. This includes [cron](https://en.wikipedia.org/wiki/Cron), [airflow](https://airflow.apache.org/) or [prefect](https://www.prefect.io/). You can even [pass variables](https://docs.marimo.io/guides/scripts/?h=command+line) from the command line to marimo notebooks, which makes them well-suited to this use-case.
-
-## Github Actions
-
-As an alternative to using [cron](https://en.wikipedia.org/wiki/Cron) directly, you might be interested in running scheduled marimo notebooks as part of your [Github actions](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule) workflow. You can use the code below as a starting point. Note that this example assumes you're using [inline dependencies](../package_management/inlining_dependencies.md).
-
-```yaml
-name: Run marimo notebook every day at 09:00
-
-on:
- schedule: '0 9 * * *'
-jobs:
- scheduled:
-jobs:
- run-marimo:
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v4
-
- - name: Set up Python
- uses: actions/setup-python@v5
- with:
- python-version: '3.11'
-
- - name: Install uv
- uses: astral-sh/setup-uv@v7
- with:
- version: "latest"
-
- - name: Use uv to run notebook as normal script
- run: |
- uv run path/to/marimo_notebook.py
-```
-
-## Alternatives
-
-For tools like Airflow and Prefect, you can also choose to reuse parts of a marimo notebook in larger Python batch jobs. Check the [docs on reusing functions](https://docs.marimo.io/guides/reusing_functions/) or [this Prefect tutorial on YouTube](https://www.youtube.com/watch?v=CvSbGTFCpF4) if you're interested in that. For Airflow specifically it might make also sense to write a custom operator, see [this tutorial on YouTube](https://www.youtube.com/watch?v=ITuUYW14ToA) for more details.
-
-Alternatively, you may be interested in having specific cells in marimo run on an automated schedule as you have the notebook open. The simplest way to do that is to use the [mo.ui.refresh](https://docs.marimo.io/api/inputs/refresh/#marimo.ui.refresh) widget to manually specify how often a cell needs to rerun.
-
-Finally, if you have very custom needs, you can always use third party Python libraries (like [schedule](https://schedule.readthedocs.io/en/stable/index.html)) to set up something bespoke from your own code.
diff --git a/docs/guides/expensive_notebooks.md b/docs/guides/expensive_notebooks.md
index f7e4ffd36a..39425d25fd 100644
--- a/docs/guides/expensive_notebooks.md
+++ b/docs/guides/expensive_notebooks.md
@@ -140,7 +140,7 @@ through the notebook menu (these files are saved in addition to the
notebook's `.py` file). Snapshots are saved to a folder called
`__marimo__` in the notebook directory.
-Learn more about exporting notebooks in our [exporting guide](../guides/exporting.md).
+Learn more about exporting notebooks in our [exporting guide](../guides/exporting/index.md).
## Cache expensive computations
diff --git a/docs/guides/exporting.md b/docs/guides/exporting.md
deleted file mode 100644
index a3f7028dce..0000000000
--- a/docs/guides/exporting.md
+++ /dev/null
@@ -1,544 +0,0 @@
-# Exporting to HTML and other formats
-
-Export marimo notebooks to other file formats at the command line using
-
-```bash
-marimo export
-```
-
-## Export to static HTML
-
-### Export from a running notebook
-
-Export the current view your notebook to static HTML via the notebook
-menu:
-
-<div align="center">
-<figure>
-<img src="/_static/docs-html-export.png"/>
-<figcaption>Download as static HTML.</figcaption>
-</figure>
-</div>
-
-Additionally, you can configure individual notebooks to automatically
-save as HTML through the notebook menu. These automatic snapshots are
-saved to a folder called `__marimo__` in the notebook directory.
-
-### Export from the command line
-
-Export to HTML at the command line:
-
-```bash
-marimo export html notebook.py -o notebook.html
-```
-
-or watch the notebook for changes and automatically export to HTML:
-
-```bash
-marimo export html notebook.py -o notebook.html --watch
-```
-
-When you export from the command line, marimo runs your notebook to produce
-its visual outputs before saving as HTML.
-
-!!! 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`.
-
-### Pre-render HTML exports
-
-Static marimo exports execute Javascript to render the notebook source code as HTML at browser runtime. If you would like to directly serve the HTML representation of your notebook, you can run the following post-processing script and serve the resulting file instead.
-
-```python
-# /// script
-# requires-python = ">=3.9"
-# dependencies = [
-# "playwright",
-# ]
-# ///
-
-import os
-import subprocess
-from playwright.sync_api import sync_playwright
-
-input_file = "input.html"
-output_file = "output.html"
-
-subprocess.run(["playwright", "install", "chromium-headless-shell"], check=True)
-
-with sync_playwright() as p:
- with p.chromium.launch(headless=True) as browser:
- page = browser.new_page()
- page.goto(
- f"file:///{os.path.abspath(input_file)}",
- wait_until="networkidle",
- )
- with open(output_file, "w", encoding="utf-8") as f:
- f.write(page.content())
-```
-
-## Export to a Python script
-
-Export to a flat Python script in topological order, so the cells adhere to
-their dependency graph.
-
-```bash
-marimo export script notebook.py -o notebook.script.py
-```
-
-!!! warning "Top-level await not supported"
-
- Exporting to a flat Python script does not support top-level await. If you have
- top-level await in your notebook, you can still execute the notebook as a
- script with `python notebook.py`.
-
-## Export to markdown
-
-Export to markdown notebook in top to bottom order, so the cells are in the
-order as they appear in the notebook.
-
-```bash
-marimo export md notebook.py -o notebook.md
-```
-
-This can be useful to plug into other tools that read markdown, such as [Quarto](https://quarto.org/) or [MyST](https://myst-parser.readthedocs.io/).
-
-!!! tip "marimo can directly open markdown files as notebooks"
- Learn more with `marimo tutorial markdown-format` at the command line.
-
-You can also convert the markdown back to a marimo notebook:
-
-```bash
-marimo convert notebook.md > notebook.py
-```
-
-## Export to Jupyter notebook
-
-Export to Jupyter notebook in topological order, so the cells adhere to
-their dependency graph.
-
-```bash
-marimo export ipynb notebook.py -o notebook.ipynb
-```
-
-## Export session snapshots
-
-Run notebooks and write their serialized session snapshots:
-
-```bash
-marimo export session notebook.py
-```
-
-By default, snapshots are written to:
-
-```text
-<notebook_dir>/__marimo__/session/<notebook_filename>.json
-```
-
-For example, exporting `notebook.py` writes:
-
-```text
-__marimo__/session/notebook.py.json
-```
-
-`marimo export session` accepts one positional target: a notebook file or a directory.
-To process multiple notebooks, pass a directory target.
-
-Export every notebook in a directory:
-
-```bash
-marimo export session folder/
-```
-
-Pass CLI args through to notebooks with `--`:
-
-```bash
-marimo export session notebook.py -- --foo 123
-```
-
-By default, marimo only rewrites session snapshots when they are stale (for example, when notebook code changes or PEP 723 script metadata changes).
-Up-to-date snapshots are skipped.
-
-To force rewriting all snapshots, even when they are up-to-date:
-
-```bash
-marimo export session folder/ --force-overwrite
-```
-
-If one notebook fails, marimo continues by default and exits non-zero after processing all targets.
-Use `--no-continue-on-error` to stop at the first failure.
-
-To execute in a sandboxed environment, pass `--sandbox`:
-
-```bash
-marimo export session notebook.py --sandbox
-```
-
-## Exporting to PDF, slides, or rst
-
-### Export PDF using Quarto
-
-The marimo [Quarto](https://www.github.com/marimo-team/quarto-marimo) plugin
-enables exporting to PDF and other formats with Pandoc. See this [publishing](./publishing/quarto.md) for more details.
-
-### Export PDF from the command line
-
-You can export directly with marimo:
-
-```bash
-# Hide code cells in the exported PDF
-marimo export pdf notebook.py -o notebook.pdf --no-include-inputs
-
-# Disable rasterized output capture
-marimo export pdf notebook.py -o notebook.pdf --no-include-inputs --no-rasterize-outputs
-
-# Use a live server for raster capture
-marimo export pdf notebook.py -o notebook.pdf --no-include-inputs --raster-server=live
-```
-
-The `--no-include-inputs` flag hides Python code cells while keeping markdown and cell outputs in the generated PDF.
-
-Rasterized PNG fallback capture for marimo widget HTML (including anywidgets) and Vega outputs is enabled by default before `nbconvert` PDF conversion. Use `--no-rasterize-outputs` to disable it. Rasterization works with both `--webpdf` and `--no-webpdf`.
-
-Rasterization runs only when outputs are included (the default `--include-outputs` mode). Use `--raster-scale` (range `1.0` to `4.0`, default `4.0`) to trade export speed/file size for sharper captured output. Use `--raster-server=static` (default) for a static capture page, or `--raster-server=live` to capture through a live notebook server.
-
-!!! warning "Choose the raster server mode carefully"
-
- marimo gives you control over how output is captured.
- Use `--raster-server=live` when a widget needs Python to finish rendering.
- Otherwise, prefer the default `--raster-server=static`.
-
-The notebook below is a concrete case where `--raster-server=live` helps.
-
-/// marimo-embed-file
- size: xlarge
- mode: edit
- filepath: examples/outputs/live_raster.py
-///
-
-This widget starts at `Initializing...` and then updates to
-`count is ... from ... host` after it receives data from Python.
-Static capture can freeze the initial placeholder; live capture gets the
-updated output.
-
-```bash
-# Static mode captures only the initial "Initializing..." placeholder
-marimo export pdf examples/outputs/live_raster.py \
- -o live-raster-static.pdf --raster-server=static --no-sandbox --no-include-inputs
-
-# Live mode captures the updated widget output
-marimo export pdf examples/outputs/live_raster.py \
- -o live-raster-live.pdf --raster-server=live --no-sandbox --no-include-inputs
-```
-
-!!! note "Rasterization dependencies"
-
- Rasterized output capture requires Playwright and Chromium:
-
- ```bash
- uv pip install playwright
- playwright install chromium
- ```
-
-To export as a slide deck PDF, use the slides preset:
-
-```bash
-marimo export pdf notebook.py -o notebook.pdf --as=slides --raster-server=live
-```
-
-`--raster-server=live` is recommended for slide exports because it better preserves
-slide aspect ratio and captures widget-heavy outputs more reliably.
-
-Available presets:
-
-- `--as=document`: Standard document PDF (default)
-- `--as=slides`: Slide-style PDF using reveal.js print layout
-
-If a notebook uses slides layout and `--as` is omitted, marimo keeps
-document export as the default and prints a CLI hint for `--as=slides`.
-
-If you export to a Jupyter notebook, you can leverage various Jupyter ecosystem tools. For PDFs, you will
-need to have [Pandoc](https://nbconvert.readthedocs.io/en/latest/install.html#installing-pandoc) and [TeX](https://nbconvert.readthedocs.io/en/latest/install.html#installing-tex) installed. The examples below use `uvx`, which you can obtain by [installing `uv`](https://docs.astral.sh/uv/getting-started/installation/).
-
-```bash
-NOTEBOOK=notebook.ipynb
-
-# Convert to PDF using nbconvert
-uvx --with nbconvert --from jupyter-core jupyter nbconvert --to pdf $NOTEBOOK
-
-# Convert to web PDF
-uvx --with "nbconvert[webpdf]" --from jupyter-core jupyter nbconvert --to webpdf $NOTEBOOK --allow-chromium-download
-
-# Convert to slides
-uvx --with nbconvert --from jupyter-core jupyter nbconvert --to slides $NOTEBOOK
-
-# Convert to rst with nbconvert
-uvx --with nbconvert --from jupyter-core jupyter nbconvert --to rst $NOTEBOOK
-
-# Generate PNG/PDF of specific cells using nbconvert
-uvx --with nbconvert --with jupyter --from jupyter-core jupyter nbconvert --to pdf --execute --stdout $NOTEBOOK \
- --TemplateExporter.exclude_input=True
-
-# Use nbconvert programmatically for more control
-uv run --with nbconvert python -c "
-from nbconvert import PDFExporter
-import nbformat
-nb = nbformat.read('$NOTEBOOK', as_version=4)
-pdf_exporter = PDFExporter()
-pdf_data, resources = pdf_exporter.from_notebook_node(nb)
-with open('notebook.pdf', 'wb') as f:
- f.write(pdf_data)
-"
-```
-
-You can also use other tools that work with Jupyter notebooks:
-
-- [Quarto](https://quarto.org) - Create beautiful documents, websites, presentations
-- [nbgrader](https://nbgrader.readthedocs.io/) - Grade notebook assignments
-
-### Export PDF from the command palette
-
-!!! note "Experimental feature"
-
- This feature is experimental. Enable it in **Settings > Experimental > Better PDF Export**.
-
-You can export your notebook to PDF directly from the command palette (Ctrl+K) by clicking
-**Download as PDF** or **Download as Slide PDF**. This uses `nbconvert` under the hood and will attempt the
-following:
-
-1. **Standard PDF export** (requires [Pandoc](https://nbconvert.readthedocs.io/en/latest/install.html#installing-pandoc) and [TeX](https://nbconvert.readthedocs.io/en/latest/install.html#installing-tex)) — produces higher quality PDFs
-2. **WebPDF fallback** (requires Chromium via [Playwright](https://playwright.dev/python/)) — automatically used if Pandoc/TeX are not installed
-
-To install the required dependencies:
-
-```bash
-# For standard PDF export (higher quality)
-uv pip install nbconvert
-
-# For WebPDF fallback (easier setup)
-uv pip install "nbconvert[webpdf]"
-```
-
-## Export to WASM-powered HTML
-
-Export your notebook to a self-contained HTML file that runs using [WebAssembly](wasm.md):
-
-```bash
-# export as readonly, with code locked
-marimo export html-wasm notebook.py -o output_dir --mode run
-# export as an editable notebook
-marimo export html-wasm notebook.py -o output_dir --mode edit
-```
-
-The exported HTML file will run your notebook using WebAssembly, making it completely self-contained and executable in the browser. This means users can interact with your notebook without needing Python or marimo installed.
-
-Options:
-
-- `--mode`: Choose between `run` (read-only) or `edit` (allows editing)
-- `--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
-- `--watch/--no-watch`: Watch the notebook for changes and automatically export
-- `--include-cloudflare`: Write configuration files necessary for deploying to Cloudflare
-
-Note that WebAssembly notebooks have [limitations](wasm.md#limitations); in particular,
-[many but not all packages work](wasm.md#packages).
-
-!!! 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
- a simpler publishing experience, publish to [GitHub
- Pages](publishing/github_pages.md), [Cloudflare](publishing/cloudflare.md) or use the [online
- playground](publishing/playground.md).
-
-??? note "Deploying to Cloudflare"
-
- You can include `--include-cloudflare` for deploying to Cloudflare. For example:
-
- ```
- marimo export html-wasm notebook.py -o my_app/dist --include-cloudflare
- ```
-
- To run locally, run:
-
- ```
- npx wrangler dev
- ```
-
- To deploy to Cloudflare, run:
-
- ```
- npx wrangler deploy
- ```
-
-### Testing the export
-
-You can test the export by running the following command in the directory containing your notebook:
-
-```bash
-cd path/to/output_dir
-python -m http.server
-```
-
-### Including data files
-
-See the docs for [mo.notebook_location][marimo.notebook_location] to learn how
-to include data files in exported WASM HTML notebooks.
-
-### Publishing to GitHub Pages
-
-After exporting your notebook to WASM HTML, you can publish it to
-[GitHub Pages](https://pages.github.com/) for free. See our [guide on
-GitHub Pages](publishing/github_pages.md) to learn more.
-
-### Exporting multiple notebooks
-
-In order to export multiple notebooks under the same folder, you can use the following snippet:
-
-```bash
-files=("batch_and_form.py" "data_explorer.py")
-
-for file in "${files[@]}"; do
- without_extension="${file%.*}"
- marimo export html-wasm "$file" -o site/"$without_extension".html --mode run
-done
-```
-
-Optionally, you can create an `index.html` file in the public directory:
-
-```bash
-echo "<html><body><ul>" > site/index.html
-for file in "${files[@]}"; do
- without_extension="${file%.*}"
- echo "<li><a href=\"$without_extension.html\">$without_extension</a></li>" >> site/index.html
-done
-echo "</ul></body></html>" >> site/index.html
-```
-
-## 🏝️ Embed marimo outputs in HTML using Islands
-
-!!! 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.
-
-Check out an [example island-powered document](./island_example.md).
-
-### Generating islands
-
-Use `MarimoIslandGenerator` to generate HTML for islands
-
-!!! example
- /// tab | From code blocks
-
- ```python
- import asyncio
- import sys
- from marimo import MarimoIslandGenerator
-
- if sys.platform == 'win32':
- asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
-
- async def main():
- generator = MarimoIslandGenerator()
- block1 = generator.add_code("import marimo as mo")
- block2 = generator.add_code("mo.md('Hello, islands!')")
-
- # Build the app
- app = await generator.build()
-
- # Render the app
- output = f"""
- <html>
- <head>
- {generator.render_head()}
- </head>
- <body>
- {block1.render(display_output=False)}
- {block2.render()}
- </body>
- </html>
- """
- print(output)
- # Save the HTML to a file
- output_file = "output.html"
- with open(output_file, "w", encoding="utf-8") as f:
- f.write(output)
-
- if __name__ == '__main__':
- asyncio.run(main())
- ```
-
- ///
-
- /// tab | From notebook files
-
- ```python
- from marimo import MarimoIslandGenerator
-
- # Create the generator from file
- generator = MarimoIslandGenerator.from_file("./<notebook-name>.py", display_code=False)
-
- # Generate and print the HTML without building
- # This will still work for basic rendering, though without running the cells
- html = generator.render_html(include_init_island=False)
- print(html)
- # Save the HTML to a file
- output_file = "output.html"
- with open(output_file, "w", encoding="utf-8") as f:
- f.write(html)
- ```
-
- ///
-
-Any relevant `.html` that gets generated can be run through the [`development.md`](https://github.com/marimo-team/marimo/blob/main/frontend/islands/development.md) file instructions.
-
-### Islands in action
-
-!!! 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 --
- <script type="module" src="https://cdn.jsdelivr.net/npm/@marimo-team/islands@<version>/dist/main.js"></script>
- <link
- href="https://cdn.jsdelivr.net/npm/@marimo-team/islands@<version>/dist/style.css"
- rel="stylesheet"
- crossorigin="anonymous"
- />
- <!-- fonts -->
- <link rel="preconnect" href="https://fonts.googleapis.com" />
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
- <link
- href="https://fonts.googleapis.com/css2?family=Fira+Mono:wght@400;500;700&amp;family=Lora&amp;family=PT+Sans:wght@400;700&amp;display=swap"
- rel="stylesheet"
- />
- <link
- rel="stylesheet"
- href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css"
- integrity="sha384-wcIxkf4k558AjM3Yz3BBFQUbk/zgIYC2R0QpeeYb+TwlBVMrlgLqwRjRtGZiK7ww"
- crossorigin="anonymous"
- />
-</head>
-
-<body>
- <marimo-island data-app-id="main" data-cell-id="MJUe" data-reactive="true">
- <marimo-cell-output>
- <span class="markdown">
- <span class="paragraph">Hello, islands!</span>
- </span>
- </marimo-cell-output>
- <marimo-cell-code hidden>mo.md('Hello islands 🏝️!')</marimo-cell-code>
- </marimo-island>
-</body>
-```
-
-::: marimo.MarimoIslandGenerator
diff --git a/docs/guides/exporting/index.md b/docs/guides/exporting/index.md
new file mode 100644
index 0000000000..e893d52e96
--- /dev/null
+++ b/docs/guides/exporting/index.md
@@ -0,0 +1,24 @@
+# Export to other formats
+
+Export marimo notebooks to other file formats from the browser editor. Notebooks can
+also be exported to other formats at the command-line with:
+
+```bash
+marimo export
+```
+
+/// tip | Looking to share notebooks online?
+For sharing interactive notebooks on the public web, consider using [molab](../molab.md), our free cloud-hosted notebook platform.
+///
+
+## Available formats
+
+| Format | Command | Description |
+|--------|---------|-------------|
+| [Static HTML](static_html.md) | `marimo export html` | Non-interactive HTML snapshot |
+| [PDF](pdf.md) | `marimo export pdf` | PDF document or slide deck |
+| [Jupyter notebook](jupyter_notebook.md) | `marimo export ipynb` | Jupyter `.ipynb` file |
+| [Python script](python_script.md) | `marimo export script` | Flat `.py` script in topological order |
+| [Markdown](markdown.md) | `marimo export md` | Markdown with code blocks |
+| [WebAssembly HTML](webassembly_html.md) | `marimo export html-wasm` | Self-contained, interactive HTML powered by WebAssembly |
+| [Session snapshot](sessions.md) | `marimo export session` | Serialized session snapshot (JSON) |
diff --git a/docs/guides/exporting/jupyter_notebook.md b/docs/guides/exporting/jupyter_notebook.md
new file mode 100644
index 0000000000..5a089585cd
--- /dev/null
+++ b/docs/guides/exporting/jupyter_notebook.md
@@ -0,0 +1,49 @@
+# Jupyter notebook
+
+Export marimo notebooks to Jupyter `.ipynb` format. This lets you
+go from marimo into the vast Jupyter export ecosystem, including tools
+like `nbconvert`, Quarto, JupyterBook, and more.
+
+## Export from the marimo editor
+
+You can configure individual notebooks to automatically
+save as ipynb through the notebook menu. These automatic snapshots are
+saved to a folder called `__marimo__` in the notebook directory.
+
+<div align="center">
+<figure>
+<img src="/_static/docs-jupyter-autoexport.png" width="75%"/>
+<figcaption>Download as static HTML.</figcaption>
+</figure>
+</div>
+
+## Export from the command line
+
+Export to Jupyter notebook in topological order, so the notebook
+can be run from top to bottom:
+
+```bash
+marimo export ipynb notebook.py -o notebook.ipynb
+```
+
+
+Export with cells in the same order as the marimo notebook:
+
+```bash
+marimo export ipynb notebook.py -o notebook.ipynb --sort=top-down
+```
+
+See all options:
+
+```bash
+marimo export ipynb notebook.py -o notebook.ipynb --sort=top-down
+```
+
+
+## Convert back to a marimo notebook
+
+You can also convert a Jupyter notebook back to a marimo notebook:
+
+```bash
+marimo convert notebook.ipynb -o notebook.py
+```
diff --git a/docs/guides/exporting/markdown.md b/docs/guides/exporting/markdown.md
new file mode 100644
index 0000000000..2c704a4054
--- /dev/null
+++ b/docs/guides/exporting/markdown.md
@@ -0,0 +1,41 @@
+# Markdown
+
+Export marimo notebooks to markdown.
+
+!!! warning "Outputs are not included"
+
+ Markdown export only includes the notebook source code (code and markdown cells). Cell outputs are not saved in the exported markdown. To include outputs, export to [static HTML](static_html.md) or [Jupyter notebook](jupyter_notebook.md) instead.
+
+## Export from the marimo editor
+
+Export from the notebook settings menu, in the top right.
+
+<div align="center">
+<figure>
+<img src="/_static/docs-md-export.png" width="65%"/>
+<figcaption>Download as static HTML.</figcaption>
+</figure>
+</div>
+
+
+## Export from the command line
+
+Export to markdown in top to bottom order, so the cells are in the
+order as they appear in the notebook.
+
+```bash
+marimo export md notebook.py -o notebook.md
+```
+
+This can be useful to plug into other tools that read markdown, such as [Quarto](https://quarto.org/) or [MyST](https://myst-parser.readthedocs.io/).
+
+!!! tip "marimo can open markdown files as notebooks"
+ Learn more with `marimo tutorial markdown-format` at the command line.
+
+## Convert markdown back to a marimo notebook
+
+You can also convert the markdown back to a marimo notebook:
+
+```bash
+marimo convert notebook.md > notebook.py
+```
diff --git a/docs/guides/exporting/pdf.md b/docs/guides/exporting/pdf.md
new file mode 100644
index 0000000000..e23d35d7a0
--- /dev/null
+++ b/docs/guides/exporting/pdf.md
@@ -0,0 +1,150 @@
+# PDF
+
+Export marimo notebooks to PDF documents or slide decks.
+
+> PDF export works out-of-the-box on on [molab](https://molab.marimo.io/notebooks).
+
+## Export to PDF from the marimo editor
+
+Export to PDF from the notebooks action menu. This requires a few dependencies, which you will be
+prompted to install. It also requires LaTeX to install.
+
+<div align="center">
+<figure>
+<img src="/_static/docs-pdf-export.png" width="65%"/>
+<figcaption>Download as PDF.</figcaption>
+</figure>
+</div>
+
+You can also export to PDF from the command palette (Ctrl/Cmd+K).
+
+## Export to PDF from the command line
+
+You can export directly with marimo:
+
+```bash
+marimo export pdf notebook.py -o notebook.pdf
+```
+
+To exclude code cells:
+
+```bash
+marimo export pdf --no-include-inputs notebook.py -o notebook.pdf
+```
+
+To see all options, use
+
+```bash
+marimo export pdf --help
+```
+
+### Rasterized output capture
+
+Rasterized PNG fallback capture for marimo widget HTML (including anywidgets)
+and Vega outputs is enabled by default. Use `--no-rasterize-outputs` to disable
+it.
+
+Use `--raster-scale` (range `1.0` to `4.0`, default `4.0`) to trade export speed/file size for sharper captured output. Use `--raster-server=static` (default) for a static capture page, or `--raster-server=live` to capture through a live notebook server.
+
+!!! warning "Choose the raster server mode carefully"
+
+ marimo gives you control over how output is captured.
+ Use `--raster-server=live` when a widget needs Python to finish rendering.
+ Otherwise, prefer the default `--raster-server=static`.
+
+The notebook below is a concrete case where `--raster-server=live` helps.
+
+/// marimo-embed-file
+ size: xlarge
+ mode: edit
+ filepath: examples/outputs/live_raster.py
+///
+
+This widget starts at `Initializing...` and then updates to
+`count is ... from ... host` after it receives data from Python.
+Static capture can freeze the initial placeholder; live capture gets the
+updated output.
+
+```bash
+# Static mode captures only the initial "Initializing..." placeholder
+marimo export pdf examples/outputs/live_raster.py \
+ -o live-raster-static.pdf --raster-server=static --no-sandbox --no-include-inputs
+
+# Live mode captures the updated widget output
+marimo export pdf examples/outputs/live_raster.py \
+ -o live-raster-live.pdf --raster-server=live --no-sandbox --no-include-inputs
+```
+
+!!! note "Rasterization dependencies"
+
+ Rasterized output capture requires Playwright and Chromium:
+
+ ```bash
+ uv pip install playwright
+ playwright install chromium
+ ```
+
+### Slides
+
+To export as a slides PDF, use the slides preset:
+
+```bash
+marimo export pdf notebook.py -o notebook.pdf --as=slides --raster-server=live
+```
+
+`--raster-server=live` is recommended for slide exports because it better preserves
+slide aspect ratio and captures widget-heavy outputs more reliably.
+
+Available presets:
+
+- `--as=document`: Standard document PDF (default)
+- `--as=slides`: Slide-style PDF using reveal.js print layout
+
+## Export to PDF using Quarto
+
+The marimo [Quarto](https://www.github.com/marimo-team/quarto-marimo) plugin
+enables exporting to PDF and other formats with Pandoc. See [Publishing with
+Quarto](quarto.md) for more details.
+
+### Export via Jupyter notebook
+
+If you export to a Jupyter notebook, you can leverage various Jupyter ecosystem tools. For PDFs, you will
+need to have [Pandoc](https://nbconvert.readthedocs.io/en/latest/install.html#installing-pandoc) and [TeX](https://nbconvert.readthedocs.io/en/latest/install.html#installing-tex) installed. The examples below use `uvx`, which you can obtain by [installing `uv`](https://docs.astral.sh/uv/getting-started/installation/).
+
+```bash
+NOTEBOOK=notebook.ipynb
+
+# Convert to PDF using nbconvert
+uvx --with nbconvert --from jupyter-core jupyter nbconvert --to pdf $NOTEBOOK
+
+# Convert to web PDF
+uvx --with "nbconvert[webpdf]" --from jupyter-core jupyter nbconvert --to webpdf $NOTEBOOK --allow-chromium-download
+
+# Convert to slides
+uvx --with nbconvert --from jupyter-core jupyter nbconvert --to slides $NOTEBOOK
+
+# Convert to rst with nbconvert
+uvx --with nbconvert --from jupyter-core jupyter nbconvert --to rst $NOTEBOOK
+
+# Generate PNG/PDF of specific cells using nbconvert
+uvx --with nbconvert --with jupyter --from jupyter-core jupyter nbconvert --to pdf --execute --stdout $NOTEBOOK \
+ --TemplateExporter.exclude_input=True
+
+# Use nbconvert programmatically for more control
+uv run --with nbconvert python -c "
+from nbconvert import PDFExporter
+import nbformat
+nb = nbformat.read('$NOTEBOOK', as_version=4)
+pdf_exporter = PDFExporter()
+pdf_data, resources = pdf_exporter.from_notebook_node(nb)
+with open('notebook.pdf', 'wb') as f:
+ f.write(pdf_data)
+"
+```
+
+You can also use other tools that work with Jupyter notebooks:
+
+- [Quarto](https://quarto.org) - Create beautiful documents, websites, presentations
+- [nbgrader](https://nbgrader.readthedocs.io/) - Grade notebook assignments
+
+
diff --git a/docs/guides/exporting/python_script.md b/docs/guides/exporting/python_script.md
new file mode 100644
index 0000000000..2671748da9
--- /dev/null
+++ b/docs/guides/exporting/python_script.md
@@ -0,0 +1,24 @@
+# Python script
+
+Export marimo notebooks to flat Python scripts.
+
+## Export from the marimo editor
+
+You can download your notebook as a Python script from the
+notebook menu in the editor (Download > Python).
+
+## Export from the command line
+
+Export to a flat Python script in topological order.
+
+```bash
+marimo export script notebook.py -o notebook.script.py
+```
+
+!!! warning "Top-level await not supported"
+
+ Exporting to a flat Python script does not support top-level await. If you have
+ top-level await in your notebook, you can still execute the notebook as a
+ script with `python notebook.py`.
+
+You can then reuse the notebook as a [script](../scripts.md) or a [module](../reusing_functions.md).
diff --git a/docs/guides/publishing/quarto.md b/docs/guides/exporting/quarto.md
similarity index 86%
rename from docs/guides/publishing/quarto.md
rename to docs/guides/exporting/quarto.md
index fb28344046..e28b0584ab 100644
--- a/docs/guides/publishing/quarto.md
+++ b/docs/guides/exporting/quarto.md
@@ -13,5 +13,3 @@ marimo's [Quarto extension](https://github.com/marimo-team/quarto-marimo) allows
Learn more with `marimo tutorial markdown-format` at the command line.
To encourage quarto support, `.qmd` and `.md` files are interchangeable to marimo as an editor.
-
-Alternatively, see our [MkDocs guide](mkdocs.md) for other methods of publishing marimo's markdown format.
diff --git a/docs/guides/exporting/sessions.md b/docs/guides/exporting/sessions.md
new file mode 100644
index 0000000000..1bae69c18c
--- /dev/null
+++ b/docs/guides/exporting/sessions.md
@@ -0,0 +1,64 @@
+# Session snapshots
+
+Run notebooks and write their serialized session snapshots.
+
+## Export from the command line
+
+```bash
+marimo export session notebook.py
+```
+
+By default, snapshots are written to:
+
+```text
+<notebook_dir>/__marimo__/session/<notebook_filename>.json
+```
+
+For example, exporting `notebook.py` writes:
+
+```text
+__marimo__/session/notebook.py.json
+```
+
+## Export a directory
+
+`marimo export session` accepts one positional target: a notebook file or a directory.
+To process multiple notebooks, pass a directory target.
+
+Export every notebook in a directory:
+
+```bash
+marimo export session folder/
+```
+
+## Passing CLI args
+
+Pass CLI args through to notebooks with `--`:
+
+```bash
+marimo export session notebook.py -- --foo 123
+```
+
+## Staleness and force overwrite
+
+By default, marimo only rewrites session snapshots when they are stale (for example, when notebook code changes or PEP 723 script metadata changes).
+Up-to-date snapshots are skipped.
+
+To force rewriting all snapshots, even when they are up-to-date:
+
+```bash
+marimo export session folder/ --force-overwrite
+```
+
+## Error handling
+
+If one notebook fails, marimo continues by default and exits non-zero after processing all targets.
+Use `--no-continue-on-error` to stop at the first failure.
+
+## Sandboxed execution
+
+To execute in a sandboxed environment, pass `--sandbox`:
+
+```bash
+marimo export session notebook.py --sandbox
+```
diff --git a/docs/guides/exporting/static_html.md b/docs/guides/exporting/static_html.md
new file mode 100644
index 0000000000..707c115e54
--- /dev/null
+++ b/docs/guides/exporting/static_html.md
@@ -0,0 +1,87 @@
+# Static HTML
+
+Export your notebook to a static, non-interactive HTML file.
+
+## Export from the marimo editor
+
+Export the current view of your notebook to static HTML via the notebook
+menu:
+
+<div align="center">
+<figure>
+<img src="/_static/docs-html-export.png" width="65%"/>
+<figcaption>Download as static HTML.</figcaption>
+</figure>
+</div>
+
+Additionally, you can configure individual notebooks to automatically
+save as HTML through the notebook menu. These automatic snapshots are
+saved to a folder called `__marimo__` in the notebook directory.
+
+<div align="center">
+<figure>
+<img src="/_static/docs-html-autoexport.png" width="75%"/>
+<figcaption>Download as static HTML.</figcaption>
+</figure>
+</div>
+
+
+## Export from the command line
+
+Export to HTML at the command line:
+
+```bash
+marimo export html notebook.py -o notebook.html
+```
+
+Exclude code from the export:
+
+```bash
+marimo export html --no-include-code notebook.py -o notebook.html --watch
+```
+
+Export the notebook whenever it changes on disk:
+
+```bash
+marimo export html notebook.py -o notebook.html --watch
+```
+
+**Exporting runs your notebook.** When you export from the command line, marimo runs your notebook to produce
+its visual outputs before saving as HTML.
+
+**Errors.** 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`.
+
+## Pre-render HTML exports
+
+Static marimo exports execute Javascript to render the notebook source code as HTML at browser runtime. If you would like to directly serve the HTML representation of your notebook, you can run the following post-processing script and serve the resulting file instead.
+
+```python
+# /// script
+# requires-python = ">=3.9"
+# dependencies = [
+# "playwright",
+# ]
+# ///
+
+import os
+import subprocess
+from playwright.sync_api import sync_playwright
+
+input_file = "input.html"
+output_file = "output.html"
+
+subprocess.run(["playwright", "install", "chromium-headless-shell"], check=True)
+
+with sync_playwright() as p:
+ with p.chromium.launch(headless=True) as browser:
+ page = browser.new_page()
+ page.goto(
+ f"file:///{os.path.abspath(input_file)}",
+ wait_until="networkidle",
+ )
+ with open(output_file, "w", encoding="utf-8") as f:
+ f.write(page.content())
+```
diff --git a/docs/guides/exporting/webassembly_html.md b/docs/guides/exporting/webassembly_html.md
new file mode 100644
index 0000000000..df293e0ecd
--- /dev/null
+++ b/docs/guides/exporting/webassembly_html.md
@@ -0,0 +1,220 @@
+# WebAssembly HTML
+
+Export your notebook to a self-contained HTML file that runs using [WebAssembly](../wasm.md).
+
+/// tip | Easiest way to share interactive notebooks
+For the simplest way to share interactive notebooks online, including WebAssembly notebooks, use [molab](../molab.md).
+///
+
+```bash
+# export as readonly, with code locked
+marimo export html-wasm notebook.py -o output_dir --mode run
+# export as an editable notebook
+marimo export html-wasm notebook.py -o output_dir --mode edit
+```
+
+The exported HTML file will run your notebook using WebAssembly, making it completely self-contained and executable in the browser. This means users can interact with your notebook without needing Python or marimo installed.
+
+Options:
+
+- `--mode`: Choose between `run` (read-only) or `edit` (allows editing)
+- `--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
+- `--watch/--no-watch`: Watch the notebook for changes and automatically export
+- `--include-cloudflare`: Write configuration files necessary for deploying to Cloudflare
+
+Note that WebAssembly notebooks have [limitations](../wasm.md#limitations); in particular,
+[many but not all packages work](../wasm.md#packages).
+
+!!! 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
+ a simpler publishing experience, use [molab](../molab.md), publish to [GitHub
+ Pages](../publishing/github.md#publish-to-github-pages), [Cloudflare](../publishing/cloudflare.md), or
+ [self-host](../publishing/self_host_wasm.md).
+
+??? note "Deploying to Cloudflare"
+
+ You can include `--include-cloudflare` for deploying to Cloudflare. For example:
+
+ ```
+ marimo export html-wasm notebook.py -o my_app/dist --include-cloudflare
+ ```
+
+ To run locally, run:
+
+ ```
+ npx wrangler dev
+ ```
+
+ To deploy to Cloudflare, run:
+
+ ```
+ npx wrangler deploy
+ ```
+
+## Testing the export
+
+You can test the export by running the following command in the directory containing your notebook:
+
+```bash
+cd path/to/output_dir
+python -m http.server
+```
+
+## Including data files
+
+See the docs for [mo.notebook_location][marimo.notebook_location] to learn how
+to include data files in exported WASM HTML notebooks.
+
+## Exporting multiple notebooks
+
+In order to export multiple notebooks under the same folder, you can use the following snippet:
+
+```bash
+files=("batch_and_form.py" "data_explorer.py")
+
+for file in "${files[@]}"; do
+ without_extension="${file%.*}"
+ marimo export html-wasm "$file" -o site/"$without_extension".html --mode run
+done
+```
+
+Optionally, you can create an `index.html` file in the public directory:
+
+```bash
+echo "<html><body><ul>" > site/index.html
+for file in "${files[@]}"; do
+ without_extension="${file%.*}"
+ echo "<li><a href=\"$without_extension.html\">$without_extension</a></li>" >> site/index.html
+done
+echo "</ul></body></html>" >> site/index.html
+```
+
+## Embed marimo outputs in HTML using Islands
+
+!!! 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.
+
+Check out an [example island-powered document](../island_example.md).
+
+### Generating islands
+
+Use `MarimoIslandGenerator` to generate HTML for islands
+
+!!! example
+ /// tab | From code blocks
+
+ ```python
+ import asyncio
+ import sys
+ from marimo import MarimoIslandGenerator
+
+ if sys.platform == 'win32':
+ asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
+
+ async def main():
+ generator = MarimoIslandGenerator()
+ block1 = generator.add_code("import marimo as mo")
+ block2 = generator.add_code("mo.md('Hello, islands!')")
+
+ # Build the app
+ app = await generator.build()
+
+ # Render the app
+ output = f"""
+ <html>
+ <head>
+ {generator.render_head()}
+ </head>
+ <body>
+ {block1.render(display_output=False)}
+ {block2.render()}
+ </body>
+ </html>
+ """
+ print(output)
+ # Save the HTML to a file
+ output_file = "output.html"
+ with open(output_file, "w", encoding="utf-8") as f:
+ f.write(output)
+
+ if __name__ == '__main__':
+ asyncio.run(main())
+ ```
+
+ ///
+
+ /// tab | From notebook files
+
+ ```python
+ from marimo import MarimoIslandGenerator
+
+ # Create the generator from file
+ generator = MarimoIslandGenerator.from_file("./<notebook-name>.py", display_code=False)
+
+ # Generate and print the HTML without building
+ # This will still work for basic rendering, though without running the cells
+ html = generator.render_html(include_init_island=False)
+ print(html)
+ # Save the HTML to a file
+ output_file = "output.html"
+ with open(output_file, "w", encoding="utf-8") as f:
+ f.write(html)
+ ```
+
+ ///
+
+Any relevant `.html` that gets generated can be run through the [`development.md`](https://github.com/marimo-team/marimo/blob/main/frontend/islands/development.md) file instructions.
+
+### Islands in action
+
+!!! 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 --
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@marimo-team/islands@<version>/dist/main.js"></script>
+ <link
+ href="https://cdn.jsdelivr.net/npm/@marimo-team/islands@<version>/dist/style.css"
+ rel="stylesheet"
+ crossorigin="anonymous"
+ />
+ <!-- fonts -->
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
+ <link
+ href="https://fonts.googleapis.com/css2?family=Fira+Mono:wght@400;500;700&amp;family=Lora&amp;family=PT+Sans:wght@400;700&amp;display=swap"
+ rel="stylesheet"
+ />
+ <link
+ rel="stylesheet"
+ href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css"
+ integrity="sha384-wcIxkf4k558AjM3Yz3BBFQUbk/zgIYC2R0QpeeYb+TwlBVMrlgLqwRjRtGZiK7ww"
+ crossorigin="anonymous"
+ />
+</head>
+
+<body>
+ <marimo-island data-app-id="main" data-cell-id="MJUe" data-reactive="true">
+ <marimo-cell-output>
+ <span class="markdown">
+ <span class="paragraph">Hello, islands!</span>
+ </span>
+ </marimo-cell-output>
+ <marimo-cell-code hidden>mo.md('Hello islands 🏝️!')</marimo-cell-code>
+ </marimo-island>
+</body>
+```
+
+::: marimo.MarimoIslandGenerator
diff --git a/docs/guides/index.md b/docs/guides/index.md
index db30a90cf8..94805bc072 100644
--- a/docs/guides/index.md
+++ b/docs/guides/index.md
@@ -29,11 +29,11 @@ These guides cover marimo's core concepts.
| [Scripts](scripts.md) | Running notebooks as scripts |
| [Reusing functions and classes](reusing_functions.md) | Importing functions and classes defined in marimo notebooks |
| [Tests](testing/index.md) | Running unit tests in notebooks |
-| [Export notebooks](exporting.md) | Exporting notebooks to HTML, ipynb, flat scripts, and more |
-| [Cloud notebooks with molab](molab.md) | Share links to cloud-based marimo notebooks, similar to Google Colab |
-| [Publish to the web](publishing/index.md) | Edit and publish notebooks on the web |
-| [Run notebooks with WebAssembly](wasm.md) | Create notebooks in our online playground |
-| [Deploying](deploying/index.md) | Deploying marimo notebooks and apps |
+| [Export to other formats](exporting/index.md) | Export notebooks to HTML, PDF, ipynb, scripts, and more |
+| [Run and share in the cloud with molab](molab.md) | Share cloud-hosted notebooks for free, preview from GitHub, embed in webpages |
+| [Publish to the web](publishing/index.md) | Publish notebooks to molab, embed in webpages, to/from GitHub, and more |
+| [Deploy notebook servers or apps](deploying/index.md) | Deploy notebook servers (JupyterHub, Kubernetes) or read-only apps |
+| [WebAssembly notebooks](wasm.md) | Run notebooks entirely in the browser with WebAssembly |
| [Configuration](configuration/index.md) | Configure various settings |
| [Coming from other tools](coming_from/index.md) | Transitioning from Jupyter and other tools |
| [Extending marimo](integrating_with_marimo/index.md) | Rich displays of objects, custom UI plugins |
diff --git a/docs/guides/molab.md b/docs/guides/molab.md
index 61e9d0bfa9..308ad6ed54 100644
--- a/docs/guides/molab.md
+++ b/docs/guides/molab.md
@@ -2,7 +2,7 @@
!!! tip "Contribute to our community gallery!"
We welcome submissions to our curated [community gallery](https://marimo.io/gallery?tag=community).
- To propose an example, [reach out to us on Discord](https://marimo.io/discord).
+ To propose an example, share your notebook on socials and [tag us](publishing/public_gallery.md).
[molab](https://molab.marimo.io/notebooks) is a free cloud-hosted marimo notebook
environment. molab is designed for sharing, and is integrated with GitHub;
@@ -17,6 +17,7 @@ notebooks are public but undiscoverable by default.
- 🔗 Share links and [open-in-molab badges](#share-open-in-molab-badges)
- 👀 [Preview notebooks hosted on GitHub](#preview-notebooks-from-github), with interactivity
- 🌐 [Embed interactive notebooks](#embed-in-other-webpages) in your own webpages
+- 📄 Export to PDF
- 📥 Download notebooks to your machine, reuse them as Python scripts or apps
- 📤 Upload local notebooks to the cloud from our CLI (coming soon)
- 🕹️ Real-time collaboration (coming soon)
@@ -97,9 +98,14 @@ links. If you want the preview to be interactive (and if your notebook is
## Embed in other webpages
You can embed interactive molab notebooks in your own webpages using iframes.
-Embedded notebooks run in the browser via WebAssembly, so your notebook must
-be [WebAssembly-compatible](wasm.md). We also recommend creating these
-notebooks [with `--sandbox`](package_management/inlining_dependencies.md) to make sure their dependencies get installed.
+Obtain iframe snippets by clicking the share button on interactive [molab previews
+of GitHub notebooks](#preview-notebooks-from-github), or construct
+embeddable URLs yourself using the recipes below.
+
+> Embedded notebooks run in the browser via WebAssembly, so your notebook must be
+[WebAssembly-compatible](wasm.md). We also recommend creating these notebooks
+[with `--sandbox`](package_management/inlining_dependencies.md) to make sure
+their dependencies get installed.
### Embed notebooks from GitHub
@@ -109,7 +115,7 @@ Add `?embed=true` to an [interactive preview URL](#interactive-previews) to get
```html
<iframe
- src="https://molab.marimo.io/github/marimo-team/gallery-examples/blob/main/notebooks/math/cellular-automaton-art.py/wasm?embed=true"
+ src="https://marimo.app/github/marimo-team/gallery-examples/blob/main/notebooks/math/cellular-automaton-art.py/wasm?embed=true"
sandbox="allow-scripts allow-same-origin allow-downloads allow-popups"
allow="microphone"
allowfullscreen
@@ -124,7 +130,7 @@ Add `?embed=true` to an [interactive preview URL](#interactive-previews) to get
<div class="demo-container">
<iframe
- src="https://molab.marimo.io/github/marimo-team/gallery-examples/blob/main/notebooks/math/cellular-automaton-art.py/wasm?embed=true"
+ src="https://marimo.app/github/marimo-team/gallery-examples/blob/main/notebooks/math/cellular-automaton-art.py/wasm?embed=true"
class="demo large"
sandbox="allow-scripts allow-same-origin allow-downloads allow-popups"
allow="microphone"
@@ -139,40 +145,41 @@ Add `?embed=true` to an [interactive preview URL](#interactive-previews) to get
### Embed from source code
You can embed a notebook directly from its source code, without hosting it on
-GitHub. Compress your notebook code using
-[lz-string](https://www.npmjs.com/package/lz-string) and pass it as a URL
-hash:
+GitHub. Compress your notebook code using lz-string and pass it as a URL hash:
```
-https://molab.marimo.io/new/wasm/#code/{compressed}
+https://molab.marimo.io/new/wasm/?embed=true#code/{compressed}
```
-For example, in JavaScript:
+/// tab | JavaScript
```javascript
import { compressToEncodedURIComponent } from "lz-string";
-const url = `https://molab.marimo.io/new/wasm/#code/${compressToEncodedURIComponent(code)}`;
+const url = `https://molab.marimo.io/new/wasm/?embed=true#code/${compressToEncodedURIComponent(code)}`;
```
-Query parameters go before the hash:
+///
-```
-https://molab.marimo.io/new/wasm/?embed=true#code/{compressed}
-```
+/// tab | Python
-For small notebooks (under 14 KB), you can also use the `code` query parameter
-with URI encoding instead of lz-compression:
+```python
+import lzstring
+lz = lzstring.LZString()
+compressed = lz.compressToEncodedURIComponent(code)
+url = f"https://molab.marimo.io/new/wasm/?embed=true#code/{compressed}"
```
-https://molab.marimo.io/new/wasm/?embed=true&code={encodedURIComponent}
-```
+
+///
+
+For example:
/// tab | Code
```html
<iframe
- src="https://molab.marimo.io/new/wasm/?embed=true#code/MQAg9BIM4MYE4EsAOAXAUKOBTAjgVwWygFokBPFACwHsA7EAXhACIA+BgZgDoBGABmYYQAEyxIstUbRgIsURiADaQkKpYBbAIaJ11ZgBoVa5lpRIANtRTmEAIwNHVzWnnXkHoNS1jIyHkAC6QhBgaGgIbtRwKCBaOtRhAPqJAOYSWHCaKFjCiQDuCFQKzHxcAEylZYKaSEgKcRHUXACCtQAUaF4wUFCJAGYI5lgMzGB4UHBgljCa5mCJDbpgMOMo1Opc3VAOXpp4a4nC1Hm0lprCDIrMlCjq5swBhgCUYQVFNUhcUFgoeEgAXJ01BEkFEYotqCBNPJdEDVCCwSAXG4yFD5LQkHCQAjorEshYrDZbFxyASYtCQBZ0F4+nB1nizJZrHZNtRLHB5DiYgAZBC0LDaADKWBS6g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iY6qAuF3Smi0AWjmBWhtDKqRnQAiTQgoBkDiDGxnAoCVoJn8iLhzhhjMCYo1Azr8Ha6cgcnY716KmVSXpQ5qBCITH0A2baCihqptCmg4ZHYJ4VpcBdk9k1x8LCDdniA8mWxF4Cl0BV60qimTTiniYalSlurJbbn+R9D9kKmTzKllyqkSlvlSbakRLjBRJsExJmnyYulVyOjDnL4SAHxYDED4COiORzRXFIUiDrB8gYUlI9jBlFHxjTTbntnRkcyxm55Im0rYAmqVmNQQocx1mjS2gQUOhOj6mug1l3Rtnu4dnHnKinl9nUBZAE5ppaAMBkVaAKi6BjkTlIAhn8GXrQ7DizkFkqI46LlyDLkaxklqlbkMmYl0U5CHmdnCW9nnmXmOxhA+bJA9HJDtnMDJBaB8jJB+RJKKRRil4vBAA"
sandbox="allow-scripts allow-same-origin allow-downloads allow-popups"
allow="microphone"
allowfullscreen
@@ -187,7 +194,7 @@ https://molab.marimo.io/new/wasm/?embed=true&code={encodedURIComponent}
<div class="demo-container">
<iframe
- src="https://molab.marimo.io/new/wasm/?embed=true#code/MQAg9BIM4MYE4EsAOAXAUKOBTAjgVwWygFokBPFACwHsA7EAXhACIA+BgZgDoBGABmYYQAEyxIstUbRgIsURiADaQkKpYBbAIaJ11ZgBoVa5lpRIANtRTmEAIwNHVzWnnXkHoNS1jIyHkAC6QhBgaGgIbtRwKCBaOtRhAPqJAOYSWHCaKFjCiQDuCFQKzHxcAEylZYKaSEgKcRHUXACCtQAUaF4wUFCJAGYI5lgMzGB4UHBgljCa5mCJDbpgMOMo1Opc3VAOXpp4a4nC1Hm0lprCDIrMlCjq5swBhgCUYQVFNUhcUFgoeEgAXJ01BEkFEYotqCBNPJdEDVCCwSAXG4yFD5LQkHCQAjorEshYrDZbFxyASYtCQBZ0F4+nB1nizJZrHZNtRLHB5DiYgAZBC0LDaADKWBS6gk2WEAGE2VEtEh9CBeVAJdL2XKsbT6T5yFxJBFNGlsZFcTA6AA3NlmrAKlJ7HoITS0fqDbJwMJoAACH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SXpQ5qBCITH0A2baCihqptCmg4ZHYJ4VpcBdk9k1x8LCDdniA8mWxF4Cl0BV60qimTTiniYalSlurJbbn+R9D9kKmTzKllyqkSlvlSbakRLjBRJsExJmnyYulVyOjDnL4SAHxYDED4COiORzRXFIUiDrB8gYUlI9jBlFHxjTTbntnRkcyxm55Im0rYAmqVmNQQocx1mjS2gQUOhOj6mug1l3Rtnu4dnHnKinl9nUBZAE5ppaAMBkVaAKi6BjkTlIAhn8GXrQ7DizkFkqI46LlyDLkaxklqlbkMmYl0U5CHmdnCW9nnmXmOxhA+bJA9HJDtnMDJBaB8jJB+RJKKRRil4vBAA"
class="demo large"
sandbox="allow-scripts allow-same-origin allow-downloads allow-popups"
allow="microphone"
@@ -199,6 +206,20 @@ https://molab.marimo.io/new/wasm/?embed=true&code={encodedURIComponent}
///
+Query parameters go before the hash:
+
+```
+https://marimo.app/?embed=true#code/{compressed}
+```
+
+For small notebooks (under 14 KB), you can also use the `code` query parameter
+with URI encoding instead of lz-compression:
+
+```
+https://marimo.app/new/wasm/?embed=true&code={encodedURIComponent}
+```
+
+
### Embed an empty editable notebook
Use this recipe to embed an empty editable notebook:
@@ -207,7 +228,7 @@ Use this recipe to embed an empty editable notebook:
```html
<iframe
- src="https://molab.marimo.io/new/wasm/?embed=true&mode=edit#code/JYWwDg9gTgLgBCAhlUEBQaD6mDmBTAOzykRjwBNMB3YGACzgF44AiAVwIGsCIqCW0iMGCYJkqAHQBBYQAoAlBjQABIWAkBjPABttacngBmcTAoBcaOFbhQ8MNlAJLgx7AUQg82JsxbYkwATYLBbWcGoSUBwKaEA"
+ src="https://marimo.app/?embed=true#code/JYWwDg9gTgLgBCAhlUEBQaD6mDmBTAOzykRjwBNMB3YGACzgF44AiAVwIGsCIqCW0iMGCYJkqAHQBBYQAoAlBjQABIWAkBjPABttacngBmcTAoBcaOFbhQ8MNlAJLgx7AUQg82JsxbYkwATYLBbWcGoSUBwKaEA"
sandbox="allow-scripts allow-same-origin allow-downloads allow-popups"
allow="microphone"
allowfullscreen
@@ -222,7 +243,7 @@ Use this recipe to embed an empty editable notebook:
<div class="demo-container">
<iframe
- src="https://molab.marimo.io/new/wasm/?embed=true&mode=edit#code/JYWwDg9gTgLgBCAhlUEBQaD6mDmBTAOzykRjwBNMB3YGACzgF44AiAVwIGsCIqCW0iMGCYJkqAHQBBYQAoAlBjQABIWAkBjPABttacngBmcTAoBcaOFbhQ8MNlAJLgx7AUQg82JsxbYkwATYLBbWcGoSUBwKaEA"
+ src="https://marimo.app/?embed=true#code/JYWwDg9gTgLgBCAhlUEBQaD6mDmBTAOzykRjwBNMB3YGACzgF44AiAVwIGsCIqCW0iMGCYJkqAHQBBYQAoAlBjQABIWAkBjPABttacngBmcTAoBcaOFbhQ8MNlAJLgx7AUQg82JsxbYkwATYLBbWcGoSUBwKaEA"
class="demo large"
sandbox="allow-scripts allow-same-origin allow-downloads allow-popups"
allow="microphone"
diff --git a/docs/guides/publishing/cloudflare.md b/docs/guides/publishing/cloudflare.md
index 571cf960a3..319a7685e7 100644
--- a/docs/guides/publishing/cloudflare.md
+++ b/docs/guides/publishing/cloudflare.md
@@ -23,7 +23,7 @@ marimo export html-wasm notebook.py -o output_dir --mode edit --include-cloudfla
///
-See our [exporting guide](../exporting.md#export-to-wasm-powered-html) for
+See our [exporting guide](../exporting/webassembly_html.md) for
the full documentation.
## Publish to a Cloudflare Worker
diff --git a/docs/guides/publishing/deploy.md b/docs/guides/publishing/deploy.md
deleted file mode 100644
index e974eae2cd..0000000000
--- a/docs/guides/publishing/deploy.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Deploy on backends
-
-If you cannot use WebAssembly notebooks, you can deploy marimo notebooks via a
-traditional client-server model.
-
-Both the edit server can be deployed as well as individual notebooks (as
-readonly apps).
-
-Learn more in our [Deployment Guide](../deploying/index.md).
diff --git a/docs/guides/publishing/embedding.md b/docs/guides/publishing/embedding.md
index a15e91f175..40c07350a7 100644
--- a/docs/guides/publishing/embedding.md
+++ b/docs/guides/publishing/embedding.md
@@ -1,26 +1,71 @@
-# Embedding
+# Embed in other webpages
-There are various ways to embed marimo notebooks in other web pages, such
-as web documentation, educational platforms, or static sites in general. Here
-are the main approaches:
+There are various ways to embed marimo notebooks in other webpages, such
+as web documentation, educational platforms, or static sites in general.
-* Host on [GitHub Pages](github_pages.md) or [self-host WASM HTML](self_host_wasm.md),
- and `<iframe>` the published notebook.
-* `<iframe>` a [playground](playground.md) notebook, and [customize the embedding](playground.md#embedding-in-other-web-pages) with query params.
- (This is what we do throughout https://docs.marimo.io.)
-* Use the [marimo snippets](from_code_snippets.md) plugin to replace code snippets in HTML or markdown with interactive notebooks.
+## molab (recommended)
-## Iframe Sandbox Configuration
+The easiest way to embed interactive notebooks is with [molab](../molab.md).
+Click the "Share" button on molab WebAssembly previews of [notebooks from
+GitHub](../molab.md/#preview-notebooks-from-github) to get an iframe snippet
+you can copy into your own webpages; or, construct embeddable URLs
+[from notebook source code](../molab.md#embed-from-source-code). This is what
+we do throughout this documentation website.
+
+See the [molab embedding docs](../molab.md#embed-in-other-webpages) for a
+complete walkthrough, and the below for a a simple example.
+
+/// tab | Code
+
+```html
+<iframe
+ src="https://marimo.app/github/marimo-team/gallery-examples/blob/main/notebooks/math/cellular-automaton-art.py/wasm?embed=true"
+ sandbox="allow-scripts allow-same-origin allow-downloads allow-popups"
+ allow="microphone"
+ allowfullscreen
+ loading="lazy"
+>
+</iframe>
+```
+
+///
+
+/// tab | Live Example
+
+<div class="demo-container">
+ <iframe
+ src="https://marimo.app/github/marimo-team/gallery-examples/blob/main/notebooks/math/cellular-automaton-art.py/wasm?embed=true"
+ class="demo large"
+ sandbox="allow-scripts allow-same-origin allow-downloads allow-popups"
+ allow="microphone"
+ allowfullscreen
+ loading="lazy"
+ >
+ </iframe>
+</div>
+
+///
+
+
+## Self-hosted options
+
+If you need to self-host, you can also embed notebooks by:
+
+* Hosting on [GitHub Pages](github.md#publish-to-github-pages) or [self-hosting WASM HTML](self_host_wasm.md),
+ and iframing the published notebook.
+* Using [marimo islands](../exporting/webassembly_html.md#embed-marimo-outputs-in-html-using-islands) to embed individual cell outputs directly in your HTML pages.
+
+## Iframe sandbox configuration
When embedding marimo notebooks in sandboxed iframes, proper configuration is essential for full functionality. marimo is designed to gracefully degrade when certain features are restricted, but understanding these requirements will help you provide the best experience.
-### Required Sandbox Attributes
+### Required sandbox attributes
For marimo to function properly in an iframe, you need this **minimum** sandbox attribute:
```html
<iframe
- src="https://marimo.app/your-notebook"
+ src="https://marimo.app/github/marimo-team/gallery-examples/blob/main/notebooks/math/cellular-automaton-art.py/wasm"
sandbox="allow-scripts"
width="100%"
height="600"
@@ -32,13 +77,13 @@ For marimo to function properly in an iframe, you need this **minimum** sandbox
!!! note "Basic Functionality"
With only `allow-scripts`, marimo will work but with limitations: WebSocket connections will function, but storage will be in-memory only (state resets on page reload), and clipboard access will use browser prompts instead of the clipboard API.
-### Recommended Sandbox Attributes
+### Recommended sandbox attributes
For the best user experience, include these additional attributes:
```html
<iframe
- src="https://marimo.app/your-notebook"
+ src="https://marimo.app/github/marimo-team/gallery-examples/blob/main/notebooks/math/cellular-automaton-art.py/wasm"
sandbox="allow-scripts allow-same-origin allow-downloads allow-popups"
allow="microphone"
allowfullscreen
@@ -61,13 +106,13 @@ For the best user experience, include these additional attributes:
!!! tip "Security Considerations"
Only use `allow-same-origin` with trusted content or the iframe URL is hosted on a different domain. Combining `allow-scripts` and `allow-same-origin` allows the iframe to remove the sandbox attribute entirely, making the iframe as powerful as if it weren't sandboxed at all.
-### Example: Full Configuration
+### Full example
-Here's a complete example with all recommended settings:
+A complete, copy-pasteable example with all recommended settings:
```html
<iframe
- src="https://marimo.app/l/your-notebook-id?embed=true&mode=read"
+ src="https://marimo.app/github/marimo-team/gallery-examples/blob/main/notebooks/math/cellular-automaton-art.py/wasm?embed=true&mode=read"
sandbox="allow-scripts allow-same-origin allow-downloads allow-popups allow-downloads-without-user-activation"
allow="microphone"
allowfullscreen
diff --git a/docs/guides/publishing/from_code_snippets.md b/docs/guides/publishing/from_code_snippets.md
deleted file mode 100644
index d816ccc28e..0000000000
--- a/docs/guides/publishing/from_code_snippets.md
+++ /dev/null
@@ -1,76 +0,0 @@
-# Publish using `marimo-snippets`
-
-[`marimo-snippets`](https://github.com/marimo-team/marimo-snippets) is a
-single-file JavaScript utility that lets you embed interactive marimo notebooks
-in static web pages, powered by WebAssembly.
-
-Simply wrap code elements in a custom tag, and `marimo-snippets` does the rest;
-`marimo-snippets` is even compatible with MkDocs-processed markdown!
-
-Here's a demo:
-
-````md
-<div>
-<marimo-iframe>
-```python
-import marimo as mo
-```
-```python
-slider = mo.ui.slider(1, 10)
-slider
-```
-
-```python
-slider.value * "🍃"
-```
-</marimo-iframe>
-</div>
-
-<script src="https://cdn.jsdelivr.net/npm/@marimo-team/marimo-snippets@1"></script>
-````
-
-This embeds an iframe on your page with an interactive slider, like the one below.
-Fun fact: this page is itself using `marimo-snippets`!
-
-<div>
-<marimo-iframe>
-```python
-import marimo as mo
-```
-```python
-slider = mo.ui.slider(1, 10)
-slider
-```
-
-```python
-slider.value * "🍃"
-```
-</marimo-iframe>
-</div>
-
-<script src="https://cdn.jsdelivr.net/npm/@marimo-team/marimo-snippets@1"></script>
-
-## Configuration
-
-To configure the rendering behavior globally, you can include script elements *before* the marimo snippets script.
-
-```html
-<!-- Optionally configure how buttons and iframes are rendered. -->
-<!-- Configuration must come _before_ the main extractor script is loaded. -->
-<script type="text/x-marimo-snippets-config">
-configureMarimoButtons({title: "Open in a marimo notebook"});
-configureMarimoIframes({height: "400px"});
-</script>
-
-<script src="https://cdn.jsdelivr.net/npm/@marimo-team/marimo-snippets@1"></script>
-```
-
-You can also configure data attributes per-element.
-
-```html
-<marimo-iframe data-height="600px" data-show-code="false">
-...
-</marimo-iframe>
-```
-
-See the [GitHub repository](https://github.com/marimo-team/marimo-snippets) for a full example and [documentation on configuration](https://github.com/marimo-team/marimo-snippets?tab=readme-ov-file#configuration).
diff --git a/docs/guides/publishing/from_github.md b/docs/guides/publishing/from_github.md
deleted file mode 100644
index 7fa0820726..0000000000
--- a/docs/guides/publishing/from_github.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# From GitHub
-
-marimo makes it very easy to share links to executable notebooks from notebooks
-hosted on GitHub. Unlike Google Colab, marimo also automatically synchronizes
-data stored in your GitHub repo to the notebook's filesystem, making it
-easy to bundle data with your notebooks.
-
-
-- [Share molab links](https://molab.marimo.io/github) to notebooks hosted on GitHub
-- Publish notebooks to [GitHub Pages](github_pages.md)
-- Edit notebooks on the [marimo playground](playground.md), with public link-based sharing
- (no login required!)
diff --git a/docs/guides/publishing/github_pages.md b/docs/guides/publishing/github.md
similarity index 56%
rename from docs/guides/publishing/github_pages.md
rename to docs/guides/publishing/github.md
index d5ec72dd1e..51a1a147d6 100644
--- a/docs/guides/publishing/github_pages.md
+++ b/docs/guides/publishing/github.md
@@ -1,9 +1,41 @@
-# Publish to GitHub Pages
+# GitHub
+
+marimo makes it very easy to share links to executable notebooks from notebooks
+hosted on GitHub.
+
+- [Share molab links](../molab.md#preview-notebooks-from-github) to obtain interactive previews of notebooks hosted on GitHub, no login required
+- Publish notebooks to [GitHub Pages](#publish-to-github-pages)
+
+## Export to ipynb to view on GitHub
+
+marimo notebooks are stored as pure Python files, which works well with Git
+versioning and the broader Python ecosystem. However, this means you cannot
+preview outputs directly on GitHub like you can with Jupyter notebooks.
+
+To make outputs viewable on GitHub, you can configure marimo to automatically
+snapshot outputs to an `ipynb` file. We treat the ipynb as an artifact that
+combines your source code with rendered outputs. The snapshot is saved to a
+`__marimo__` directory alongside your notebook, which you can commit and push
+to GitHub.
+
+Enable snapshotting in the notebook settings menu via the gear icon in the top
+right corner:
+
+<picture>
+ <source srcset="/_static/docs-notebook-settings-snapshotting.webp" type="image/webp">
+ <img src="/_static/docs-notebook-settings-snapshotting.jpg" alt="Notebook settings dialog showing the Exporting outputs section with HTML and ipynb checkboxes" style="max-width: 700px; width: 100%;" />
+</picture>
+
+This feature requires `nbformat`. marimo will prompt to install it if missing, or you can add it to your environment with `pip install nbformat`.
+
+## Publish to GitHub Pages
+
+> For a simpler solution, use [molab's built in GitHub previewer](../molab.md#preview-notebooks-from-github)
You can publish executable notebooks to [GitHub Pages](https://pages.github.com/)
for free, after exporting your notebook to a WebAssembly notebook.
-## Export to WASM-powered HTML
+### Export to WASM-powered HTML
Export your notebook to a self-contained HTML file that runs using [WebAssembly](../wasm.md):
@@ -23,10 +55,10 @@ marimo export html-wasm notebook.py -o output_dir --mode edit
///
-See our [exporting guide](../exporting.md#export-to-wasm-powered-html) for
+See our [exporting guide](../exporting/webassembly_html.md) for
the full documentation.
-## Publish using GitHub Actions
+### Publish using GitHub Actions
/// tip | Template repository
@@ -73,7 +105,7 @@ jobs:
artifact_name: github-pages
```
-## Publish manually
+### Publish manually
You can also publish an exported notebook manually through your repository
settings. Read [GitHub's documentation](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site) to learn more.
diff --git a/docs/guides/publishing/index.md b/docs/guides/publishing/index.md
index 19c17a9c59..58c056dc52 100644
--- a/docs/guides/publishing/index.md
+++ b/docs/guides/publishing/index.md
@@ -1,31 +1,29 @@
-# Publishing notebooks to the web
+# Publish to the web
-You can publish marimo notebooks to the web as interactive editable notebooks,
-readonly web apps, or [static documents](../exporting.md). Thanks to
-[WebAssembly](../wasm.md), you can even share executable notebooks on GitHub
-Pages or other static sites without paying for backend infrastrcture. This
-makes it easy to share your work with colleagues, embed executable notebooks in
-web documentation or educational websites, and more.
+You can publish [exported](../exporting/index.md) marimo notebooks to the web.
-This guide provides an overview of the various ways to publish marimo notebooks.
+## molab (recommended)
-!!! tip "Share cloud-hosted notebooks with molab"
+The easiest way to publish and share interactive notebooks is with
+[molab](https://molab.marimo.io/notebooks), our free cloud-hosted notebook environment.
+With molab, you can:
- For a turn-key sharing experience, use [molab](https://molab.marimo.io/notebooks),
- our free cloud-hosted marimo notebook
+- Share notebooks by links
+- [Preview notebooks from GitHub](../molab.md#preview-notebooks-from-github) with full interactivity
+- Share [open-in-molab badges](../molab.md#share-open-in-molab-badges) in READMEs and docs
+- [Embed interactive notebooks](../molab.md#embed-in-other-webpages) in your own webpages
+- Contribute to our [public gallery](public_gallery.md)
+## Self-hosted options
+
+If you need to self-host exported notebooks, the following guides cover publishing with
+[WebAssembly](../wasm.md) — no backend infrastructure required.
| Guide | Description |
| ----------------------------------------------------- | ------------------------------------------------------------ |
-| [Embedding](embedding.md) | An overview of embedding notebooks in other sites |
-| [From GitHub](from_github.md) | Share links to executable notebooks hosted on GitHub |
-| [From code snippets](from_code_snippets.md) | Convert code snippets in Markdown or HTML to interactive notebooks |
-| [GitHub Pages](github_pages.md) | Publish interactive notebooks on GitHub Pages |
+| [GitHub](github.md) | Share from GitHub, view outputs, publish to GitHub Pages |
+| [Embed in other webpages](embedding.md) | Embed notebooks in other sites via iframes or islands |
| [Cloudflare](cloudflare.md) | Publish interactive notebooks on Cloudflare |
| [Self-host WebAssembly notebooks](self_host_wasm.md) | Self-hosting interactive WebAssembly (HTML export) notebooks |
-| [Online playground](playground.md) | Share links to notebooks using our online playground |
-| [View notebooks on GitHub](view_outputs_on_github.md) | Viewing notebook outputs on GitHub |
| [OpenGraph previews](opengraph.md) | Configure titles, descriptions, and thumbnails for link previews |
| [Thumbnails](thumbnails.md) | Generate thumbnail images for OpenGraph previews and galleries |
-| [Deploy on a backend](deploy.md) | Deploying notebooks on backends |
-| [With Quarto](quarto.md) | Publish reactive websites with Quarto from markdown |
diff --git a/docs/guides/publishing/mkdocs.md b/docs/guides/publishing/mkdocs.md
index dbccca31d8..2697b4ed6a 100644
--- a/docs/guides/publishing/mkdocs.md
+++ b/docs/guides/publishing/mkdocs.md
@@ -7,4 +7,4 @@ You can use MkDocs to publish your marimo notebooks as a interactive website wit
!!! tip "Try the markdown file format tutorial"
Learn more with `marimo tutorial markdown-format` at the command line.
-Alternatively, see our [Quarto guide](quarto.md) for other methods of publishing marimo's markdown format.
+Alternatively, see our [Quarto guide](../exporting/quarto.md) for other methods of publishing marimo's markdown format.
diff --git a/docs/guides/publishing/public_gallery.md b/docs/guides/publishing/public_gallery.md
new file mode 100644
index 0000000000..fb480e1b3f
--- /dev/null
+++ b/docs/guides/publishing/public_gallery.md
@@ -0,0 +1,14 @@
+# Publish notebooks to the marimo gallery
+
+The [marimo gallery](https://marimo.io/gallery) showcases the best notebooks
+from our team and community. To be considered for inclusion, share your
+[molab](../molab.md) notebook and tag us on
+[Twitter / X](https://twitter.com/marimo_io),
+[Bluesky](https://bsky.app/profile/marimo.io),
+[LinkedIn](https://www.linkedin.com/company/marimo-io), or
+[Reddit](https://reddit.com/r/marimo_notebook).
+Community authors are credited with a link back to their website.
+
+<figure>
+ <img src="/_static/docs-gallery.png" alt="The marimo gallery" />
+</figure>
diff --git a/docs/guides/publishing/self_host_wasm.md b/docs/guides/publishing/self_host_wasm.md
index b2efdaec65..e8621a4caa 100644
--- a/docs/guides/publishing/self_host_wasm.md
+++ b/docs/guides/publishing/self_host_wasm.md
@@ -1,9 +1,9 @@
# Self-host WebAssembly notebooks
-As an alternative to [GitHub Pages](github_pages.md), it is possible to self-host
+As an alternative to [GitHub Pages](github.md#publish-to-github-pages), it is possible to self-host
exported [WebAssembly notebooks](../wasm.md):
-- [Export to WASM HTML](../exporting.md#export-to-wasm-powered-html).
+- [Export to WASM HTML](../exporting/webassembly_html.md).
- Serve the exported file over HTTP.
- Serve the assets in the `assets` directory, next to the HTML file.
- Possibly configure your web server to support serving `application/wasm/`
diff --git a/docs/guides/publishing/view_outputs_on_github.md b/docs/guides/publishing/view_outputs_on_github.md
deleted file mode 100644
index 161c6f9fe4..0000000000
--- a/docs/guides/publishing/view_outputs_on_github.md
+++ /dev/null
@@ -1,21 +0,0 @@
-# View Outputs on GitHub
-
-marimo notebooks are stored as pure Python files, which works well with Git
-versioning and the broader Python ecosystem. However, this means you cannot
-preview outputs directly on GitHub like you can with Jupyter notebooks.
-
-To make outputs viewable on GitHub, you can configure marimo to automatically
-snapshot outputs to an `ipynb` file. We treat the ipynb as an artifact that
-combines your source code with rendered outputs. The snapshot is saved to a
-`__marimo__` directory alongside your notebook, which you can commit and push
-to GitHub.
-
-Enable snapshotting in the notebook settings menu via the gear icon in the top
-right corner:
-
-<picture>
- <source srcset="/_static/docs-notebook-settings-snapshotting.webp" type="image/webp">
- <img src="/_static/docs-notebook-settings-snapshotting.jpg" alt="Notebook settings dialog showing the Exporting outputs section with HTML and ipynb checkboxes" style="max-width: 700px; width: 100%;" />
-</picture>
-
-This feature requires `nbformat`. marimo will prompt to install it if missing, or you can add it to your environment with `pip install nbformat`.
diff --git a/docs/guides/scripts.md b/docs/guides/scripts.md
index 761565eeb1..996cab4626 100644
--- a/docs/guides/scripts.md
+++ b/docs/guides/scripts.md
@@ -11,6 +11,16 @@ Running a notebook as a script is useful when your notebook has side-effects,
like writing to disk. Print statements and other console outputs will show
up in your terminal.
+marimo ntoebooks can also [double as importable modules, providing libraries
+of functions and classes that you can reuse in other programs:
+
+```python
+from my_notebook import my_function
+```
+
+Read our guide on [reusable functions](reusing_functions.md) for details.
+
+
!!! tip "Check before running"
Before running a notebook as a script, you can use marimo's linter to check for issues that might prevent execution:
@@ -66,3 +76,36 @@ running as a notebook.
/// marimo-embed-file
filepath: examples/running_as_a_script/with_simple_parsing.py
///
+
+
+## Example: scheduled execution
+
+marimo notebooks are Python files, so any scheduler that runs Python scripts
+can run marimo notebooks. This includes
+[cron](https://en.wikipedia.org/wiki/Cron),
+[Airflow](https://airflow.apache.org/), [Prefect](https://www.prefect.io/),
+and other tools. You can pass variables from the command line and [reuse
+functions](reusing_functions.md) from notebooks in other jobs as well.
+
+### GitHub Action
+
+Run notebooks on a schedule with [GitHub Actions](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule). This example assumes [inline dependencies](package_management/inlining_dependencies.md):
+
+```yaml
+name: Run marimo notebook daily
+
+on:
+ schedule:
+ - cron: '0 9 * * *'
+
+jobs:
+ run-marimo:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ with:
+ python-version: '3.12'
+ - uses: astral-sh/setup-uv@v7
+ - run: uv run path/to/notebook.py
+```
diff --git a/docs/guides/wasm.md b/docs/guides/wasm.md
index eb7664be44..113aa0a253 100644
--- a/docs/guides/wasm.md
+++ b/docs/guides/wasm.md
@@ -14,11 +14,10 @@ for short.
like Claude Code, you can use our [official skills](generate_with_ai/skills.md)
to automatically check for WebAssembly compatibility of your notebooks.
-!!! tip "Try our online playground"
-
- To create your first WASM notebook, try our online playground
- at [marimo.new](https://marimo.new). Read the [playground
- docs](publishing/playground.md) to learn more.
+!!! tip "Sharing interactive previews of GitHub notebooks"
+ Read the [molab docs](molab.md) to learn how to share WebAssembly previews
+ of notebooks hosted on GitHub, and how to embed WebAssembly notebooks in other
+ webpages such as documentation.
WASM notebooks have three benefits compared to notebooks hosted using a
traditional client-server model. WASM notebooks:
@@ -33,11 +32,21 @@ traditional client-server model. WASM notebooks:
with code and models, doing lightweight data exploration, authoring blog
posts, tutorials, and educational materials, and even building tools. For
notebooks that do heavy computation, [use marimo
- locally](../getting_started/index.md) or on a backend.
+ ](../getting_started/index.md) on your own machine/server or on [molab](https://molab.marimo.io/notebooks).
**Try it!** Try editing the below notebook (your browser, not a backend server, is executing it!)
-<iframe src="https://marimo.app/l/upciwv?embed=true" width="100%" height=400 frameBorder="0"></iframe>
+/// marimo-embed
+ size: large
+
+```python
+async def __():
+ return
+```
+
+///
+
_This feature is powered by [Pyodide](https://pyodide.org), a port
of Python to WebAssembly that enables browsers to run Python code._
@@ -46,28 +55,25 @@ of Python to WebAssembly that enables browsers to run Python code._
marimo provides three ways to create and share WASM notebooks:
-1. [Export to WASM HTML](exporting.md#export-to-wasm-powered-html),
- which you can host on GitHub Pages or self-host. This is great for
- publishing companion notebooks for research papers that are automatically
- updated on Git push, or for embedding interactive notebooks as part of other
- websites.
-2. The [online playground](publishing/playground.md), which lets you
- create one-off notebooks and share via links, no login required. The
- playground is also great for embedding editable notebooks in
- documentation.
-3. The [Community Cloud](publishing/community_cloud/index.md), which
- lets you save a collection of notebook to a workspace (for free!) and share
- publicly or privately with sensible URLs.
-
-### From GitHub
+1. [molab](molab.md). Our free cloud-hosted marimo notebook service.
+ Append `/wasm` to [GitHub previews](molab.md#preview-notebooks-from-github) to create interactive previews
+ of notebooks hosted on GitHub. molab also allows embedding WebAssembly notebooks in
+ other [webpages](publishing/embedding.md) (we do this throughout these docs).
+2. [Export to WASM HTML](exporting/webassembly_html.md),
+ which you can host on GitHub Pages or self-host. You can also use [a
+GitHub action](publishing/github.md#publish-using-github-actions).
+3. Try our ephemeral [WebAssembly playground](https://marimo.app);
+unlike molab, notebooks created at the playground are not saved.
-marimo provides three ways to share notebooks stored on GitHub as WASM notebooks:
+## Packages
-1. Automatically publish to GitHub Pages on git push with [our GitHub action](publishing/github_pages.md).
-2. Load a notebook by URL into the online playground (New > Open from URL ...)
-3. Load a notebook from GitHub in the [Community Cloud](publishing/community_cloud/index.md).
+!!! tip "Use `--sandbox` for seamless package installation"
-## Packages
+ If you're developing notebooks locally that you plan to share as WASM
+ notebooks, create them with `marimo edit --sandbox notebook.py`. This
+ inlines your package dependencies into the notebook file, ensuring they
+ are seamlessly installed in our WebAssembly environment. See
+ [package management](editor_features/package_management.md) for more details.
!!! tip "Rendering performance"
@@ -109,7 +115,7 @@ If you want a package to be supported, consider [filing an issue](https://github
**For notebooks exported to WASM HTML.**
To include data files in notebooks [exported to WASM
-HTML](exporting.md#export-to-wasm-powered-html), place them
+HTML](exporting/webassembly_html.md), place them
in a `public/` folder in the same directory as your notebook. When you
export to WASM HTML, the public folder will be copied to the export directory.
@@ -133,14 +139,26 @@ hosted, you may need to use a CORS Proxy; see the [Pyodide
documentation](https://pyodide.org/en/stable/usage/loading-packages.html#installing-wheels-from-arbitrary-urls)
for more details.
-**Playground notebooks.** When opening a playground
-notebook from GitHub, all the files in the GitHub repo are made available to
-your notebook. See the [Playground
-Guide](publishing/playground.md#including-data-files) for more info.
+**molab notebooks.** When opening a notebook from GitHub on [molab](molab.md),
+all the files in the GitHub repo are made available to your notebook.
+
+## Detecting WebAssembly
+
+To check if your notebook is running in a WebAssembly environment, use:
+
+```python
+import sys
+
+if "pyodide" in sys.modules:
+ # Running in WebAssembly
+ ...
+else:
+ # Running locally
+ ...
+```
-**Community Cloud notebooks.** Our free [Community
-Cloud](publishing/community_cloud/index.md) lets you upload a limited
-amount of data, and also lets you sync notebooks (and their data) from GitHub.
+This is useful for branching logic, such as using `micropip` for package
+installation in WASM while using standard imports locally.
## Limitations
diff --git a/docs/pyproject.toml b/docs/pyproject.toml
index 88676b2f9c..3a5d39680a 100644
--- a/docs/pyproject.toml
+++ b/docs/pyproject.toml
@@ -3,7 +3,7 @@ build-backend = "hatchling.build"
requires = ["hatchling"]
[project]
-dependencies = []
+dependencies = ["lzstring>=1.0.4"]
name = "marimo_docs"
version = "0.1.0"
diff --git a/docs/vercel.json b/docs/vercel.json
index 42c768c45d..5e857419ec 100644
--- a/docs/vercel.json
+++ b/docs/vercel.json
@@ -462,7 +462,7 @@
},
{
"source": "/guides/deploying/deploying_public_gallery.html",
- "destination": "/guides/deploying/deploying_public_gallery/",
+ "destination": "/guides/publishing/public_gallery/",
"permanent": true
},
{
@@ -635,6 +635,51 @@
"destination": "/recipes/",
"permanent": true
},
+ {
+ "source": "/guides/publishing/from_code_snippets/",
+ "destination": "/guides/publishing/embedding/",
+ "permanent": true
+ },
+ {
+ "source": "/guides/publishing/from_github/",
+ "destination": "/guides/publishing/github/",
+ "permanent": true
+ },
+ {
+ "source": "/guides/publishing/view_outputs_on_github/",
+ "destination": "/guides/publishing/github/",
+ "permanent": true
+ },
+ {
+ "source": "/guides/publishing/github_pages/",
+ "destination": "/guides/publishing/github/",
+ "permanent": true
+ },
+ {
+ "source": "/guides/deploying/deploying_public_gallery/",
+ "destination": "/guides/publishing/public_gallery/",
+ "permanent": true
+ },
+ {
+ "source": "/guides/publishing/quarto/",
+ "destination": "/guides/exporting/quarto/",
+ "permanent": true
+ },
+ {
+ "source": "/guides/publishing/deploy/",
+ "destination": "/guides/deploying/",
+ "permanent": true
+ },
+ {
+ "source": "/guides/deploying/scheduled/",
+ "destination": "/guides/scripts/",
+ "permanent": true
+ },
+ {
+ "source": "/guides/publishing/playground/",
+ "destination": "/guides/wasm/",
+ "permanent": true
+ },
{
"source": "/:path*.html",
"destination": "/:path*/",
diff --git a/mkdocs.yml b/mkdocs.yml
index e5de7db238..f47f171758 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -134,37 +134,41 @@ nav:
- Run notebooks as scripts: guides/scripts.md
- Reuse functions and classes: guides/reusing_functions.md
- Run in the cloud with molab: guides/molab.md
- - Export to other formats: guides/exporting.md
+ - Export to other formats:
+ - Export to other formats: guides/exporting/index.md
+ - Static HTML: guides/exporting/static_html.md
+ - PDF: guides/exporting/pdf.md
+ - Jupyter notebook: guides/exporting/jupyter_notebook.md
+ - Quarto: guides/exporting/quarto.md
+ - Python script: guides/exporting/python_script.md
+ - Markdown: guides/exporting/markdown.md
+ - WebAssembly HTML: guides/exporting/webassembly_html.md
+ - Session snapshots: guides/exporting/sessions.md
- Publish to the web:
- Publish to the web: guides/publishing/index.md
- - Embedding:
- - Embedding: guides/publishing/embedding.md
- - From code snippets: guides/publishing/from_code_snippets.md
- - From GitHub: guides/publishing/from_github.md
+ - molab (recommended): guides/molab.md
+ - Public gallery: guides/publishing/public_gallery.md
+ - GitHub: guides/publishing/github.md
+ - Embed in other webpages: guides/publishing/embedding.md
+ - Cloudflare: guides/publishing/cloudflare.md
+ - Self-host WebAssembly notebooks: guides/publishing/self_host_wasm.md
- OpenGraph previews: guides/publishing/opengraph.md
- Thumbnails: guides/publishing/thumbnails.md
- - Static sites:
- - GitHub Pages: guides/publishing/github_pages.md
- - Cloudflare: guides/publishing/cloudflare.md
- - Quarto: guides/publishing/quarto.md
- - Self-host WebAssembly notebooks: guides/publishing/self_host_wasm.md
- - Share playground notebooks: guides/publishing/playground.md
- - View outputs on GitHub: guides/publishing/view_outputs_on_github.md
- - Deploy a backend: guides/publishing/deploy.md
- - Deployment:
+ - Deploy notebook servers or apps:
- Deploy notebooks: guides/deploying/index.md
- - Authentication: guides/deploying/authentication.md
- - Docker: guides/deploying/deploying_docker.md
- - Kubernetes: guides/deploying/deploying_kubernetes.md
- - SkyPilot: guides/deploying/deploying_skypilot.md
- - Slurm: guides/deploying/deploying_slurm.md
- - HuggingFace: guides/deploying/deploying_hugging_face.md
- - Public gallery: guides/deploying/deploying_public_gallery.md
- - Railway: guides/deploying/deploying_railway.md
- - nginx: guides/deploying/deploying_nginx.md
- Prebuilt containers: guides/deploying/prebuilt_containers.md
- - Programmatic: guides/deploying/programmatically.md
- - Scheduled jobs: guides/deploying/scheduled.md
+ - Notebook servers:
+ - JupyterHub: guides/deploying/jupyterhub.md
+ - Kubernetes: guides/deploying/deploying_kubernetes.md
+ - SkyPilot: guides/deploying/deploying_skypilot.md
+ - Slurm: guides/deploying/deploying_slurm.md
+ - Apps:
+ - FastAPI: guides/deploying/programmatically.md
+ - Authentication: guides/deploying/authentication.md
+ - Docker: guides/deploying/deploying_docker.md
+ - HuggingFace: guides/deploying/deploying_hugging_face.md
+ - Railway: guides/deploying/deploying_railway.md
+ - nginx: guides/deploying/deploying_nginx.md
- WebAssembly notebooks: guides/wasm.md
- Configuration:
- Configuration: guides/configuration/index.md
diff --git a/pyproject.toml b/pyproject.toml
index 572bd42c6c..eb6ea048b8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -323,6 +323,7 @@ dependencies = [
"cairosvg>=2.7.1", # for social cards
"mdx-include>=1.4.2",
"pymdown-extensions>=10.7",
+ "lzstring>=1.0.4",
]
[tool.uv.sources]