diff --git a/doc/make.py b/doc/make.py index 9db4ea406bc1f..9f2ec67466993 100755 --- a/doc/make.py +++ b/doc/make.py @@ -123,14 +123,14 @@ def _sphinx_build(self, kind: str): Parameters ---------- - kind : {'html', 'latex'} + kind : {'html', 'latex', 'linkcheck'} Examples -------- >>> DocBuilder(num_jobs=4)._sphinx_build('html') """ - if kind not in ("html", "latex"): - raise ValueError(f"kind must be html or latex, not {kind}") + if kind not in ("html", "latex", "linkcheck"): + raise ValueError(f"kind must be html, latex or linkcheck, not {kind}") cmd = ["sphinx-build", "-b", kind] if self.num_jobs: @@ -268,6 +268,12 @@ def latex_forced(self): """ return self.latex(force=True) + def linkcheck(self): + """ + Check the links in the documentation for validity. + """ + return self._sphinx_build("linkcheck") + @staticmethod def clean(): """ @@ -373,4 +379,4 @@ def main(): if __name__ == "__main__": - sys.exit(main()) + sys.exit(main()) \ No newline at end of file