New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notebooks as markdown #1083
Comments
Quarto allows for filters that could easily be applied for Marimo (I think) quarto-dev/quarto-cli#8049 I would really like this and have mentioned it before +1 That thread is good context, but the project quarto-pydiode https://github.com/coatless-quarto/pyodide is probably most relevant to marimo |
Wow, 11 thumbs ups in 2 days! Message received :) We will look into this. Neither of us are very familiar with Myst or Quarto, but we'll look into both, and we'll share what we're thinking here. We'd definitely appreciate input and help. |
I think WASM only might be as easy as copying the pydiode or holoviz https://github.com/awesome-panel/holoviz-quarto extensions. For full reactive python output, it's a little trickier since the whole document has to be processed first, but you could have a hack with 2 filters:
Proper kernel integration would probably be better, or something deeper than just filters- managing a background process is definitely a work around |
That's just a reference implementation - ofc you can choose whatever you prefer. Quarto is written in TypeScript anyway. I think the parsing from markdown to an "internal representation" should not be super hard (though I don't know where it should happen: at the Python or TS level?). The challenge might be at the code design - how is the DAG building process implemented? |
Just to confirm: you all prefer markdown over a flat Python representation? For example, I know vscode lets you use a special comment ( Would you prefer markdown over this? |
I can only speak for myself, but I store my notes as markdown- and have typically exported my polished notebooks to markdown for file readable reference So yes. Markdown is nice because it's content vs code forward |
+1 on markdown. If it's a compliant spec, you can use pandoc to turn your notebook into pdf, latex, word documents... |
Here's a proof of concept with quarto https://github.com/dmadisetti/quarto-marimo rendered site here: https://dmadisetti.github.io/quarto-marimo/intro.html |
Non wasm (UI is dead) and had to fool react to get the elements to render. It would be cool to have a hybrid approach where Server in background is definitely a hack, posted to quarto discussions for ideas: quarto-dev/quarto-cli#9362 |
this is now complete thanks to @dmadisetti via #1332 let us know if there are any further enhancements to be made |
Description
One of marimo's strengths is the notebook being stored as a pure Python file, rather than a cumbersome JSON. However, the python file can be complex to edit too, due to every cell being stored as a Python function. If notebooks could be stored as markdown files it would be of great help!
Suggested solution
You could adhere to the MyST markdown spec: https://mystmd.org/guide
This would imply that the markdown is parsed into a DAG, where each code block (delimited by ```) and everything else is just wrapped into
mo.md
.The cool feature about myst (and previously RMarkdown files) is that you can write something like:
And at runtime
a
will be swapped with the__repr__
of the variable. This could be achieved with marimo easily.Alternative
Maybe you could adhere to Quarto's spec. I am not completely aware of the compatibility/interop/advantage of one over the other. See something here.
Additional context
No response
The text was updated successfully, but these errors were encountered: