From: Simon South Date: Thu, 15 Oct 2020 11:13:20 +0000 (-0400) Subject: doc/info: create and install figures X-Git-Tag: v5.2.0~13^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b46079037c0a89cd2103b4841abc4b1eea38c7c5;p=thirdparty%2Fknot-resolver.git doc/info: create and install figures --- diff --git a/doc/meson.build b/doc/meson.build index a911f9238..f06b6e30b 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -58,9 +58,6 @@ if get_option('doc') == 'enabled' if makeinfo.found() # install info docs - # FIXME: Sphinx < 2 doesn't create a separate directory for figures, while - # a newer one does. To simplify packaging, figures for info pages are - # compleltely omitted for now. install_subdir( join_paths(meson.current_source_dir(), 'texinfo', '.install'), strip_directory: true, diff --git a/scripts/make-doc.sh b/scripts/make-doc.sh index 5cc18302e..d41e234c9 100755 --- a/scripts/make-doc.sh +++ b/scripts/make-doc.sh @@ -18,8 +18,25 @@ ${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 && \ - make -C doc/texinfo info + ${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/.install/ + mv doc/texinfo/knot-resolver.info \ + doc/texinfo/knot-resolver-figures \ + doc/texinfo/.install/ fi