From e82dcf563ff306cd57bf4c43ad38195cd23b6f09 Mon Sep 17 00:00:00 2001 From: Dawid Makar Date: Wed, 27 Sep 2023 10:09:40 +0200 Subject: [PATCH] Automatic refactoring. Refactoring step id: UUID('80a75610-0589-4285-85cd-9cedf86e7d52') --- doc/make.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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