Skip to content
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

Don't link to examples on the main branch in documentation #816

Merged
merged 1 commit into from
Aug 10, 2021

Conversation

rahulporuri
Copy link
Contributor

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, the 5.0.0 tag will be used instead of the main branch.

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.0 and the links worked as expected, pointing to the 5.0.0 tree instead of main.

Note that this commit also creates the new github-demo external link using the extlinks sphinx 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.

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
Copy link
Member

the examples links will be broken as expected as the dev version has no corresponding tag on GitHub

This makes me wonder whether this is really the right thing to do.

Copy link
Member

@mdickinson mdickinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@rahulporuri rahulporuri merged commit 0907d1d into main Aug 10, 2021
@rahulporuri rahulporuri deleted the doc/version-specific-examples branch August 10, 2021 09:40
@corranwebster corranwebster added the needs backport Needs to be backported to current maint/* label Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs backport Needs to be backported to current maint/*
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants