-
Notifications
You must be signed in to change notification settings - Fork 197
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
Simpler code blocks #133
Comments
That's actually a different functionality than a regular code block - myst supports the same style of code blocks that commonmark does (what you suggest above). The |
So when showing code examples in documentation, which code block do you recommend people to use? I am a bit confused. |
for the vast majority of people, they should use:
same as any other markdown. If what you want is to convert your documentation page into a notebook, execute it at runtime, and insert the outputs into the page, then use
See https://myst-nb.readthedocs.io/en/latest/use/markdown.html for more information about this |
Ah I see. Thanks for the explanation. I am going to close this issue, I think it's already implemented as I would expect. I misunderstood the example document. |
Which page were you looking at? Sounds like we could clarify this better |
Or was it only in the wealth dynamics example that you shared above? |
This was prominently linked at the front page, so I clicked on it to see the details of the syntax. |
Btw, another feature I've been long missing is side by side code blocks, which you also implemented. Very exciting, I can now convert this page: https://www.fortran90.org/src/rosetta.html which was a pain to maintain in rst. |
FYI @certik you may also want to check out the https://sphinx-panels.readthedocs.io extension for this use case, which I've literally just created this week for another project 😁 (as with any sphinx directive, it can also be used in MyST) |
@chrisjsewell cool ---- are the panels for things like chapters of a book? |
For chapters of a book, I would recommend either the sphinx-book-theme (https://sphinx-book-theme.readthedocs.io/en/latest/) or its older brother, jupyter book (https://jupyterbook.org/intro.html) - both are projects of the same collaboration that has created the myst-parser |
Well you can use them for anything really. But the use case in mind is just for small sections of a page; as used here: https://pandas.pydata.org/docs/getting_started/index.html, or thumbnail links like: https://pandas.pydata.org/docs/ |
When looking at https://github.com/executablebooks/MyST-Parser/blob/f32bd380bdec755238566fa91352f9ed1d491036/docs/examples/wealth_dynamics_md.md, currently the code blocks are done as follows:
Would it make sense to for the following to be a shortcut for the above:
As that is the common syntax to denote code blocks at GitHub / GitLab, etc.
The text was updated successfully, but these errors were encountered: