This template repository demonstrates how to export marimo notebooks to WebAssembly and deploy them to GitHub Pages.
apps/charts.py
: Interactive data visualization with Altairnotebooks/fibonacci.py
: Interactive Fibonacci sequence calculatornotebooks/penguins.py
: Interactive data analysis with Polars and marimo
- Fork this repository
- Add your marimo files to the
notebooks/
orapps/
directorynotebooks/
notebooks are exported with--mode edit
apps/
notebooks are exported with--mode run
- Push to main branch
- Go to repository Settings > Pages and change the "Source" dropdown to "GitHub Actions"
- GitHub Actions will automatically build and deploy to Pages
To include data or assets in your notebooks, add them to the public/
directory.
For example, the apps/charts.py
notebook loads an image asset from the public/
directory.
<img src="public/logo.png" width="200" />
And the notebooks/penguins.py
notebook loads a CSV dataset from the public/
directory.
import polars as pl
df = pl.read_csv(mo.notebook_location() / "public" / "penguins.csv")
To test the export process, run scripts/build.py
from the root directory.
python scripts/build.py
This will export all notebooks in a folder called _site/
in the root directory. Then to serve the site, run:
python -m http.server -d _site
This will serve the site at http://localhost:8000
.