Skip to content

Commit d5f57aa

Browse files
committed
fix pdf doc build, add broken link checking to linter
1 parent c440328 commit d5f57aa

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

check.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,11 @@ poetry check
1818
poetry run pip check
1919
cd ./doc
2020
poetry run doc8 --ignore-path build --max-line-length 100 -q
21+
# check for broken links in the docs ############
22+
poetry run sphinx-build -b linkcheck -q -D linkcheck_timeout=5 ./source ./build > /dev/null 2>&1
23+
if [ $? -ne 0 ]; then
24+
cat ./build/output.txt
25+
exit 1
26+
fi
27+
#################################################
2128
cd ..

doc/source/conf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os
44
from pathlib import Path
55
from sphinx.ext.autodoc import between
6+
import shutil
67
import django
78

89
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_typer.tests.settings.base')
@@ -97,4 +98,8 @@ def setup(app):
9798
# app.connect('html-page-context', add_page_class)
9899

99100
app.add_directive("literalinclude", ExtendedLiteralInclude)
101+
102+
# https://sphinxcontrib-typer.readthedocs.io/en/latest/howto.html#build-to-multiple-formats
103+
if Path(app.doctreedir).exists():
104+
shutil.rmtree(app.doctreedir)
100105
return app

0 commit comments

Comments
 (0)