diff options
author | David Robillard <d@drobilla.net> | 2021-01-07 15:25:36 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-01-07 17:29:33 +0100 |
commit | eb0f335d49ac3b501626d9e1ec140978fe795df6 (patch) | |
tree | d5f6c8c9874555abdb42f1b901cc47d8f6597fec /doc/c/wscript | |
parent | efa8abca4b80b2388e828fce069821a20dc68a68 (diff) | |
download | lilv-eb0f335d49ac3b501626d9e1ec140978fe795df6.tar.gz lilv-eb0f335d49ac3b501626d9e1ec140978fe795df6.tar.bz2 lilv-eb0f335d49ac3b501626d9e1ec140978fe795df6.zip |
Generate documentation with Sphinx and add an overview
Diffstat (limited to 'doc/c/wscript')
-rw-r--r-- | doc/c/wscript | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/doc/c/wscript b/doc/c/wscript new file mode 100644 index 0000000..d515ddf --- /dev/null +++ b/doc/c/wscript @@ -0,0 +1,43 @@ +#!/usr/bin/env python + +def build(bld): + dox_to_sphinx = bld.path.find_node("../../scripts/dox_to_sphinx.py") + index_xml = bld.path.get_bld().make_node("xml/index.xml") + + files = [ + ("../summary.rst", "sphinx/summary.rst"), + ("index.rst", "sphinx/index.rst"), + ("overview.rst", "sphinx/overview.rst"), + ("plugins.rst", "sphinx/plugins.rst"), + ("uis.rst", "sphinx/uis.rst"), + ("world.rst", "sphinx/world.rst"), + ] + + # Run Doxygen to generate XML documentation + bld(features="doxygen", doxyfile="Doxyfile") + + # Substitute variables to make Sphinx configuration file + bld(features="subst", + source="../conf.py.in", + target="sphinx/conf.py", + LILV_VERSION=bld.env.LILV_VERSION) + + # Copy static documentation files to Sphinx build directory + for f in files: + bld(features="subst", is_copy=True, source=f[0], target=f[1]) + + # Generate Sphinx markup from Doxygen XML + bld.add_group() + bld(rule="${PYTHON} " + dox_to_sphinx.abspath() + " -f ${SRC} ${TGT}", + source=index_xml, + target="sphinx/api/") + + doc_dir = bld.env.DOCDIR + "/lilv-%s/" % bld.env.LILV_MAJOR_VERSION + + # Run Sphinx to generate HTML documentation + for builder in ["html", "singlehtml"]: + bld(features="sphinx", + sphinx_source=bld.path.get_bld().make_node("sphinx"), + sphinx_output_format=builder, + sphinx_options=["-E", "-q", "-t", builder], + install_path=doc_dir + "c/%s/" % builder) |