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

Cleanup links #59

Closed
tbielawa opened this Issue Jul 8, 2016 · 3 comments

Comments

Projects
None yet
1 participant
@tbielawa
Copy link
Owner

tbielawa commented Jul 8, 2016

Just discovered the sphinx-build commands make linkcheck target.

Criteria

  • Fix broken links
  • Cleanup redirects
@tbielawa

This comment has been minimized.

Copy link
Owner

tbielawa commented Jul 8, 2016

Generate linkcheck results with cd docsite/; make linkcheck. This produces a file build/linkcheck/output.txt. Using this grep command we can view both broken and redirects:

$ grep -E '(redirect|broken)' build/linkcheck/output.txt | grep -v "readthedocs" | sed -r "s/(.*)/\* \1/"

Swap the -E '(redirect|broken)' with either redirect or broken to filter the results (like shown below). For example, broken links

$ grep broken build/linkcheck/output.txt | grep -v "readthedocs" | sed -r "s/(.*)/\* \1/"

Broken Links

Redirects

Read the docs does some redirects. Results below omit the readthedocs.org to readthedocs.io warnings

@tbielawa tbielawa closed this in 6b6552a Jul 8, 2016

@tbielawa

This comment has been minimized.

Copy link
Owner

tbielawa commented Jul 8, 2016

Post the closing commit the linkcheck results now look as such

$ grep -E '(redirect|broken)' build/linkcheck/output.txt | grep -v "readthedocs" | sed -r "s/(.*)/\* \1/"
* contributing.rst:36: [redirected with Found] https://github.com/tbielawa/bitmath/issues/new to https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftbielawa%2Fbitmath%2Fissues%2Fnew
* contributing.rst:43: [redirected permanently] http://www.python.org/dev/peps/pep-0008 to https://www.python.org/dev/peps/pep-0008/
* contributing.rst:192: [redirected permanently] http://www.python.org/dev/peps/pep-0008 to https://www.python.org/dev/peps/pep-0008/
* contributing.rst:162: [redirected permanently] http://www.python.org/dev/peps/pep-0008 to https://www.python.org/dev/peps/pep-0008/
* module.rst:408: [redirected permanently] http://www.python.org/dev/peps/pep-0343 to https://www.python.org/dev/peps/pep-0343/
* module.rst:410: [redirected permanently] http://www.python.org/dev/peps/pep-0318 to https://www.python.org/dev/peps/pep-0318/

I'm going to ignore those readthedocs redirects. Maybe there's a way to change the generated URLs, maybe there isn't....

Likewise with the pep8 redirect links. Those are generated by sphinx, and python.org hosts on https by default now (which is awesome!) so the generated links from sphinx should be https.

  • I should file a bug for this. Or maybe submit a PR.
@tbielawa

This comment has been minimized.

Copy link
Owner

tbielawa commented Jul 8, 2016

I installed a newer version of sphinx from pip. The new version generates the pep links using https.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment