Skip to main content

MkDocs marimo plugin

Project description

MkDocs marimo Plugin

[!WARNING] The MkDocs marimo plugin is under active development. Features and documentation are being continuously updated and expanded.

This plugin allows you to embed interactive marimo notebooks in your MkDocs documentation.

Installation

# pip
pip install mkdocs-marimo
# uv
uv pip install mkdocs-marimo
# pixi
pixi add mkdocs-marimo

Usage

Create reactive and interactive Python blocks in your markdown files using marimo.

Embedding inline HTML components

This uses code fences to embed marimo components as marimo islands.

```python {marimo}
import marimo as mo

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

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

Embedding the marimo playground

For an easy way to embed marimo notebooks or applications, we recommend embedding the marimo playground. This feature uses pymdownx.blocks to embed marimo notebooks in your MkDocs documentation, creating iframes that render the marimo playground.

/// marimo-embed
    height: 400px
    mode: run

```python
@app.cell
def __():
    import matplotlib.pyplot as plt
    import numpy as np

    x = np.linspace(0, 10, 100)
    y = np.sin(x)

    plt.figure(figsize=(8, 4))
    plt.plot(x, y)
    plt.title('Sine Wave')
    plt.xlabel('x')
    plt.ylabel('sin(x)')
    plt.grid(True)
    plt.gca()
    return
///

Available options for marimo-embed:

  • height: Named sizes (small, medium, large, xlarge, xxlarge) or custom pixel values (e.g. 500px) (default: medium)
  • mode: read, edit (default: read)
  • app_width: wide, full, compact (default: wide)

You can also embed marimo files directly:

/// marimo-embed-file
    filepath: path/to/your/file.py
    height: 400px
    mode: read
    show_source: true
///

Additional options for marimo-embed-file:

  • filepath: path to the marimo file to embed (required)
  • show_source: true, false (default: true) - whether to show the source code below the embed

Examples

Checkout the documentation for more examples.

Contributions welcome

Feel free to ask questions, enhancements and to contribute to this project!

See CONTRIBUTING.md for more details.

Credits

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mkdocs_marimo-0.2.0.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkdocs_marimo-0.2.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_marimo-0.2.0.tar.gz.

File metadata

  • Download URL: mkdocs_marimo-0.2.0.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for mkdocs_marimo-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2e67f94d712b7259019cadbea84a814ef4251a68f5f389e606160ac00b89df4f
MD5 1737ccde5c615b9f9879263c457ba74c
BLAKE2b-256 263dff5dc9c6cd0d03ed0e75e0192b56e3108467fd0bc71acb0febf7a955b78e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_marimo-0.2.0.tar.gz:

Publisher: build.yml on marimo-team/mkdocs-marimo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mkdocs_marimo-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: mkdocs_marimo-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for mkdocs_marimo-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb55398a3a790b873039a3e54f20159a2a42a41efe1c21c980c1a05e1f2d8d9a
MD5 0f3fc157af7158a7a3b437b514b0f96b
BLAKE2b-256 f43b839a1e0e8cc7fba4beea2122f93c6133e31c3dc1a9ae49d4cc8e2a875580

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocs_marimo-0.2.0-py3-none-any.whl:

Publisher: build.yml on marimo-team/mkdocs-marimo

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page