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
Add notebook execution buttons to the sphinx gallery notebook pages #764
Comments
Hi I would like to work on this issue. |
I expect the config values needed will be
As you can tell the branch changes depending on the version since the documentation is built in multiple versions. I'm hoping the same version parsing will work for us (https://github.com/scikit-learn/scikit-learn/blob/309f135c3284d7db6e23ca81a87948c7066a3949/doc/conf.py#L282 and following), but it's not clear that it will. You may have to try it out. If that doesn't work, just use "main" as the branch. The dependencies file is a new file (which is mentioned in the issue description). I have no particular opinion on jupyter lab, but you can try it with |
Thanks @romanlutz for your quick reply. Is the requirements.txt used in If you look at scikit docs, the requirements.txt requirements.txt there is actually nothing. So what should be there in requirements.txt in our case? Also it would be very helpful if you can point to some link which you used to setup sphinx_gallery configuration for our project, to get a better idea of the library used. |
Seems like scikit-learn has a special setup with a separate repo for this. You can check their binder repo to see what's in the requirements file. Probably just the main dependencies we have in our requirements.txt plus the package itself. I'd just try it out by pointing at an empty file and if it fils try adding dependencies. Binder is free so there's no real cost associated with trying this. You can check the Sphinx Gallery docs https://sphinx-gallery.github.io/stable/index.html |
@kurianbenoy I just wanted to check in how it's going. There's no particular time pressure, but if you need help let us know. Also, if you're not planning to continue we can make this available to someone else. We're also starting to do pair programming sometimes, so if that's interesting to you please don't hesitate to ask. |
@romanlutz, was a bit busy the past few weeks. I couldn't work on it for a few weeks now, but I would definitely like to continue doing this if there is no time pressure. |
@kurianbenoy there is no pressure at all! Good to know, and let us know if there's any way we can help. |
@romanlutz how can I bring the docs website up? Is it by the command: Also another question, does the team prefer to use |
https://fairlearn.org/main/contributor_guide/contributing_documentation.html should help 🙂 I don't have a preference between lab and notebook. How does it affect the task? |
@romanlutz just noticed when checking our docs/conf.py that the copyright is hardcoded. Can we make it dynamic like the Scikit-learn docs configuration [1] ? Also should we give a start year like scikit docs? Can I create a ticket for it? |
I am a bit confused on what should we give for the Reference link: |
maybe this would be of some help? https://github.com/scikit-learn/scikit-learn/tree/main/.binder |
I will check it out. Maybe the postbuild file maybe helpful to solve the issue. |
A few clarifications:
|
Ok, I am ignoring the notebooks section and using default value for notebooks. Also I have added requirements.txt in .binder folder. |
Our notebook pages on the website (such as this one) have download buttons, but we can't execute them directly on Binder, Azure Notebooks, Google Colab, etc.
Scikit-learn has a button for Binder (e.g., in this example) so this should be possible to add since we're using a similar set of sphinx extensions such as sphinx-gallery.
The way scikit-learn achieves this is by adding the following lines to the sphinx gallery configuration: https://github.com/scikit-learn/scikit-learn/blob/309f135c3284d7db6e23ca81a87948c7066a3949/doc/conf.py#L338
... and there's a dedicated
requirements.txt
file.Other than adding that requirements file and the configuration for sphinx gallery, this would require building the website. Instructions are on this page, but I suggest going with the "simple" method rather than building the website for all versions. After all, we wouldn't expect the button to show up in past versions.
The text was updated successfully, but these errors were encountered: