Skip to content

Commit 98b0c93

Browse files
committed
doc: add switch to doc building script to ensure that the docs build from scratch
1 parent fe71982 commit 98b0c93

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

scripts/mkdoc.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,22 @@
44
#
55
# Usage: ./mkdoc.sh (makes API and tutorial docs)
66
# ./mkdoc.sh -d (makes a Dash docset based on standalone docs, requires doc2dash)
7-
7+
#
8+
# Add -c to ensure that the documentation is built from scratch and no cached
9+
# assets from previous builds are used.
10+
#
811
# Make sure we bail out on build errors
912
set -e
1013

1114
DOC2DASH=0
1215
LINKCHECK=0
16+
CLEAN=0
1317

14-
while getopts ":sjdl" OPTION; do
18+
while getopts ":scjdl" OPTION; do
1519
case $OPTION in
20+
c)
21+
CLEAN=1
22+
;;
1623
d)
1724
DOC2DASH=1
1825
;;
@@ -66,10 +73,13 @@ rm -f dist/*.whl && .venv/bin/pip wheel -q -w dist . && .venv/bin/pip install -q
6673
echo "Patching modularized Graph methods"
6774
.venv/bin/python3 ${SCRIPTS_FOLDER}/patch_modularized_graph_methods.py
6875

69-
7076
echo "Clean previous docs"
7177
rm -rf "${DOC_HTML_FOLDER}"
7278

79+
if [ "x$CLEAN" = "x1" ]; then
80+
# This is generated by sphinx-gallery
81+
rm -rf "${DOC_SOURCE_FOLDER}/tutorials"
82+
fi
7383

7484
if [ "x$LINKCHECK" = "x1" ]; then
7585
echo "Check for broken links"

0 commit comments

Comments
 (0)