]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
doc: generate Info manual
authorSimon South <simon@simonsouth.net>
Tue, 13 Oct 2020 00:14:42 +0000 (20:14 -0400)
committerTomas Krizek <tomas.krizek@nic.cz>
Thu, 15 Oct 2020 11:18:01 +0000 (13:18 +0200)
Check for makeinfo during configuration and if found, generate and
install documentation in Info format.

.gitignore
doc/build.rst
doc/conf.py
doc/meson.build
meson.build
scripts/make-doc.sh

index 153c19731ab74ff68a1243a8a16293c1d76b819a..808ba0ec1e9408fd43b4d81a555db910c6cec7a4 100644 (file)
@@ -48,6 +48,7 @@
 /doc/doxyxml
 /doc/html
 /doc/kresd.8
+/doc/texinfo
 /install-sh
 /libkres.pc
 /libtool
index 20d75ca80e414913bda4c02e3a13dbe0238dfd48..e844b60468f82373ae81d9c0019d043594f92b76 100644 (file)
@@ -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/
index fcc1c99c70797ee54d460d0e9faac08650faac23..7ebef5b12ff1e2c0f646eecf22f79f5c1ef1849d 100644 (file)
@@ -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'),
+]
index cfb5a55e419b949978968f0c546bdb62724be887..360cdfd7f759266c3d2662b494ff27f8a49b6b25 100644 (file)
@@ -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')
index 1148e6a9cb00e43df52b2e21d64c33b392755d63..f618f420b6d301835277e11b134ac688145c98ab 100644 (file)
@@ -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')
index 9d47612180cc7c0d50d4413a1b1f5b776dba6c14..0abd9254a12191146267c9d301eb1790f3848f2d 100755 (executable)
@@ -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