summaryrefslogtreecommitdiffstats
path: root/scripts/make-doc.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 20:37:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 20:37:50 +0000
commitc1f743ab2e4a7046d5500875a47d1f62c8624603 (patch)
tree709946d52f5f3bbaeb38be9e3f1d56d11f058237 /scripts/make-doc.sh
parentInitial commit. (diff)
downloadknot-resolver-c1f743ab2e4a7046d5500875a47d1f62c8624603.tar.xz
knot-resolver-c1f743ab2e4a7046d5500875a47d1f62c8624603.zip
Adding upstream version 5.7.1.upstream/5.7.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/make-doc.sh')
-rwxr-xr-xscripts/make-doc.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/scripts/make-doc.sh b/scripts/make-doc.sh
new file mode 100755
index 0000000..35c4e73
--- /dev/null
+++ b/scripts/make-doc.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0-or-later
+set -o errexit -o nounset
+cd "$(dirname "${0}")/.."
+
+pushd doc
+doxygen
+popd
+
+SPHINX=$(type -P sphinx-build-3 sphinx-build | head -n1)
+rm -rf doc/html
+"$SPHINX" "$@" -b html -d doc/.doctrees doc doc/html
+
+if command -v makeinfo &>/dev/null; then
+ rm -rf doc/texinfo
+ ${SPHINX} ${@} -b texinfo -d doc/.doctrees doc doc/texinfo
+
+ # Sphinx < 2 doesn't create a separate directory for figures, so if
+ # necessary move them to the correct location and update the references in
+ # the generated Texinfo file
+ if [ ! -d doc/texinfo/knot-resolver-figures ]; then
+ cd doc/texinfo
+ mkdir knot-resolver-figures
+ mv *.png *.svg knot-resolver-figures/
+ sed -e 's/\(@image{\)/\1knot-resolver-figures\//' \
+ knot-resolver.texi > knot-resolver.texi.tmp
+ mv knot-resolver.texi.tmp knot-resolver.texi
+ cd ../..
+ fi
+
+ make -C doc/texinfo info
+
+ mkdir doc/texinfo/.install
+ mv doc/texinfo/knot-resolver.info \
+ doc/texinfo/knot-resolver-figures \
+ doc/texinfo/.install/
+fi