Skip to content

marimo for MkDocs

PyPI License GitHub stars Discord

A MkDocs plugin that brings interactive Python code execution to your documentation using marimo.

Features

  • ⚡️ Write and execute Python code directly in your Markdown files
  • 🔄 Interactive widgets with real-time updates
  • 📊 Seamless integration with data visualization libraries
  • 🎨 Customizable styling to match your documentation theme
  • 🚀 Easy to set up and use

Quick Start

1. Install the plugin

pip install mkdocs-marimo
uv pip install mkdocs-marimo
pixi add mkdocs-marimo
conda install -c conda-forge mkdocs-marimo

2. Add the plugin to your mkdocs.yml

plugins:
  - marimo

3. Write interactive Python code in your Markdown files

```python {marimo}
import marimo as mo

name = mo.ui.text(placeholder="Enter your name")
name
```

```python {marimo}
mo.md(f"Hello, **{name.value or '__'}**!")
```

Example: Interactive Sine Wave

Instead of static code blocks, create interactive visualizations:

Why mkdocs-marimo?

  • Interactive Documentation: Engage your readers with live, interactive code examples.
  • Real-time Feedback: Instantly see the effects of code changes and parameter adjustments.
  • Enhanced Learning: Improve understanding through hands-on experimentation within the documentation.

Getting Started

Check out our Getting Started guide to learn more about using marimo inside MkDocs.

Community

License

mkdocs-marimo is released under the Apache License 2.0.