Skip to content

Conversation

@reint-fischer
Copy link
Contributor

@reint-fischer reint-fischer commented Nov 6, 2025

Implementing MyST-NB as a sphinx extension will replace both nbsphinx and myst_parser. This way, we can read and execute both .md and .ipynb notebooks, which will allow us to write new notebooks in .md for better integration with the rest of the documentation.

TODO

  • add myst_nb remove myst_parser
  • transfer .ipynb execution from nbspinx to myst_nb
  • Execute quickstart tutorial on docs build
  • Check notebook testing in CI
  • Fix User Guide links
  • Check notebook outputs in dark mode
  • Finish writing quickstart tutorial as .md notebook

Fixes #2335

@reint-fischer reint-fischer marked this pull request as draft November 6, 2025 13:47
@reint-fischer
Copy link
Contributor Author

I managed to build the docs using MyST-NB and I think the docs look pretty good, which I think is exciting! The main observations I have so far:

  • building the docs already took a couple of minutes with only 5 notebooks, but that was only the first time. Notebooks are only executed if they have changed so once I am only working on the quickstart tutorial it is pretty much as quick as before.
  • writing new notebooks is more challenging because I cannot execute the cells in VS Code as I am editing them. There might be a way to do this?
  • I still need to look into the printing of outputs, such as the progressbar and with the docs in “dark mode"

@VeckoTheGecko
Copy link
Contributor

  • writing new notebooks is more challenging because I cannot execute the cells in VS Code as I am editing them. There might be a way to do this?

Sorry - slightly confused with the terminology - by 'notebook' do you mean actual notebook (ipynb extension) or markdown file with executable cells

@reint-fischer
Copy link
Contributor Author

  • writing new notebooks is more challenging because I cannot execute the cells in VS Code as I am editing them. There might be a way to do this?

Sorry - slightly confused with the terminology - by 'notebook' do you mean actual notebook (ipynb extension) or markdown file with executable cells

Yes, I meant the markdown file with executable cells. I have written the quickstart tutorial in this format and I like writing in markdown, but I have still written it much like I would write a Jupyter Notebook. I like the consistency and integration with the rest of the documentation website, but it is helpful to be able to execute the cells as I am writing them to see that the result is as I expect, which is a Pro for Jupyter Notebooks.

@reint-fischer
Copy link
Contributor Author

reint-fischer commented Nov 12, 2025

Noting that:

@erikvansebille
Copy link
Member

Perhaps also change the name of this PR to better reflect what it is (the QuickStart guide and the myST-nb implementation)?

@reint-fischer reint-fischer changed the title Implement MyST-NB to run notebooks in docs Quickstart Guide and MyST-NB implementation Nov 13, 2025
@github-project-automation github-project-automation bot moved this from Backlog to Ready in Parcels development Nov 13, 2025
Copy link
Contributor

@VeckoTheGecko VeckoTheGecko left a comment

Choose a reason for hiding this comment

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

Maybe I missed the discussion - why the verbose_progress=False?

Copy link
Contributor

@VeckoTheGecko VeckoTheGecko Nov 13, 2025

Choose a reason for hiding this comment

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

What do you think about hard wrapping of prose in markdown files @reint-fischer ? Is that also something to mention here?

(e.g.)

I can write a whole paragraph on one line, but it becomes a bit difficult to read when suggesting edits via GitHub, or depending on your editor settings. When rendered in the docs site, it doesn't matter if this is spread along multiple lines (as long as there is no blank line in between). If you roughly spread it across multiple lines then working with diffs becomes easier.
I can write a whole paragraph on one line, but it becomes a bit 
difficult to read when suggesting edits via GitHub, or depending 
on your editor settings. When rendered in the docs site, it 
doesn't matter if this is spread along multiple lines (as long 
as there is no blank line in between). If you roughly spread it 
across multiple lines then working with diffs becomes easier.

We could go to the extreme and enable this via a pre-commit hook, but that would be quite messy and unnecessary I think

Copy link
Contributor Author

@reint-fischer reint-fischer Nov 13, 2025

Choose a reason for hiding this comment

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

Yeah I am not opposed to that, I can add a recommendation; is there a specific length you like?

- We recommend hard wrapping prose in markdown so that reading it becomes easier in any editor.

Copy link
Contributor

Choose a reason for hiding this comment

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

90ish

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After editing a few files I am a bit more skeptical; adding and removing wrapping for entire paragraphs seems quite cumbersome.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's fair - maybe just something to be aware of that you can hard wrap items if you want to and it wont change rendering in the final markdown. Doesn't have to be a hard style guide. Feel free to mention it how you want in the style guide, or not at all - that's fine too

@reint-fischer
Copy link
Contributor Author

Maybe I missed the discussion - why the verbose_progress=False?

Thanks for bringing this up, it was a temporary fix for the way MyST-NB currently outputs the progressbar, but I found that hiding the cell outputs is a better solution. I had already managed to do this for the .md notebooks, but have now also implemented it for the .ipynb notebooks.

@reint-fischer reint-fischer merged commit 5f2e8ec into v4-dev Nov 14, 2025
19 of 20 checks passed
@reint-fischer reint-fischer deleted the MyST-quickstart branch November 14, 2025 13:30
@github-project-automation github-project-automation bot moved this from Ready to Done in Parcels development Nov 14, 2025
@erikvansebille
Copy link
Member

🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Handling of tutorial notebook cell outputs in v4

4 participants