Skip to content

Commit f1bf7d4

Browse files
ggold7046pre-commit-ci[bot]mroeschkepmeier
authored
Modified doc/make.py to run sphinx-build -b linkcheck (#54265)
* Modified doc/make.py to run sphinx-build -b linkcheck * Update make.py * Update make.py * Update make.py * Update make.py * Update make.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update doc/make.py Co-authored-by: Matthew Roeschke <[email protected]> * Update make.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update make.py * Update doc/make.py Co-authored-by: Philip Meier <[email protected]> * Update doc/make.py Co-authored-by: Philip Meier <[email protected]> * Update make.py --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Matthew Roeschke <[email protected]> Co-authored-by: Philip Meier <[email protected]>
1 parent cb5b2e6 commit f1bf7d4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

doc/make.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ def _sphinx_build(self, kind: str):
123123
124124
Parameters
125125
----------
126-
kind : {'html', 'latex'}
126+
kind : {'html', 'latex', 'linkcheck'}
127127
128128
Examples
129129
--------
130130
>>> DocBuilder(num_jobs=4)._sphinx_build('html')
131131
"""
132-
if kind not in ("html", "latex"):
133-
raise ValueError(f"kind must be html or latex, not {kind}")
132+
if kind not in ("html", "latex", "linkcheck"):
133+
raise ValueError(f"kind must be html, latex or linkcheck, not {kind}")
134134

135135
cmd = ["sphinx-build", "-b", kind]
136136
if self.num_jobs:
@@ -288,6 +288,12 @@ def zip_html(self):
288288
os.chdir(dirname)
289289
self._run_os("zip", zip_fname, "-r", "-q", *fnames)
290290

291+
def linkcheck(self):
292+
"""
293+
Check for broken links in the documentation.
294+
"""
295+
return self._sphinx_build("linkcheck")
296+
291297

292298
def main():
293299
cmds = [method for method in dir(DocBuilder) if not method.startswith("_")]

0 commit comments

Comments
 (0)