napari / napari-animation

A napari plugin for making animations
https://napari.github.io/napari-animation/
Other
74 stars 27 forks source link

Docs: Execute .ipynb jupyter notebook files for the examples gallery. #204

Open GenevieveBuckley opened 5 months ago

GenevieveBuckley commented 5 months ago

Execute .ipynb jupyter notebook files for the examples gallery.

This nice to have to-do item came up during development of https://github.com/napari/napari-animation/pull/200

https://github.com/napari/napari-animation/pull/200#issuecomment-1909367945

I don't see the ipython notebook example int he built html docs. I had expected to see it appear as a page in the examples gallery. @melissawm is this part working for you?

EDIT: Ah, I see now. Any jupyter notebook files are being deliberately skipped (see setup function in docs/conf.py)

def setup(app):
    """Set up docs build.
    * Ignores .ipynb files to prevent sphinx from complaining about multiple
      files found for document when generating the gallery
    * Rewrites github anchors to be comparable
    * Adds google calendar api key to meetings schedule page
    """
    app.registry.source_suffix.pop(".ipynb", None)

I thought we wanted the notebooks to be executed and included? #70

I see that there is a single line of text in the gallery.rst page linking to it, but that is easy to overlook. It also leaves us vulnerable to the code in that notebook going out of date, and we won't know it produces errors.

https://github.com/napari/napari-animation/pull/200#issuecomment-1914100665

Nice to have, possibly in a later PR:

  • [ ] I'm not sure what the reason for skipping these in the napari/docs is. There might be some tricky technical issue preventing it here too? See this line of code in conf.py.
melissawm commented 5 months ago

Ah, right. We are skipping the ipynb files in the napari docs, because over there all executable content is in myst markdown (with .md extension) and the only ipynb files present are the ones generated by sphinx-gallery - and we don't want to execute those. If you want to commit ipynb files to be executed in these docs, that needs to be dropped.