have sphinx report broken links

自古美人都是妖i 提交于 2019-12-05 12:58:02

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/14492743/have-sphinx-report-broken-links

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!