Skip to content
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

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

Open
GenevieveBuckley opened this issue Feb 2, 2024 · 1 comment

Comments

@GenevieveBuckley
Copy link
Contributor

Execute .ipynb jupyter notebook files for the examples gallery.

This nice to have to-do item came up during development of #200

#200 (comment)

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.

#200 (comment)

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
Copy link
Member

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.

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

No branches or pull requests

2 participants