Skip to content

quarto-marimo

Make Quarto documents reactive with marimo.

Quarto turns Markdown into websites, books, presentations, and other publication formats. quarto-marimo adds reactive Python, SQL, and Markdown cells to those publications.

The extension compiles each document's .marimo cells into one marimo app. Quarto places each result at its authored position and publishes the surrounding document.

Requires Quarto 1.9.20 or newer, Python 3.10 or newer, and marimo 0.23.16 or newer.

Quick start

Install uv and Quarto, then add the extension:

quarto add marimo-team/quarto-marimo

Create index.qmd:

---
title: Reactive Quarto page
engine: marimo
format: html
---

```python {.marimo}
import marimo as mo

slider = mo.ui.slider(1, 10, 1, label="Items")
slider
```

The next cell reacts to the same shared app:

```python {.marimo}
mo.md(f"The slider is set to **{slider.value}**.")
```

Preview the document:

quarto preview

HTML output remains interactive in the browser. Formats such as PDF receive the server-rendered cell output.

Cell options

Use Quarto #| options at the start of a marimo cell:

Both python {.marimo} and {python .marimo} fence forms are supported.

```python {.marimo}
#| echo: true
#| output: true

value = 2
value
```
Option Default Behavior
eval true Execute the cell
echo false Render the authored source
output true Render the cell output
server-output true Include build-time output before browser hydration
error true Render execution errors. false stops the build
include true Include the cell in the document
editor false Render the marimo editor for the Python cell
hide-code false Hide source and the editor
hide-output false Hide rendered output
disabled false Disable the cell and its dependents
unparsable false Preserve source as a non-reactive cell
name _ Set the marimo cell name
column none Set the marimo layout column

SQL cells use the same .marimo class:

```{sql .marimo}
#| echo: true
#| query: result

SELECT 1 AS value
```

SQL cells also accept query and engine. Use {markdown .marimo} when a Markdown cell should join the page app.

Python environment

Set pyproject in the document YAML to declare browser and build dependencies:

pyproject: |
  requires-python = ">=3.10"
  dependencies = ["pandas"]

Set external-env: true to execute with the active Python environment during the Quarto build.

Set header to Python source that runs as a setup cell before the authored cells:

header: |
  import polars as pl

QUARTO_MARIMO_VERSION selects the marimo runtime version embedded in HTML output.

Upgrading from 0.4

Replace the Lua filter configuration with the engine:

engine: marimo

Remove filters: marimo-team/marimo from the document or project YAML.

Development

Build the browser adapter and Quarto engine:

make build

Run the checks:

make lint
make test
make render

About

marimo extension for Quarto ⚡ run reactive code inside Quarto

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

193 stars

Watchers

2 watching

Forks

Releases

Used by

Contributors

Languages