-
Notifications
You must be signed in to change notification settings - Fork 258
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 version switcher to Sphinx docs #1428
Conversation
Use the `doctest.simpeg.xyz` domain instead.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1428 +/- ##
=======================================
Coverage 82.33% 82.33%
=======================================
Files 171 171
Lines 26019 26019
=======================================
Hits 21422 21422
Misses 4597 4597 ☔ View full report in Codecov by Sentry. |
Since this is changing the format of the documentation page (and I imagine you might start seeing text wrapping soon), I think it's also appropriate to consider a few things:
|
Great. |
@jcapriot would you like to take a look at this? Specially to the scripts for deploying the docs. I added those to experiment and see if the setup works properly on Also, I was considering hosting the docs in a |
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.
Hey @santisoler in general the azure scripts look good, However, do you know if there's a way to serve the doc versions from different branches? (I don't think there's a way in github pages, but there could be something else.)
My thought is to avoid doing the git-clone on the entire documentation website (as it will continually get larger and larger with each release). Instead just commit it's own documentation to a specific branch.
Maybe through using git's submodules with github pages might work... |
Include instructions to update `versions.json` while generating the release notes.
I think one can only serve one GH page per repo. Basically, we can only configure GH Pages on a single branch. While reading your first comment I thought the same: git submodules. But I'm not sure if GH Pages follow the submodules when "generating" the Pages. Every time we push a change to a branch that is serving a GH Page, an Action triggers that "generates the update". I think it basically checks if it needs to run Jekyll or not, and then make the html files available through their webserver. I'm not sure if in that process they also follow all submodules and include those html files. |
That makes sense. I forgot we need to update the submodules as well. Regarding your proposal, I think it would be better to have versions in their own branches. Mainly because in case we need to apply changes to old docs (change analytics, add a banner, etc), it would be a lot easier than trying to insert commits in the history of the single |
This would allow to other stages to perform tasks with the built docs.
I'm rethinking the deployment process. I think having the dev docs in a separate branch is great to avoid a commit history that will grow to large. But the documentation for releases ideally won't change in time. So having all the tagged docs in separate branches makes the process more complex without adding any benefit. So, what if we keep the dev docs in the |
Instead of pushing the release docs to a separate branch and add a submodule in `gh-pages`, now the deployment step commits the built docs in a new folder in `gh-pages` and updates the `latest` symlink.
Match the name of the latest release in the version switcher with the subdirectory where it'll live.
Make the dev docs will be more discoverable by putting them on top of the list.
Add a checkout step in Azure Pipelines as part of the deployment of docs that fetches tags and disables shallow depth: this way we can get the SimPEG version while building the docs.
I'm merging this one. I'm quite happy with the setup. It's still experimental so I'll have to open another PR to update the repo where docs should be pushed and the location of the |
Summary
Add a version switcher to the navbar of the docs, using the built in one in PyData Sphinx theme. Point to the experimental
versions.json
file located indoctest.simpeg.xyz
that should serve the files in simpeg/simpeg-doctest. Add experimental staged to Azure Pipelines that pushes docs to thesimpeg-doctest
repository. One is triggered nightly and deploys the latest docs inmain
to thedev
branch insimpeg-doctest
and updates thedev
submodule ingh-pages
. The other one is triggered after a release and pushes the new version of the docs togh-pages
branch insimpeg-doctest
onto a new folder, while also updating thelatest
link.PR Checklist
expect style.
to a Pull Request
@simpeg/simpeg-developers
when ready for review.Reference issue
What does this implement/fix?
Additional information
TODO:
versions.json
filemain
. Docs should be pushed to replace the content of thedev
folder where the docs are being hosted.