marimo-team / marimo

A reactive notebook for Python — run reproducible experiments, execute as a script, deploy as an app, and version with git.
https://marimo.io
Apache License 2.0
6.09k stars 197 forks source link

Export WASM to folder for self-publishing on personal web site #1882

Open akshayka opened 1 month ago

akshayka commented 1 month ago

Discussed in https://github.com/marimo-team/marimo/discussions/1078

Originally posted by **astrowonk** April 5, 2024 marimo.app is very cool and I was excited to see the WASM support. But, WASM apps should be able to just be turned into a folder than can deployed on any web server (nginx, apache, etc.) [Shiny Live](https://github.com/posit-dev/py-shinylive) for example has an easy `shinylive export myapp site` command that turns the app into a folder I can upload to my nginx server. Whereas for now, wasm notebooks seem to require using `marimo.app`. Is there a plan to have an export option someday? Thanks!
dmadisetti commented 1 month ago

So I feel like islands is (are?) pretty close. But there are a few options for completion:

Conversely, adapting some of my solutions:

akshayka commented 1 month ago

I do know we want this in the CLI, but I don't have a strong opinion on what the right solution is.

Which option do you think our users would be best served by?

dmadisetti commented 1 month ago

I think starting from islands from file export, and then potentially expanding or pivoting based on user feedback.

I haven't seen anyone explicitly calling for quarto or a more advanced export, so starting with base functionality seems like the first best step

mscolnick commented 1 month ago

I wonder if leveraging quarto and other SSG frameworks is better overall.

My hesitation by adding this to the CLI as-is, would lead to more issues and feature-bloat around customizing the title/color-sheme/meta-tags/open-graph tags, etc.

whereas @dmadisetti's quarto plugin opens up a world of possibilities in the quarto ecosystem

akshayka commented 1 month ago

I wonder if leveraging quarto and other SSG frameworks is better overall.

Ok, that would be fine too.

Releasing this under marimo-teams gives export capabilities without the dev overhead of putting in templating/ managing exports. This could be a standalone repo or live in marimo, since it just needs the root folder _extension

I'd be down to release as a standalone repo under marimo-team, maybe that would be easiest?

As far as marimo is concerned then, we could simply add documentation to docs.marimo.io telling users how to use the the quarto plugin.

@dmadisetti, is this something you'd like to do? If so I can create a repo (what should it be called?).

dmadisetti commented 1 month ago

Sorry about that, thought I responded.

Here are the options for export:

1. Make islands export more robust.


2. Create a quarto extension


3. As a pure pandoc solution


4. Integrated with mkdocs


It's possible to create another repo that includes options 2,3, and 4 of the export options. http://github.com/dmadisetti/quarto-marimo couples 2 and 3, minus the panflute distribution. My local implementation of the mkdocs plugin leverages the marimo quarto integration, but it could easily be stripped out.

Going further?

For renderable exports in github, I think a GH action that utilizes the chosen option/s above would be ideal. Options can be to export as markdown or PDF

akshayka commented 4 weeks ago

@dmadisetti — 2 sounds great to me, since you already have an implementation of it, and since Quarto appears to be loved by the community.

How should we proceed? If you like, you're welcome to transfer quarto-marimo to the marimo-team organization, or I can create a new repo in marimo-team, or you can create a PR that adds the _extension folder to the marimo repo ... You would know best.

akshayka commented 2 weeks ago

Another option to consider is Myst: https://mystmd.org/guide/quickstart. It recently became part of project Jupyter (https://github.com/jupyter-book/mystmd), and was used for the Scipy 2024 proceedings. I have heard that it is comparable to Quarto.

dmadisetti commented 2 weeks ago

I've looked at Myst a little before. Their exports look interesting, it's not pandoc based

Their standard is a little different from everyone else and also supports things like inline eval. References might be something that marimo could think about providing greater integration for