Skip to content
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

feat: marimo edit/run markdown.md #1332

Merged
merged 16 commits into from May 16, 2024

Conversation

dmadisetti
Copy link
Contributor

@dmadisetti dmadisetti commented May 7, 2024

Cool, I just had this one waiting in a branch, so rebased and tests pass

Open/ Save/ Run work. Known issues are frontend:

  • marimo really doesn't want to rename anything not *.py
  • Home doesn't pick these up
  • no option to download .md files

I feel like this is still a bit of a hack, and could do with a refactor from someone with a deeper understanding of the layout. Feel free to directly contribute to this branch or just use it for inspiration. I really have 2/3 concerns prior to getting this into shape:

  1. I think that _cli/convert has gotten to big. Might be worth trying to merge this with codegen. Maybe:
     codegen/
           __init__.py
           markdown/
                 __init__.py
                 extensions.py
                 parsers.py
           python/
                 __init__.py

and moving some of the exporter.py logic over too

  1. I don't really get the app life cycle. New cells don't automatically create a cellimpl? I followed what codegen was doing, but it felt like I was doing something wrong. I didn't dig too deep- but I figured that it was either a deeper issue, or I was missing some way of getting app state.

  2. I may have starting to abuse markdown extension system too much. Might be fine as is, but also might be worth explicitly override parts of markdown to make things more transparent.

I think these are all points that either you @akshayka or @mscolnick might have more insight into / if you think this is worth supporting at the moment.


Anyway, I left a markdown.md in root for you all to play with, if you are interested. Which is a brief write up of the markdown work I just put in. marimo edit markdown.md should work

Copy link

vercel bot commented May 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marimo-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 16, 2024 4:04am
marimo-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 16, 2024 4:04am

@mscolnick
Copy link
Contributor

this is awesome - ill branch off this and make those frontend changes.

regarding the app lifecycle, it just recently got refactored by @akshayka which may/may not help this. historically a lot of state was (and still is) stored in the frontend, and so the cells data-structures are really only initialized and never really updated. part of it, i think, is because those don't need to be updated, until maybe now.

@akshayka
Copy link
Contributor

akshayka commented May 8, 2024

and so the cells data-structures are really only initialized and never really updated. part of it, i think, is because those don't need to be updated,

Yea, that's right. The app object is just used to read in the cells and send their code/config to the kernel process, which has a graph of CellImpls.

@mscolnick
Copy link
Contributor

mscolnick commented May 8, 2024

Regarding: "no option to download .md files"

@dmadisetti here is the feat: #1339

EDIT: "Home doesn't pick these up" is also handled by #1339

@dmadisetti
Copy link
Contributor Author

Super cool!

@mscolnick
Copy link
Contributor

@dmadisetti might have a hopefully small merge conflict - but should make this PR much easier

the frontend is currently behind a feature flag - you can either run in development mode or add to your marimo.toml:

[experimental] 
markdown = true

@dmadisetti
Copy link
Contributor Author

Yea, that's right. The app object is just used to read in the cells and send their code/config to the kernel process, which has a graph of CellImpls.

My other concerns were just code health and file project structure- so I'm OK with this if you are. I can move the markdown.md to tutorials and write tests for marimo run/edit markdown.md

The FE stuff works like a charm!

@akshayka
Copy link
Contributor

My other concerns were just code health and file project structure- so I'm OK with this if you are.

Yup, I'm OK with it.

I can move the markdown.md to tutorials and write tests for marimo run/edit markdown.md

That sounds great. By the way, the markdown.md tutorial is very well written, nice work.

@dmadisetti
Copy link
Contributor Author

🎉 sorry for the commit spam, CI was doing its job.

That sounds great. By the way, the markdown.md tutorial is very well written, nice work.

Thanks! I just followed the style in the others

Copy link
Contributor

@mscolnick mscolnick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is very awesome! nice work @dmadisetti

@mscolnick mscolnick merged commit 579ffbd into marimo-team:main May 16, 2024
25 of 26 checks passed
Copy link

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.5.3-dev19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants