marimo + quarto

🟢 🔵 🏝️


This repository provides a framework for integrating Quarto with marimo, enabling markdown documents to be executed in a marimo environment, and reactive in page.

mo.md(f'''
  # Hello from marimo!{'!' * slider.value}

  This is a raw, reactive python cell.
  You can edit it, and the output will change on run.
''').callout("info")

What?

First, aquaint yourself with the marimo! One you’ve digested the basics, and maybe even written a few marimo notebooks, start to consider the possibilities of exporting marimo cells to be standalone, Web Assembly modules, embeddable anywhere.

That’s where Quarto comes in with the qmd format.

qmd is a markdown format that allows for the extraction and execution of code cells in a markdown document. It’s a great way to maintain readable documents exportable to a variety of formats, while still being able to execute code.

This page, and the marimo tutorials in the sidebar are qmd documents, to get a sense of what’s possible, look at their source.

Getting started

Write a qmd document with {marimo} cells.

For instance the following cell

```{python .marimo}
print("remember that stdout is not shown")
result = "Only outputs!"
result,
```

produces the following output:


We can make it editable:

```{python .marimo}
#| editor: true
editor_result = "Change me" + ("!" * 3)
editor_result,
```
editor_result = "Change me" + ("!" * 3)
editor_result,

but the default is to show the output only.



Hold ctrl to manually run a stale cell.

but how do I run this?

Install quarto and quarto install extension marimo-team/quarto-marimo.

You can also export existing notebooks into quarto format: marimo export md mynotebook.py -o mynotebook.qmd

Background cells shown for illustration

# Bug: Cells are not runnable if no output
import marimo as mo
Back to top