Don't link to examples on the main branch in documentation#816
Merged
Conversation
instead, the documentation should use version-specific links to ensure that the links dont break inadvertantly this commit also refactors the sphinx machinery to use the extlinks sphinx extension and create the github-demo external link, which is what is used in the documentation to link to version-specific links note that this commit also fixes a number of broken links in the annotated examples page of the docs modified: docs/source/annotated_examples.rst modified: docs/source/conf.py modified: docs/source/user_manual/chaco_tutorial.rst modified: docs/source/user_manual/tutorial_hyetograph.rst modified: docs/source/user_manual/tutorial_van_der_waal.rst
mdickinson
reviewed
Aug 10, 2021
Member
This makes me wonder whether this is really the right thing to do. |
mdickinson
approved these changes
Aug 10, 2021
Member
mdickinson
left a comment
There was a problem hiding this comment.
This PR LGTM, but I'm wondering whether we should rethink the approach altogether: it might be better if the built documentation were self-contained and didn't rely on links to GitHub. I'm not sure what particular advantage the GitHub links are providing for documentation users.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At the moment, the documentation links to examples on the
main/default branch. This isn't right because the examples might change in between releases, potentially confusing users who are referring to the documentation. This PR fixes that problem by making the documentation use version-specific links i.e. for the 5.0.0 release, the5.0.0tag will be used instead of themainbranch.I tested this locally by checking the links generated in the built docs - the examples links will be broken as expected as the dev version has no corresponding tag on GitHub. I then hardcoded the version in the sphinx configuration to
5.0.0and the links worked as expected, pointing to the5.0.0tree instead ofmain.Note that this commit also creates the new
github-demoexternal link using theextlinkssphinx extension. This is how we create the version-specific links in this PR and this is what we do in other ETS projects.Note also that this PR also fixes broken links in the annotated examples page of the documentation.