Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

have sphinx report broken links

When building html documentation, how do you force sphinx to report, or create an error, on links that don't exist?

Specifically, I have properties and methods within my Python project that have been removed or renamed, and it is hard to find all the dead links with the sphinx generated html output.

I feel like I'm staring at the answer here: http://sphinx-doc.org/glossary.html, as descriped in the opening paragraph.

I'm obviously not understanding something.

like image 770
Idaho Avatar asked Jan 24 '13 02:01

Idaho


2 Answers

Set the nitpicky configuration variable to True (you can also use the -n option when running sphinx-build).

In nitpicky mode, a cross-reference to a function (such as :func:`myfunc`), class, or other object that cannot be found will generate a warning message.

like image 113
mzjn Avatar answered Nov 14 '22 21:11

mzjn


I think CheckExternalLinksBuilder is what you're looking for.

It's basically used by calling 'sphinx-build' with -b linkcheck option. Please see sphinx-build for more info. Also, take a look at the list of sphinx-extensions here and here.

like image 24
alecxe Avatar answered Nov 14 '22 21:11

alecxe