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: convert and export from markdown #1296

Merged
merged 15 commits into from
May 4, 2024

Conversation

dmadisetti
Copy link
Contributor

@dmadisetti dmadisetti commented May 1, 2024

Enables marimo export md marimo_app > my_markdown.md and marimo convert my_markdown.md > marimo_app

Conversions are idempotent

Copy link

vercel bot commented May 1, 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 3, 2024 9:21pm
marimo-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 3, 2024 9:21pm

@dmadisetti
Copy link
Contributor Author

Eh. Marking as draft, as less idempotent than I think is ideal.

Settles after a few recurrent runs, but whitespace shifts around.

Will look into it and push tests when I have a bit more time

@mscolnick
Copy link
Contributor

this is awesome 😮

let me know if there is anything I can do to help on this
(also thank you for the DRYness / cleanup)

@dmadisetti
Copy link
Contributor Author

Thanks! Hope this PR didn't get too large.

Do you have a way of testing on windows? Looks like maybe some unicode encoding or something is causing the windows test failure. Or maybe line endings? Not sure what's going on

@dmadisetti
Copy link
Contributor Author

Skipping the test for now. I can come back to it this evening

@akshayka
Copy link
Contributor

akshayka commented May 2, 2024

Do you have a way of testing on windows? Looks like maybe some unicode encoding or something is causing the windows test failure. Or maybe line endings? Not sure what's going on

@dmadisetti I can help you test on Windows.

For reference, I spin up a trial Windows VM using VirtualBox. I think I got the image from here but I don't remember 100%: https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/

@dmadisetti
Copy link
Contributor Author

dmadisetti commented May 2, 2024

Cool making a list for later:

  • I think I'm going to remove most of the test data files, 7 seems excessive and is cluttering the PR- maybe just keep one of the bigger ones, and make a custom one (need to check more complex yaml for front matter header). Will also change to snapshots for ease updating.
  • New line between md and code
  • .python.marimo tag
  • Get app name

@akshayka Awesome! I'm pretty sure it's the emojis in python -> md, so we could just skip the emoji case for windows- but debugging it might take some playing around. I do have access to a windows vm, but don't have virtual box or anything set up right now

@dmadisetti
Copy link
Contributor Author

Pretty sure that failure was an actions network issue- not sure how to retrigger tests



# TODO: Fix this test on Windows.
@pytest.mark.skipif(sys.platform == "win32", reason="Failing on Windows CI")
Copy link
Contributor

Choose a reason for hiding this comment

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

@akshayka is the resident windows tester. i think its fine to skip for now, and we can take care of this

tests/_cli/test_markdown_idempotent_conversion.py Outdated Show resolved Hide resolved
marimo/_cli/convert/commands.py Show resolved Hide resolved
mscolnick
mscolnick previously approved these changes May 3, 2024
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.

looks good to me! this is an awesome feature

@mscolnick mscolnick merged commit e267a32 into marimo-team:main May 4, 2024
26 checks passed
Copy link

github-actions bot commented May 4, 2024

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

@dmadisetti dmadisetti deleted the dm/markdown branch May 6, 2024 20:03
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