Helping users build examples from .md source #2292
Replies: 6 comments 4 replies
-
First, 100% agree we need to find an easier way for people to download and use our tutorials on their local machines. Second, I'll just point out what does exist in this direction. On all the pages of the documentation there is a "show source" link which brings you to a
Indeed having a "download jupyter notebook" button has been on our wishlist for quite some time. We included #1619 in unitaryHACK last year, and as you can see from the discussion there, it's not a straightforward feature we can get out of our documentation (or at least it wasn't ~1 year ago).
We also used to have some link in Mitiq that linked to mybinder, but they were constantly failing. Check out #1820, and the linked PRs for more info here.
What's the use case for someone wanting to do this unless they're going to start doing dev work on Mitiq. What type of user do you think this would benefit?
huh that's an interesting idea. Currently the documentation is generally not packaged with the code itself so we would have to do that, and then add a build step for the docs in the wheel or similar. Do you know of any other projects that do something like this? (not a requirement, just curious) |
Beta Was this translation helpful? Give feedback.
-
Do we have any idea how much room it would take up to store the md files as ipynb? |
Beta Was this translation helpful? Give feedback.
-
I found a package called Jupyter Book, which seems to do everything we're looking for: For an example of how this works, take the project https://python.quantecon.org/sir_model.html, which Jupyter-book links from their website as a good example. One of their pages, which contains both markdown and code, looks like this: At the top righthand corner there are buttons for multiple ways of interacting with the content on that page: Adopting this would introduce a new dependency, but it seems quite useful. They already have integration with Myst and Jupytext: https://jupyterbook.org/en/stable/file-types/myst-notebooks.html#file-types-myst-notebooks |
Beta Was this translation helpful? Give feedback.
-
Thanks @jordandsullivan. Please see these issues for context: #1619 (btw this was a bounty for unitaryhack 2023), and #1517. |
Beta Was this translation helpful? Give feedback.
-
OP's option 2. implemented in #2363. Please take a look. |
Beta Was this translation helpful? Give feedback.
-
Let me leave here a handy VSCode tasks.json that I created to handle .md <> .ipynb conversion
|
Beta Was this translation helpful? Give feedback.
-
Currently, in the landing page for our examples landing page does not list how to run these examples easily (as they are HTML). There's also not very much information about how to generate these notebooks in the docs, except in the Contribution section, and I think this should be accessible to vanilla users as well.
I've thought of a few options to make things easier:
Beta Was this translation helpful? Give feedback.
All reactions