marimo
marimo copied to clipboard
Add typst cell type
Description
As much as I love markdown, for some technical topics I'd much rather write in a typesetting language.
Typst is a perfect fit in my opinion. Its syntax is close to markdown but as extensible and programmable as Latex and it compiles super fast.
It also offers html and svg export which makes it very nice to use in webapps such as marimo.
Suggested solution
Typst has recently released an html export feature (which is still unstable though).
I tried to give the output of the html export into mo.Html which worked fin, but was lacking some styling.
A thing I also tried was typsts svg export. This is way more stable and also worked.
Are you willing to submit a PR?
- [x] Yes
Alternatives
No response
Additional context
No response
Instead of a new cell type, we might prefer embedding Typst in markdown, in the same way that we support embedding LaTeX in markdown. We use pymdownx, which provides a LaTeX extension for Python Markdown. Have you thought about asking them for Typst support?
Didn't do that yet. But afaik only LaTeX formulars are supported and not the entire LaTeX syntax. I'd much rather have cells that fully support writing an entire document in typst and think it would be possible with the html export. Is there an api or something to create plugins for new cell types?
We do not have an extension API currently, sorry. All cells in marimo are just Python. You might consider implementing a UI plugin with anywidget