sphinx-doc/sphinx

Warning for invalid relative link anchors

Open

#5128 aperta il 28 giu 2018

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)Python (1985 fork)batch import
builder:linkcheckhelp wantedtype:proposal

Metriche repository

Star
 (5625 star)
Metriche merge PR
 (Merge medio 10g 11h) (11 PR mergiate in 30 g)

Descrizione

If I have something like

`link <file.html#anchor>`_

and file.html exists and is part of the project, and #anchor is not a valid anchor for that file, it should raise a warning in the build.

Alternately, it would be nice if linkcheck checked anchors for relative links.

The problem is that I'm using recommonmark, which doesn't support cross-referencing. I'm perfectly fine writing out the anchors manually (believe me, it's worth it to support formatted text in links), but it would be nice to have some checking. Right now, I have been using the W3C validator on my site after it has been published to check for invalid anchors.

Guida contributor