Skip to content

Commit

Permalink
Modified doc/make.py to run sphinx-build -b linkcheck (#54265)
Browse files Browse the repository at this point in the history
* 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 <10647082+mroeschke@users.noreply.github.com>

* 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 <github.pmeier@posteo.de>

* Update doc/make.py

Co-authored-by: Philip Meier <github.pmeier@posteo.de>

* Update make.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
Co-authored-by: Philip Meier <github.pmeier@posteo.de>
  • Loading branch information
4 people committed Sep 19, 2023
1 parent cb5b2e6 commit f1bf7d4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions doc/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -288,6 +288,12 @@ def zip_html(self):
os.chdir(dirname)
self._run_os("zip", zip_fname, "-r", "-q", *fnames)

def linkcheck(self):
"""
Check for broken links in the documentation.
"""
return self._sphinx_build("linkcheck")


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

0 comments on commit f1bf7d4

Please sign in to comment.