]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
doc/info: create and install figures
authorSimon South <simon@simonsouth.net>
Thu, 15 Oct 2020 11:13:20 +0000 (07:13 -0400)
committerTomas Krizek <tomas.krizek@nic.cz>
Thu, 15 Oct 2020 11:22:51 +0000 (13:22 +0200)
doc/meson.build
scripts/make-doc.sh

index a911f92389cb78815113842b3d6da304be677189..f06b6e30bbcd870ef3d6e34d906d31be1d5646fe 100644 (file)
@@ -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,
index 5cc18302ef3b501cfd4fe2d7dbbc86a4cc0cc771..d41e234c938d159530f4b7058af8cf07cf1a21a5 100755 (executable)
@@ -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