You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
│ └── export_notebooks.py # Exports notebooks to static HTML
42
46
├── app/ # Next.js app (UI shell)
43
47
│ ├── app/ # Pages (App Router)
44
-
│ └── components/ # Sidebar, MarimoIframe
45
-
├── serve_notebooks.py # Marimo ASGI server (port 8000)
48
+
│ ├── components/ # Sidebar, MarimoIframe
49
+
│ └── public/notebooks/ # Exported HTML (generated, gitignored)
46
50
└── pyproject.toml
47
51
```
48
52
49
53
## How it works
50
54
51
-
-**Marimo server** (`localhost:8000`) — runs notebook kernels via `serve_notebooks.py`
52
-
-**Next.js app** (`localhost:3000`) — navigation shell that embeds notebooks in iframes
55
+
-**Export step** — `scripts/export_notebooks.py` runs `marimo export html` on each notebook, writing static HTML to `app/public/notebooks/`
56
+
-**Next.js app** (`localhost:3000`) — navigation shell that serves the exported HTML via `MarimoIframe`
57
+
-**CI** — the [deploy workflow](.github/workflows/deploy.yml) exports notebooks and builds the site on push to `main`. A [weekly refresh](.github/workflows/refresh-data.yml) re-exports to pick up fresh data.
53
58
54
59
Each page in the Next.js app is a thin wrapper around a `MarimoIframe` component:
55
60
@@ -62,6 +67,7 @@ Each page in the Next.js app is a thin wrapper around a `MarimoIframe` component
62
67
1. Create `notebooks/<category>/<name>.py` using the standard template below
63
68
2. Add a page at `app/app/<category>/<name>/page.tsx`
64
69
3. Add a nav entry to `app/components/Sidebar.tsx`
70
+
4. Run `cd app && pnpm export:notebooks` to generate the HTML
65
71
66
72
### Notebook template
67
73
@@ -88,22 +94,8 @@ if __name__ == "__main__":
88
94
89
95
For detailed notebook conventions, see [`notebooks/claude.md`](notebooks/claude.md).
90
96
91
-
## Running servers separately
92
-
93
-
```bash
94
-
# Terminal 1 — Marimo
95
-
uv run python serve_notebooks.py
96
-
97
-
# Terminal 2 — Next.js
98
-
cd app && pnpm dev
99
-
```
100
-
101
-
Notebooks are served at `http://localhost:8000/notebooks/<name>` — Marimo must be running for iframes to render.
102
-
103
97
## Configuration
104
98
105
99
| Variable | Description |
106
100
|----------|-------------|
107
101
|`OSO_API_KEY`| Required. OSO data warehouse access key. |
108
-
109
-
The Marimo port defaults to `8000`. To change it, update `serve_notebooks.py` and the `marimoPort` prop on `MarimoIframe` in any relevant pages.
0 commit comments