From: Simon South Date: Tue, 13 Oct 2020 00:14:42 +0000 (-0400) Subject: doc: generate Info manual X-Git-Tag: v5.2.0~13^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02ae931378c8821ff2681deeaf5d37c808f0086a;p=thirdparty%2Fknot-resolver.git doc: generate Info manual Check for makeinfo during configuration and if found, generate and install documentation in Info format. --- diff --git a/.gitignore b/.gitignore index 153c19731..808ba0ec1 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,7 @@ /doc/doxyxml /doc/html /doc/kresd.8 +/doc/texinfo /install-sh /libkres.pc /libtool diff --git a/doc/build.rst b/doc/build.rst index 20d75ca80..e844b6046 100644 --- a/doc/build.rst +++ b/doc/build.rst @@ -51,6 +51,8 @@ Resolver: "Doxygen_", "``documentation``", "Generating API documentation." "Sphinx_ and sphinx_rtd_theme_", "``documentation``", "Building this HTML/PDF documentation." + "Texinfo_", "``documentation``", "Generating this documentation in Info + format." "breathe_", "``documentation``", "Exposing Doxygen API doc to Sphinx." "libsystemd_", "``daemon``", "Systemd watchdog support." "libprotobuf_ 3.0+", "``modules/dnstap``", "Protocol Buffers support for @@ -288,6 +290,7 @@ For development, it's possible to build the container directly from your git tre .. _breathe: https://github.com/michaeljones/breathe .. _Sphinx: http://sphinx-doc.org/ .. _sphinx_rtd_theme: https://pypi.python.org/pypi/sphinx_rtd_theme +.. _Texinfo: https://www.gnu.org/software/texinfo/ .. _pkg-config: https://www.freedesktop.org/wiki/Software/pkg-config/ .. _libknot: https://gitlab.nic.cz/knot/knot-dns .. _cmocka: https://cmocka.org/ diff --git a/doc/conf.py b/doc/conf.py index fcc1c99c7..7ebef5b12 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -83,3 +83,13 @@ man_pages = [ ('index', 'libkres', u'libkres documentation', [u'CZ.NIC Labs'], 1) ] + +# -- Options for Texinfo output ------------------------------------------------ + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ('index', 'knot-resolver', u'Knot Resolver', u'CZ.NIC Labs', + 'Knot Resolver', 'Caching DNS resolver.', 'Network services'), +] diff --git a/doc/meson.build b/doc/meson.build index cfb5a55e4..360cdfd7f 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -19,7 +19,7 @@ man_kresd = configure_file( install_man(man_kresd) -# html documentation +# html and info documentation if get_option('doc') == 'enabled' message('--- doc dependencies ---') doxygen = find_program('doxygen') @@ -27,6 +27,7 @@ if get_option('doc') == 'enabled' if not sphinx_build.found() sphinx_build = find_program('sphinx-build') endif + makeinfo = find_program('makeinfo', required: false) # python dependencies: breathe, sphinx_rtd_theme python_breathe = run_command('python3', '-c', 'import breathe') @@ -54,6 +55,16 @@ if get_option('doc') == 'enabled' join_paths(meson.current_source_dir(), 'html'), install_dir: doc_dir, ) + + if makeinfo.found() + # install info docs + install_subdir( + join_paths(meson.current_source_dir(), 'texinfo'), + strip_directory: true, + exclude_files: ['Makefile', 'knot-resolver.texi'], + install_dir: info_dir, + ) + endif endif make_doc = find_program('../scripts/make-doc.sh') diff --git a/meson.build b/meson.build index 1148e6a9c..f618f420b 100644 --- a/meson.build +++ b/meson.build @@ -47,6 +47,7 @@ endif prefix = get_option('prefix') data_dir = join_paths(prefix, get_option('datadir'), 'knot-resolver') doc_dir = join_paths(prefix, get_option('datadir'), 'doc', 'knot-resolver') +info_dir = join_paths(prefix, get_option('datadir'), 'info') examples_dir = join_paths(doc_dir, 'examples') etc_dir = join_paths(prefix, get_option('sysconfdir'), 'knot-resolver') lib_dir = join_paths(prefix, get_option('libdir'), 'knot-resolver') diff --git a/scripts/make-doc.sh b/scripts/make-doc.sh index 9d4761218..0abd9254a 100755 --- a/scripts/make-doc.sh +++ b/scripts/make-doc.sh @@ -15,3 +15,9 @@ 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 && \ + make -C doc/texinfo info +fi