allow to check for links to "external" (non-sphinx-generated) files

Mikhail Gusarov avatarMikhail Gusarov created an issue

Just found accidentally neglected bugreport in Debian bugtracker ( http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=546612 ):

Currently if ReST source links to some location on the same website, which was not generated by sphinx, e.g.:

.. _PDF-guide: PyMVPA-DevGuide.pdf

.. _API Reference: api/index.html

then linkcheck complaints:

index.rst:76: [malformed] PyMVPA-DevGuide.pdf

index.rst:78: [malformed] api/index.html

looking at CheckExternalLinksBuilder it seems to have no ability (yet) to check simply either that URI leads to some local file, which is indeed present, and thus is a legal link.

Patch I guess should be quite minimal (os.path.exists) or might be extended with checks either it is readable/available etc.

Comments (3)

  1. Matt Williams

    I'm not sure that it should even check that the file exists. It's quite common to generate the Sphinx docs locally and only then upload into the webspace. In this case, at Sphinx build-time the files wouldn't be there anyway. I guess a workaround would be to make those links absolute.

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.