Skip to content

Add notebook rendering to the docs#131

Merged
raar1 merged 10 commits intomainfrom
issue114_notebooks_in_docs
Feb 4, 2026
Merged

Add notebook rendering to the docs#131
raar1 merged 10 commits intomainfrom
issue114_notebooks_in_docs

Conversation

@raar1
Copy link
Collaborator

@raar1 raar1 commented Jan 19, 2026

Adds notebook rendering to the documentation using an mkdocs plugin. Notebooks are now in an examples directory within docs/. The notebooks that are included can be configured in the mkdocs.yml.

Fixes #114

@raar1 raar1 requested a review from JoYvBa January 19, 2026 12:35
@raar1
Copy link
Collaborator Author

raar1 commented Jan 19, 2026

@JoYvBa Have a quick look at the rendering if you like (you can try it locally with mkdocs serve). I don't have the latex stuff rendering properly yet, so I'm looking into that. But if you can think of which notebooks we might want to have here already then please suggest them here. I know you have some new examples in another PR, so we can also wait and include some of those when it's merged.

@JoYvBa
Copy link
Collaborator

JoYvBa commented Jan 20, 2026

This looks great, documentation really takes shape like this! Also makes it easier to spot mistakes in the examples. I spotted a few, most of which are easily fixed. There are also some things not rendering properly;

  • Full equations are not rendered at all, perhaps same fix as in the background documentation, but that may then not render properly in the notebooks themselves.
  • Inline math using $$; still shows the dollar signs and does not convert to math.
  • Animations are not shown, and every plot below the %matplotlib magic is not shown either.

Perhaps good idea to merge this after my documentation pull request, then we can do everything right in one go!

@raar1 raar1 force-pushed the issue114_notebooks_in_docs branch from e0f9de7 to 57134ef Compare February 4, 2026 13:31
@raar1
Copy link
Collaborator Author

raar1 commented Feb 4, 2026

Thanks for the review! I managed to get the equations to render, but it looks like the animations will have to wait. As we discussed today, I will merge this now and then we can adapt the documentation PR a bit (I think we agreed we will move animations to a python script, rather than notebook, so perhaps we can get the animations that way instead).

@raar1 raar1 marked this pull request as ready for review February 4, 2026 13:58
Copy link
Collaborator

@JoYvBa JoYvBa left a comment

Choose a reason for hiding this comment

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

@raar1 Looks good Robin, thanks for getting this to work! Animations will indeed have to be done through regular scripts, their behavior in the notebooks is too volatile. Better have something robust than something that breaks every so often (or specifically here; not rendering at all).

@JaroCamphuijsen JaroCamphuijsen self-requested a review February 4, 2026 14:13
Copy link
Contributor

@JaroCamphuijsen JaroCamphuijsen 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 @raar1, as we discussed, maybe check whether we can only execute the notebooks when deploying the documentation instead of upon every commit.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 4, 2026

@raar1
Copy link
Collaborator Author

raar1 commented Feb 4, 2026

There does not appear to be any way to pass the parameters to the commandline tool (especially not a parameter of a plugin). So I think the only way to do this is to add a CI step that modifies the mkdocs.yml to set that execute parameter to false, only during docs test builds.

I've done this with a python script that does at least some checks (so it's slightly less hacky...)

@raar1 raar1 merged commit 3a65a0f into main Feb 4, 2026
9 checks passed
@raar1 raar1 deleted the issue114_notebooks_in_docs branch February 4, 2026 15:22
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.

Show rendered example notebooks in documentation

3 participants