Add "Open in molab" badge(s) linking to marimo notebooks. Works with READMEs, docs, websites, or any markdown/HTML target.
Add "Open in molab" badge(s) linking to marimo notebooks. The badge can be added to any target: a GitHub README, documentation site, blog post, webpage, or any other markdown/HTML file.
molab previews render much nicer if the github repository has session information around. This can be added via:
uvx marimo export session notebook.py
uvx marimo export session folder/
This executes notebooks and exports their session snapshots, which molab uses to serve pre-rendered notebooks.
Key flags:
--sandbox — run each notebook in an isolated environment using PEP 723 dependencies--continue-on-error — keep processing other notebooks if one fails--force-overwrite — overwrite all existing snapshots, even if up-to-dateThe user may provide notebook links in one of two ways:
.py files) in the repository. Use Glob with patterns like **/*.py and then check for the marimo header (import marimo or app = marimo.App) to confirm they are marimo notebooks.marimo.app links or existing badges), replace those.For each notebook, construct the molab URL using this format: