diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/c/Doxyfile.in (renamed from doc/c/Doxyfile) | 8 | ||||
-rw-r--r-- | doc/c/api/meson.build | 5 | ||||
-rw-r--r-- | doc/c/index.rst | 9 | ||||
-rw-r--r-- | doc/c/meson.build | 42 | ||||
-rw-r--r-- | doc/c/wscript | 39 | ||||
-rw-r--r-- | doc/c/xml/meson.build | 19 | ||||
-rw-r--r-- | doc/conf.py.in | 6 | ||||
-rw-r--r-- | doc/meson.build | 16 | ||||
-rw-r--r-- | doc/summary.rst (renamed from doc/sratom.rst) | 4 |
9 files changed, 97 insertions, 51 deletions
diff --git a/doc/c/Doxyfile b/doc/c/Doxyfile.in index bca2d52..17af796 100644 --- a/doc/c/Doxyfile +++ b/doc/c/Doxyfile.in @@ -1,5 +1,5 @@ PROJECT_NAME = Sratom -PROJECT_BRIEF = "A small library for serialising LV2 atoms to and from RDF" +PROJECT_BRIEF = "A library for serializing LV2 atoms" QUIET = YES WARN_AS_ERROR = NO @@ -21,6 +21,8 @@ SHOW_FILES = NO MACRO_EXPANSION = YES PREDEFINED = SRATOM_API -INPUT = ../../include/sratom/sratom.h +RECURSIVE = YES +STRIP_FROM_PATH = @SRATOM_SRCDIR@ +INPUT = @SRATOM_SRCDIR@/include -OUTPUT_DIRECTORY = . +OUTPUT_DIRECTORY = @DOX_OUTPUT@ diff --git a/doc/c/api/meson.build b/doc/c/api/meson.build new file mode 100644 index 0000000..27faf4d --- /dev/null +++ b/doc/c/api/meson.build @@ -0,0 +1,5 @@ +c_sratom_rst = custom_target( + 'Sratom C API ReST Documentation', + command: [dox_to_sphinx, '-f', '@INPUT0@', meson.current_build_dir()], + input: [c_index_xml] + c_rst_files, + output: 'sratom.rst') diff --git a/doc/c/index.rst b/doc/c/index.rst index b51db16..2e02d5d 100644 --- a/doc/c/index.rst +++ b/doc/c/index.rst @@ -1,5 +1,10 @@ +###### +Sratom +###### + +.. include:: summary.rst + .. toctree:: - sratom overview - reference + api/sratom diff --git a/doc/c/meson.build b/doc/c/meson.build new file mode 100644 index 0000000..eae54dd --- /dev/null +++ b/doc/c/meson.build @@ -0,0 +1,42 @@ +config = configuration_data() +config.set('SRATOM_VERSION', meson.project_version()) + +conf_py = configure_file(configuration: config, + input: '../conf.py.in', + output: 'conf.py') + +configure_file(copy: true, input: '../summary.rst', output: 'summary.rst') + +c_rst_files = files( + 'index.rst', + 'overview.rst', +) + +foreach f : c_rst_files + configure_file(copy: true, input: f, output: '@PLAINNAME@') +endforeach + +subdir('xml') +subdir('api') + +docs = custom_target( + 'singlehtml documentation for sratom', + command: [sphinx_build, '-M', 'singlehtml', + meson.current_build_dir(), meson.current_build_dir(), + '-E', '-q', '-t', 'singlehtml'], + input: [c_rst_files, c_sratom_rst, c_index_xml], + output: 'singlehtml', + build_by_default: true, + install: true, + install_dir: docdir / versioned_name) + +docs = custom_target( + 'html documentation for sratom', + command: [sphinx_build, '-M', 'html', + meson.current_build_dir(), meson.current_build_dir(), + '-E', '-q', '-t', 'html'], + input: [c_rst_files, c_sratom_rst, c_index_xml], + output: 'html', + build_by_default: true, + install: true, + install_dir: docdir / versioned_name) diff --git a/doc/c/wscript b/doc/c/wscript deleted file mode 100644 index 9ea3094..0000000 --- a/doc/c/wscript +++ /dev/null @@ -1,39 +0,0 @@ -#!/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 = [ - ("../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", "-t", "singlehtml"], - install_path=doc_dir + "c/singlehtml/") diff --git a/doc/c/xml/meson.build b/doc/c/xml/meson.build new file mode 100644 index 0000000..fdb55cc --- /dev/null +++ b/doc/c/xml/meson.build @@ -0,0 +1,19 @@ +doxygen = find_program('doxygen') + +c_doxygen_input = [] +foreach h : c_headers + c_doxygen_input += ['..' / h] +endforeach + +config = configuration_data() +config.set('SRATOM_SRCDIR', sratom_src_root) +config.set('DOX_OUTPUT', meson.current_build_dir() / '..') + +c_doxyfile = configure_file(configuration: config, + input: '../Doxyfile.in', + output: 'Doxyfile') + +c_index_xml = custom_target('sratom-c-index.xml', + command: [doxygen, '@INPUT0@'], + input: [c_doxyfile] + c_header_files, + output: 'index.xml') diff --git a/doc/conf.py.in b/doc/conf.py.in index c92fe62..c3600d2 100644 --- a/doc/conf.py.in +++ b/doc/conf.py.in @@ -35,9 +35,9 @@ nitpick_ignore = list(map(lambda x: ("c:identifier", x), _opaque)) # HTML output -html_theme = "sphinx_lv2_theme" html_copy_source = False html_short_title = "Sratom" +html_theme = "sphinx_lv2_theme" if tags.has("singlehtml"): html_sidebars = { @@ -49,7 +49,7 @@ if tags.has("singlehtml"): html_theme_options = { "body_max_width": "48em", "body_min_width": "48em", - "description": "A small library for serialising LV2 atoms to and from RDF", + "description": "A library for serializing LV2 atoms", "globaltoc_collapse": False, "globaltoc_maxdepth": 3, "logo_name": True, @@ -64,7 +64,7 @@ else: html_theme_options = { "body_max_width": "60em", "body_min_width": "40em", - "description": "A small library for serialising LV2 atoms to and from RDF", + "description": "A library for serializing LV2 atoms", "globaltoc_collapse": True, "globaltoc_maxdepth": 1, "logo_name": True, diff --git a/doc/meson.build b/doc/meson.build new file mode 100644 index 0000000..81457b9 --- /dev/null +++ b/doc/meson.build @@ -0,0 +1,16 @@ +docdir = get_option('datadir') / 'doc' + +doxygen = find_program('doxygen', required: get_option('docs')) +dox_to_sphinx = find_program('../scripts/dox_to_sphinx.py') +sphinx_build = find_program('sphinx-build', required: get_option('docs')) + +build_docs = doxygen.found() and sphinx_build.found() + +if build_docs + subdir('c') +endif + +if meson.version().version_compare('>=0.53.0') + summary('Documentation', build_docs, bool_yn: true) +endif + diff --git a/doc/sratom.rst b/doc/summary.rst index 9d79a32..89d87e9 100644 --- a/doc/sratom.rst +++ b/doc/summary.rst @@ -1,7 +1,3 @@ -###### -Sratom -###### - Sratom is a small library for serialising `LV2 atoms`_ to and from RDF, for converting between binary and text or storing in a model. |