diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:26:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:26:00 +0000 |
commit | 830407e88f9d40d954356c3754f2647f91d5c06a (patch) | |
tree | d6a0ece6feea91f3c656166dbaa884ef8a29740e /scripts/make-doc.sh | |
parent | Initial commit. (diff) | |
download | knot-resolver-830407e88f9d40d954356c3754f2647f91d5c06a.tar.xz knot-resolver-830407e88f9d40d954356c3754f2647f91d5c06a.zip |
Adding upstream version 5.6.0.upstream/5.6.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/make-doc.sh')
-rwxr-xr-x | scripts/make-doc.sh | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/scripts/make-doc.sh b/scripts/make-doc.sh new file mode 100755 index 0000000..d41e234 --- /dev/null +++ b/scripts/make-doc.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0-or-later +cd "$(dirname ${0})/.." + +pushd doc +doxygen +popd + +SPHINX=$(command -v sphinx-build-3) +if [ $? -ne 0 ]; then + SPHINX=$(command -v sphinx-build) +fi + +set -o errexit -o nounset + +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 |