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

Adding a ipynb into existing sphinx-gallery #1306

Open
timonmerk opened this issue May 7, 2024 · 1 comment
Open

Adding a ipynb into existing sphinx-gallery #1306

timonmerk opened this issue May 7, 2024 · 1 comment

Comments

@timonmerk
Copy link

timonmerk commented May 7, 2024

Sphinx-gallery allows for automatic ipynb generation and adds the computes ipynb files in the auto_examples directory. I have now a ipynb that I want to statically add to the exisiting generated examples. I could add it manually after the notebooks have been generated but wondered if there is another option to embedd the notebook into the existing gallery? Many thanks!

Edit: I checked the discussion here #245 and tested the mentioned conversion file: https://gist.github.com/chsasank/7218ca16f8d022e02a9c0deb94a310fe However, this is not directly solving the issue that I have a couple of figures pre-computed in the ipynb, that should not be recomputed in the generated .py file. So I basically just looking for a simple method to include the .ipynb file in the existing gallery.

@larsoner
Copy link
Contributor

There is no option to do this. I think the most flexible option for use cases like this is hooking into Sphinx's event system to either modify the loaded RST on the fly and add what you want where you want it, and copy the files where they need to go.

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