-
Notifications
You must be signed in to change notification settings - Fork 5
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
Integrating sphinx gallery to run documentation #234
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #234 +/- ##
==========================================
+ Coverage 75.75% 79.37% +3.62%
==========================================
Files 70 62 -8
Lines 4615 4567 -48
==========================================
+ Hits 3496 3625 +129
+ Misses 1119 942 -177
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
fc1e8b2
to
4ab5910
Compare
For getting the widget to work in the CI my first approach was to implement the repr_html but this did not work for some reasons (I assume because of some JS code?). Then I moved to just moving the html files. There is already a function in the I thought about how to integrate the generated files into the the docs/source. Because the generation of the files creates a page with a gallery, it is best to always create a subfolder for this as it would otherwise overwrite the Note for me: |
8cfd513
to
1d78a63
Compare
sphinx-gallery allows to generate .rst file from sphinx-gallery scripts (extended python files with more formatting functionalities). This way we can run the code in the documentation in the CI for each PR. In this PR only the ipynb in `docs/source/concept` have been converted to sphinx-gallery scripts.
c774519
to
6c92221
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
pip install .[docs] | ||
pip install -r docs/requirements.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we copy the dependencies from the docs
to the requirements.txt
, so that we only need to run
pip install -r docs/requirements.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I want to do it in another PR. But I actually wanted to merge them to the extras .[docs], as we anyway have to specify the building commands now.
print() | ||
print(copy_print_info) | ||
print(len(copy_print_info) * "=") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this for debug purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say it is on the info level. I would keep it, because it useful information and makes more transparent what happens to the user. I did not realize that the html files by this are copied until I saw the code. Maybe there is a better way to integrate it with the other sphinx messages, but for now this is okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually there seems to be sphinx logging utils. I make an issue for this.
https://www.sphinx-doc.org/en/master/extdev/logging.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made an issue #244
Draft trying out sphinx gallery. I chose sphinx gallery because most of the documentation are already ipynb that can be directly transferred to sphinx-gallery compatible python files while with sphinx-jupyter you need to transform them manually to .rst files.
Locally it worked, but need to check if it works also on readthedocs. For now it is just transforming the concept/task.ipynb.
TODOs:
For future PRs