← GDG /

#317 gdtest_marimo

#317 gdtest_marimo OK CONFIG
Interactive marimo notebook islands via the {{< marimo >}} shortcode
View Site → Build Log ๐Ÿงช Test Coverage

Build Mode

● Has great-docs.yml

This package ships a pre-supplied config. The great-docs init step is skipped and great-docs build uses the spec-defined configuration directly. Tests specific config options and their rendered output.

Dimensions

A1 B1 C4 D2 E6 F1 G1 H7
A1Flat layoutlayout
B1Explicit __all__exports
C4Mixed class+funcobjects
D2Googledocstrings
E6No directivesdirectives
F1Auto-discoveruser_guide
G1README.mdlanding
H7No extrasextras

Source Files

๐Ÿ“ gdtest_marimo/
๐Ÿ“„ __init__.py
"""Marimo islands demo package."""

__version__ = "1.0.0"
__all__ = ["greet"]


def greet(name: str) -> str:
    """Return a friendly greeting.

    Parameters
    ----------
    name
        Who to greet.

    Returns
    -------
    str
        The greeting.
    """
    return f"Hello, {name}!"
๐Ÿ“ notebooks/
๐Ÿ“„ demo.py
# /// script
# requires-python = ">=3.10"
# dependencies = [
#     "marimo",
# ]
# ///

import marimo

app = marimo.App()


@app.cell
def __():
    import marimo as mo
    return (mo,)


@app.cell
def __(mo):
    mo.md(
        """
        # Interactive Demo

        Drag the slider below โ€” the output updates reactively.
        """
    )
    return


@app.cell
def __(mo):
    n = mo.ui.slider(1, 20, value=5, label="How many?")
    n
    return (n,)


@app.cell
def __(mo, n):
    mo.md(f"You chose **{n.value}**. Its square is **{n.value ** 2}**.")
    return


@app.cell
def __(mo):
    factor = mo.ui.slider(1, 5, value=2, label="Multiplier")
    factor
    return (factor,)


@app.cell
def __(factor, mo, n):
    mo.md(f"**{n.value}** ร— **{factor.value}** = **{n.value * factor.value}**")
    return


@app.cell
def __(mo):
    mo.md(
        """
        ## Notes

        This notebook is intentionally longer to show that the iframe grows to
        fit however many cells you add:

        - Cells run in the browser via WebAssembly (Pyodide)
        - Edit any cell and press Ctrl+Enter to re-run
        - Dependent cells update reactively
        """
    )
    return


@app.cell
def __(mo, n):
    mo.ui.table(
        [{"i": i, "i_squared": i * i} for i in range(1, n.value + 1)],
        selection=None,
    )
    return


if __name__ == "__main__":
    app.run()
๐Ÿ“ user_guide/
๐Ÿ“„ 01-islands.qmd
---
title: Marimo Islands
---

# Interactive Notebook (Island Mode)

The notebook below is embedded with the default island mode. Its cells
run in the browser via WebAssembly (Pyodide).

{{< marimo file="notebooks/demo.py" >}}
๐Ÿ“„ 02-nocode.qmd
---
title: Outputs Only
---

# Outputs Only (show-code=false)

The same notebook, rendered with the source hidden โ€” useful for
dashboard-style presentations.

{{< marimo file="notebooks/demo.py" show-code="false" >}}
๐Ÿ“„ 03-iframe.qmd
---
title: Iframe Mode
---

# Full Notebook (Iframe Mode)

The same notebook embedded as a **fully editable, reactive** Marimo
notebook in a sandboxed iframe (self-hosted WASM, full editor chrome).
Edit any cell and press Ctrl+Enter โ€” dependent cells re-run live.

{{< marimo file="notebooks/demo.py" mode="iframe" height="760px" >}}
๐Ÿ“„ great-docs.yml
marimo: true
dark_mode: true