Replies: 2 comments
Hey @rambip, thank you for the feedback!
With mdx-marimo, jupyter-book-marimo and quarto-marimo, the first step is conversion of your notebook Python file into the specific format mdx, jupyter-book or quarto expects. It is purely a code-conversion step and indeed, no assets are generated at this stage. The later phase is the actual build step specific to mdx hosts like Next.js, Astro, etc., Jupyter Book and Quarto where the island-related conversion happens. As for the why, this workflow: (1) enables extending an existing larger site where some pages are marimo-based and other pages are regular ones
This is very much our focus currently. We are working on an export API which lets you precompute outputs over a variety of inputs and leverage recent work on caching to let you and/or your agent export notebook outputs into a no-WASM site with a high degree of customizability. |
|
Chiming in with my version of an ask aligned with this discussion: essentially I don't want to use the React frontend in any form (islands etc), but I still want the full strengths and value prop of the marimo backend stuff within my own custom apps. I've been running marimo as a headless reactive backend with the frontend fully replaced: marimo edit --headless as a subprocess, driven over the wire, cell outputs streamed to the browser via SSE, all rendering server-side Python (no React, none of marimo's frontend bundle). It works well — the kernel/frontend separation in the architecture is genuinely clean. But everything I touch is private surface: the {"op": ..., "data": ...} WS envelope, the _messaging notification types (I decode with msgspec against a pinned version), and a few /api/kernel/* endpoints. What would make this durable mostly already exists:
(anywidget gets suggested for custom UI, but it's the inverse problem — it embeds custom components inside marimo's frontend and reintroduces per-component JS. This is embedding marimo's kernel under a custom frontend, keeping everything Python.) The nice part: this and the export API could share the same output schema — precomputed for static sites, streamed for live ones. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Not long after discovering Marimo, I decided I wanted my website to be generated by Marimo, with a pure Python pipeline.
Currently, it looks like this: https://rambip.github.io/
It's very hacky, and I was always frustrated that exporting to a website did not have first-class support in Marimo.
The release of Marimo Anywhere was the occasion to express my problem in a more precise way.
There are 3 kinds of things that I don't like with the current export strategy/philosophy, and here they are:
Now, let me answer some questions:
The basic idea of exporting to a mdx component is fine, as long as it's a small, interactive, independent, compute-friendly element. But often, elements are not like this.
The only think I want is a good API to work with it. The marimo team already did a great API design job for marimo-pair, and I think it should be the same for exporting. Your LLM should be able to do
from marimo import export, and from there, it should be able to do things like:mo.imageelements,mo.audioelements, but also generated files. Maybe, the hard part would be to not duplicate outputs (like if someone doescreate_image("./foo.png"); mo.image("./foo.png")? IDK)One things that could be hard to get right here is caching, I don't know. That's very valuable to re-run only the notebook that changed when you're creating a website-generator-script. But caching is hard.
Here are some issues that this work could solve:
A different one but that I would love to see fixed too: #9890
Feel free to ask as many questions as you want to clarify the need. I hope this discussion will be fruitful
All reactions