Gallery Examples#
This page demonstrates the integration between Sphinx Gallery and Marimo. Each example below shows a static version generated by Sphinx Gallery, along with download links and a launch marimo button for interactive exploration.
What is Sphinx Gallery?#
Sphinx Gallery is a popular extension that automatically generates beautiful documentation from Python scripts. It executes your code, captures the output and plots, and creates nicely formatted HTML pages with:
Syntax-highlighted source code
Rendered plots and visualizations
Execution output and timing information
Download links for Python scripts and Jupyter notebooks
The examples are automatically generated from Python scripts in the gallery_examples/
directory. Sphinx Gallery executes each script, captures the output, and generates static documentation pages.
Integration with Marimo#
The sphinx-marimo extension enhances Sphinx Gallery by adding a launch marimo button to each example. When you click this button, you open an interactive version of the notebook that runs entirely in your browser using WebAssembly - no server required!
Key Features#
Static Documentation: Beautiful rendered examples with syntax highlighting and output (via Sphinx Gallery)
Download Options: Get the original Python script or Jupyter notebook version (via Sphinx Gallery)
Interactive Launch: Click “launch marimo” to explore with live widgets and real-time updates (via sphinx-marimo)
Seamless Integration: Buttons automatically appear alongside existing Binder/JupyterLite options
Note
The Marimo launcher integration requires no changes to existing Gallery examples - it works automatically with any Gallery-compatible Python script.
Configuration#
You can control which buttons appear on Gallery pages using these configuration options in conf.py
:
# Control button visibility (both default to True)
marimo_show_footer_button = True # Show download button in page footer
marimo_show_sidebar_button = True # Show launch button in right sidebar
This allows you to choose whether users see the download button, the launch button, or both.
Auto-Generated Examples#
- orphan:
Gallery Examples#
This directory contains Python scripts that demonstrate the integration between Sphinx Gallery and Marimo. Each script creates static visualizations that are automatically rendered by Sphinx Gallery, while also providing a “launch marimo” button for interactive exploration.
The examples showcase:
Basic Visualization: Simple plotting with mathematical functions
Interactive Dashboard: Multi-panel dashboard with various chart types
Machine Learning Demo: Classification workflow with model evaluation
Each example is designed to work both as static documentation and as an interactive Marimo notebook.