diff options
author | David Robillard <d@drobilla.net> | 2020-12-21 18:14:10 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-12-21 18:14:10 +0100 |
commit | d361ce65d3841c9f97d27ac477c2e55c3802b381 (patch) | |
tree | c710d7deab629c6179ccf663f0421750b801a667 /doc/c | |
parent | b3067e5a5dd1d92551d166a5095821e9033c0b7c (diff) | |
download | sratom-d361ce65d3841c9f97d27ac477c2e55c3802b381.tar.gz sratom-d361ce65d3841c9f97d27ac477c2e55c3802b381.tar.bz2 sratom-d361ce65d3841c9f97d27ac477c2e55c3802b381.zip |
Generate documentation with Sphinx
Diffstat (limited to 'doc/c')
-rw-r--r-- | doc/c/Doxyfile | 26 | ||||
-rw-r--r-- | doc/c/index.rst | 5 | ||||
-rw-r--r-- | doc/c/overview.rst | 12 | ||||
-rw-r--r-- | doc/c/reference.rst | 11 | ||||
-rw-r--r-- | doc/c/wscript | 41 |
5 files changed, 95 insertions, 0 deletions
diff --git a/doc/c/Doxyfile b/doc/c/Doxyfile new file mode 100644 index 0000000..bca2d52 --- /dev/null +++ b/doc/c/Doxyfile @@ -0,0 +1,26 @@ +PROJECT_NAME = Sratom +PROJECT_BRIEF = "A small library for serialising LV2 atoms to and from RDF" + +QUIET = YES +WARN_AS_ERROR = NO +WARN_IF_UNDOCUMENTED = NO +WARN_NO_PARAMDOC = NO + +JAVADOC_AUTOBRIEF = YES + +CASE_SENSE_NAMES = YES +HIDE_IN_BODY_DOCS = YES +REFERENCES_LINK_SOURCE = NO + +GENERATE_HTML = NO +GENERATE_LATEX = NO +GENERATE_XML = YES +XML_PROGRAMLISTING = NO +SHOW_FILES = NO + +MACRO_EXPANSION = YES +PREDEFINED = SRATOM_API + +INPUT = ../../include/sratom/sratom.h + +OUTPUT_DIRECTORY = . diff --git a/doc/c/index.rst b/doc/c/index.rst new file mode 100644 index 0000000..b51db16 --- /dev/null +++ b/doc/c/index.rst @@ -0,0 +1,5 @@ +.. toctree:: + + sratom + overview + reference diff --git a/doc/c/overview.rst b/doc/c/overview.rst new file mode 100644 index 0000000..3b26a5b --- /dev/null +++ b/doc/c/overview.rst @@ -0,0 +1,12 @@ +######## +Overview +######## + +.. default-domain:: c +.. highlight:: c + +The complete API is declared in ``sratom.h``: + +.. code-block:: c + + #include <sratom/sratom.h> diff --git a/doc/c/reference.rst b/doc/c/reference.rst new file mode 100644 index 0000000..9164d6b --- /dev/null +++ b/doc/c/reference.rst @@ -0,0 +1,11 @@ +############# +API Reference +############# + +This section contains the generated documentation for all symbols in the public +API. + +.. toctree:: + + api/sratom + diff --git a/doc/c/wscript b/doc/c/wscript new file mode 100644 index 0000000..d88ee38 --- /dev/null +++ b/doc/c/wscript @@ -0,0 +1,41 @@ +#!/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 = [ + ("../_static/custom.css", "sphinx/_static/custom.css"), + ("../_templates/about.html", "sphinx/_templates/about.html"), + ("../sratom.rst", "sphinx/sratom.rst"), + ("index.rst", "sphinx/index.rst"), + ("overview.rst", "sphinx/overview.rst"), + ("reference.rst", "sphinx/reference.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", + SERD_VERSION=bld.env.SERD_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/") + + # Run Sphinx to generate HTML documentation + doc_dir = bld.env.DOCDIR + "/sratom-%s/" % bld.env.SRATOM_MAJOR_VERSION + bld(features="sphinx", + sphinx_source=bld.path.get_bld().make_node("sphinx"), + sphinx_output_format="singlehtml", + sphinx_options=["-E", "-q"], + install_path=doc_dir + "c/singlehtml/") |