You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a Python library whose documentation is being built with Sphinx. We've recently decided to change over to the Sphinx Book theme for our next release. We want to add the launch button into our examples so users can easily try out the library, but there are some issues.
The examples in the documentation are being built with Sphinx Gallery, and to the best of my knowledge this is how the build process goes:
A .py file with comments designating notebook cells and ReStructuredText is fed in (syntax)
The .py file is converted to a .rst and .ipynb file. The notebook file available for download but not used (or accessible) in the rest of the build process.
Jupyter Book converts the .rst file into html, but no launch buttons appear
In the html code, the comment <!-- Launch buttons --> exists and copying over the div representing the button from here makes the button appear on our documentation. Adjusting the html code to fit our GitHub and Binder links also works perfectly and the page is even executable with Thebe! This makes me think a relatively easy solution exists to add the launch button to pages created from Sphinx Gallery since the structure is the same as one built using Jupyter Book.
So here's my question: Is there a way to tell Sphinx Book that an rst file is a notebook and to add the launch buttons onto the page?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We have a Python library whose documentation is being built with Sphinx. We've recently decided to change over to the Sphinx Book theme for our next release. We want to add the launch button into our examples so users can easily try out the library, but there are some issues.
The examples in the documentation are being built with Sphinx Gallery, and to the best of my knowledge this is how the build process goes:
.py
file with comments designating notebook cells and ReStructuredText is fed in (syntax).py
file is converted to a.rst
and.ipynb
file. The notebook file available for download but not used (or accessible) in the rest of the build process..rst
file into html, but no launch buttons appearIn the html code, the comment
<!-- Launch buttons -->
exists and copying over the div representing the button from here makes the button appear on our documentation. Adjusting the html code to fit our GitHub and Binder links also works perfectly and the page is even executable with Thebe! This makes me think a relatively easy solution exists to add the launch button to pages created from Sphinx Gallery since the structure is the same as one built using Jupyter Book.So here's my question: Is there a way to tell Sphinx Book that an rst file is a notebook and to add the launch buttons onto the page?
Beta Was this translation helpful? Give feedback.
All reactions