a post with marimo snippets, for MLME26
I’m revising MLME 26, kicking off 2026-09-07, and moving its labs from Jupyter to marimo for reproducible, in-browser demos. This post is the reference for that transition, starting with the notebook below.
marimo notebooks can run Python directly in the reader’s browser. Opt a page in from its front matter:
---
layout: post
title: a post with marimo snippets
marimo: true
---
Nothing is loaded on pages without that flag, so bundling the plugin costs nothing site-wide.
Runnable snippets
Wrap fenced Python blocks in a container and the runtime turns them into an interactive notebook after the page loads:
import marimo as mo
slider = mo.ui.slider(1, 20, value=5, label="n")
slider
mo.md(f"The first {slider.value} squares: {[i**2 for i in range(1, slider.value + 1)]}")
Until the runtime has moved those blocks into place the container stays hidden, so readers never see the raw source flash before it becomes a notebook.
Embedding a hosted notebook
If you already publish a notebook — on marimo.app or your own WASM host — embed it instead. Here’s the MLME 26 Jupyter-to-marimo transition notebook:
{% al_marimo_embed src="https://marimo.app/l/30o11k" height="700px" caption="MLME 26: Jupyter to marimo transition" %}
al_marimo 1.0.0 sandboxes this frame without allow-same-origin, on the theory that the embedded notebook shouldn’t reach this page’s storage or cookies. In practice that also blocks marimo’s own in-browser Python runtime from reaching its own origin’s storage to cache the WASM interpreter it needs to boot — the notebook’s outer chrome loads, but the cells never render. _plugins/al_marimo_sandbox_override.rb patches that back in for this site; see al-org-dev/al-marimo#1 for the upstream fix. If you’re reading this on a site without that override, open the notebook directly on marimo.app instead.
marimo vs. Jupyter
marimo replaces Jupyter’s top-to-bottom, JSON-based notebooks with reactive execution stored as plain .py files: editing a cell auto-reruns every dependent cell, so the file you commit is git-diffable and actually reproducible. Jupyter still wins for non-Python kernels and its larger widget/extension ecosystem. See marimo as a Jupyter alternative for the full comparison, and Algorithmic Trading with marimo and Jupyter, with 6 Great Extensions for a hands-on look at using both together.
A note on what this loads
The marimo-snippets runtime is vendored into the plugin at a pinned version and served from your own site, rather than pulled from a CDN — so no third-party origin executes script in your readers’ pages. Running a notebook does contact marimo’s host, which is worth knowing before you opt a page in.
Enjoy Reading This Article?
Here are some more articles you might like to read next: