Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Page configuration

Use one {marimo-config} directive to set defaults for every marimo cell on a page:

```{marimo-config}
:header: |
  import marimo as mo
:echo: true
:output: true
```

Cell options override page defaults.

OptionTypeDefaultBehavior
:eval:booleantrueExecute cells during the build
:echo:booleanfalseRender cell source
:editor:booleanfalseRender a marimo editor
:output:booleantrueRender browser output
:server-output:booleantrueInclude the build-time HTML preview
:error:booleantrueRender marimo error output
:include:booleantrueProject a visible node for the cell
:header:stringemptyExecute shared Python setup before page cells
:pyproject:stringemptyResolve a page-local Python environment
:external-env:booleanfalseUse the Jupyter Book Python environment

Header code

header joins the page app as a hidden setup cell. Page cells can read names it defines. The browser receives the same setup source so reactive execution has the same graph as the build.

```{marimo-config}
:header: |
  import marimo as mo
  from pathlib import Path
```

Page-local dependencies

Set pyproject to PEP 723-compatible TOML:

```{marimo-config}
:pyproject: |
  requires-python = ">=3.10"
  dependencies = [
      "pandas",
  ]
```

The plugin runs that page with uv and marimo>=0.23.16. Dependency resolution changes the Python environment. It does not restrict filesystem, process, or network access.

Use :external-env: true when the page imports packages already installed beside Jupyter Book:

```{marimo-config}
:external-env: true
```

pyproject and external-env select different execution environments, so one config cannot combine them.