diff options
author | David Robillard <d@drobilla.net> | 2021-01-06 23:53:33 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-01-08 18:13:49 +0100 |
commit | 69d5d2adde1d13578a94e8b1934235987cf9b2bd (patch) | |
tree | 9720c044447bb12e6e714ac969ebb7b0daf87c5f /doc | |
parent | 94e30b9c3c188dfdf4765f026872f95ea3cfdda2 (diff) | |
download | pugl-69d5d2adde1d13578a94e8b1934235987cf9b2bd.tar.gz pugl-69d5d2adde1d13578a94e8b1934235987cf9b2bd.tar.bz2 pugl-69d5d2adde1d13578a94e8b1934235987cf9b2bd.zip |
Switch to Meson
Diffstat (limited to 'doc')
-rw-r--r-- | doc/_static/meson.build | 2 | ||||
-rw-r--r-- | doc/c/Doxyfile.in (renamed from doc/c/Doxyfile) | 10 | ||||
-rw-r--r-- | doc/c/api/meson.build | 5 | ||||
-rw-r--r-- | doc/c/meson.build | 44 | ||||
-rw-r--r-- | doc/c/wscript | 45 | ||||
-rw-r--r-- | doc/c/xml/meson.build | 19 | ||||
-rw-r--r-- | doc/conf.py.in | 6 | ||||
-rw-r--r-- | doc/cpp/Doxyfile.in (renamed from doc/cpp/Doxyfile) | 14 | ||||
-rw-r--r-- | doc/cpp/api/meson.build | 5 | ||||
-rw-r--r-- | doc/cpp/meson.build | 43 | ||||
-rw-r--r-- | doc/cpp/wscript | 44 | ||||
-rw-r--r-- | doc/cpp/xml/meson.build | 21 | ||||
-rw-r--r-- | doc/meson.build | 18 |
13 files changed, 167 insertions, 109 deletions
diff --git a/doc/_static/meson.build b/doc/_static/meson.build new file mode 100644 index 0000000..fc7792c --- /dev/null +++ b/doc/_static/meson.build @@ -0,0 +1,2 @@ +configure_file(copy: true, input: '../../resources/pugl.svg', output: 'pugl.svg') + diff --git a/doc/c/Doxyfile b/doc/c/Doxyfile.in index e16cd28..96bbf63 100644 --- a/doc/c/Doxyfile +++ b/doc/c/Doxyfile.in @@ -8,6 +8,7 @@ WARN_NO_PARAMDOC = NO JAVADOC_AUTOBRIEF = YES +FULL_PATH_NAMES = NO CASE_SENSE_NAMES = YES HIDE_IN_BODY_DOCS = YES REFERENCES_LINK_SOURCE = NO @@ -21,10 +22,7 @@ SHOW_FILES = NO MACRO_EXPANSION = YES PREDEFINED = PUGL_API PUGL_DISABLE_DEPRECATED PUGL_CONST_API= PUGL_CONST_FUNC= -INPUT = ../../include/pugl/cairo.h \ - ../../include/pugl/gl.h \ - ../../include/pugl/pugl.h \ - ../../include/pugl/stub.h \ - ../../include/pugl/vulkan.h +STRIP_FROM_PATH = @PUGL_SRCDIR@ +INPUT = @PUGL_HEADERS@ -OUTPUT_DIRECTORY = . +OUTPUT_DIRECTORY = doc/c diff --git a/doc/c/api/meson.build b/doc/c/api/meson.build new file mode 100644 index 0000000..5c1e30e --- /dev/null +++ b/doc/c/api/meson.build @@ -0,0 +1,5 @@ +c_pugl_rst = custom_target( + 'C API ReST Documentation', + command: [dox_to_sphinx, '-f', '@INPUT0@', 'doc/c/api'], + input: [c_index_xml] + c_rst_files, + output: 'pugl.rst') diff --git a/doc/c/meson.build b/doc/c/meson.build new file mode 100644 index 0000000..df9363e --- /dev/null +++ b/doc/c/meson.build @@ -0,0 +1,44 @@ +config = configuration_data() +config.set('PUGL_VERSION', meson.project_version()) + +conf_py = configure_file(configuration: config, + input: '../conf.py.in', + output: 'conf.py') + +configure_file(copy: true, input: '../deployment.rst', output: 'deployment.rst') +configure_file(copy: true, input: '../summary.rst', output: 'summary.rst') + +c_rst_files = files( + 'index.rst', + 'overview.rst', + 'world.rst', + 'view.rst', + 'events.rst', + 'event-loop.rst', + 'shutting-down.rst' +) + +foreach f : c_rst_files + configure_file(copy: true, input: f, output: '@PLAINNAME@') +endforeach + +subdir('xml') +subdir('api') + +docs = custom_target( + 'C API Documentation (singlehtml)', + command: [sphinx_build, '-M', 'singlehtml', 'doc/c/', 'doc/c/', '-E', '-q', '-t', 'singlehtml'], + input: [c_rst_files, c_pugl_rst, c_index_xml], + output: 'singlehtml', + build_by_default: true, + install: true, + install_dir: docdir / 'pugl-0') + +docs = custom_target( + 'C API Documentation (html)', + command: [sphinx_build, '-M', 'html', 'doc/c/', 'doc/c/', '-E', '-q', '-t', 'html'], + input: [c_rst_files, c_pugl_rst, c_index_xml], + output: 'html', + build_by_default: true, + install: true, + install_dir: docdir / 'pugl-0') diff --git a/doc/c/wscript b/doc/c/wscript deleted file mode 100644 index dc97f6e..0000000 --- a/doc/c/wscript +++ /dev/null @@ -1,45 +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 = [ - ("../../resources/pugl.svg", "sphinx/_static/pugl.svg"), - ("../deployment.rst", "sphinx/deployment.rst"), - ("../summary.rst", "sphinx/summary.rst"), - ("event-loop.rst", "sphinx/event-loop.rst"), - ("events.rst", "sphinx/events.rst"), - ("index.rst", "sphinx/index.rst"), - ("overview.rst", "sphinx/overview.rst"), - ("shutting-down.rst", "sphinx/shutting-down.rst"), - ("view.rst", "sphinx/view.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", - PUGL_VERSION=bld.env.PUGL_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 + "/pugl-%s/" % bld.env.PUGL_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..d79d59a --- /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('PUGL_HEADERS', ' '.join(c_doxygen_input)) +config.set('PUGL_SRCDIR', pugl_src_root) + +c_doxyfile = configure_file(configuration: config, + input: '../Doxyfile.in', + output: 'Doxyfile') + +c_index_xml = custom_target('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 d6c9160..3fa8ea2 100644 --- a/doc/conf.py.in +++ b/doc/conf.py.in @@ -41,7 +41,7 @@ cpp_index_common_prefix = ["pugl::"] html_copy_source = False html_short_title = "Pugl" -html_static_path = ["_static"] +html_static_path = ["../_static"] html_theme = "sphinx_lv2_theme" if tags.has('singlehtml'): @@ -52,8 +52,8 @@ if tags.has('singlehtml'): } html_theme_options = { - "body_max_width": "50em", - "body_min_width": "50em", + "body_max_width": "51em", + "body_min_width": "51em", "description": "A minimal portable API for embeddable GUIs.", "show_footer_version": True, "show_logo_version": False, diff --git a/doc/cpp/Doxyfile b/doc/cpp/Doxyfile.in index 517ba05..889ac0b 100644 --- a/doc/cpp/Doxyfile +++ b/doc/cpp/Doxyfile.in @@ -26,15 +26,7 @@ SHOW_FILES = NO MACRO_EXPANSION = YES PREDEFINED = PUGL_API PUGL_DISABLE_DEPRECATED PUGL_CONST_API= PUGL_CONST_FUNC= -INPUT = ../../include/pugl/cairo.h \ - ../../include/pugl/gl.h \ - ../../include/pugl/pugl.h \ - ../../include/pugl/stub.h \ - ../../include/pugl/vulkan.h \ - ../../bindings/cxx/include/pugl/cairo.hpp \ - ../../bindings/cxx/include/pugl/gl.hpp \ - ../../bindings/cxx/include/pugl/pugl.hpp \ - ../../bindings/cxx/include/pugl/stub.hpp \ - ../../bindings/cxx/include/pugl/vulkan.hpp +STRIP_FROM_PATH = @PUGL_SRCDIR@ +INPUT = @PUGL_HEADERS@ -OUTPUT_DIRECTORY = . +OUTPUT_DIRECTORY = doc/cpp diff --git a/doc/cpp/api/meson.build b/doc/cpp/api/meson.build new file mode 100644 index 0000000..4bbbec2 --- /dev/null +++ b/doc/cpp/api/meson.build @@ -0,0 +1,5 @@ +cpp_pugl_rst = custom_target( + 'C++ API ReST Documentation', + command: [dox_to_sphinx, '-l', 'cpp', '-f', '@INPUT@', 'doc/cpp/api'], + input: cpp_index_xml, + output: 'pugl.rst') diff --git a/doc/cpp/meson.build b/doc/cpp/meson.build new file mode 100644 index 0000000..d8bae11 --- /dev/null +++ b/doc/cpp/meson.build @@ -0,0 +1,43 @@ +config = configuration_data() +config.set('PUGL_VERSION', meson.project_version()) + +conf_py = configure_file(configuration: config, + input: '../conf.py.in', + output: 'conf.py') + +configure_file(copy: true, input: '../deployment.rst', output: 'deployment.rst') +configure_file(copy: true, input: '../summary.rst', output: 'summary.rst') + +cpp_rst_files = files( + 'index.rst', + 'overview.rst', + 'world.rst', + 'view.rst', + 'events.rst', + 'event-loop.rst', +) + +foreach f : cpp_rst_files + configure_file(copy: true, input: f, output: '@PLAINNAME@') +endforeach + +subdir('xml') +subdir('api') + +docs = custom_target( + 'C++ API Documentation (singlehtml)', + command: [sphinx_build, '-M', 'singlehtml', 'doc/cpp/', 'doc/cpp/', '-E', '-q', '-t', 'singlehtml'], + input: [cpp_rst_files, cpp_pugl_rst, cpp_index_xml], + output: 'singlehtml', + build_by_default: true, + install: true, + install_dir: docdir / 'puglxx-0') + +docs = custom_target( + 'C++ API Documentation (html)', + command: [sphinx_build, '-M', 'html', 'doc/cpp/', 'doc/cpp/', '-E', '-q', '-t', 'html'], + input: [cpp_rst_files, cpp_pugl_rst, cpp_index_xml], + output: 'html', + build_by_default: true, + install: true, + install_dir: docdir / 'puglxx-0') diff --git a/doc/cpp/wscript b/doc/cpp/wscript deleted file mode 100644 index 4bef6c2..0000000 --- a/doc/cpp/wscript +++ /dev/null @@ -1,44 +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 = [ - ("../../resources/pugl.svg", "sphinx/_static/pugl.svg"), - ("../deployment.rst", "sphinx/deployment.rst"), - ("../summary.rst", "sphinx/summary.rst"), - ("event-loop.rst", "sphinx/event-loop.rst"), - ("events.rst", "sphinx/events.rst"), - ("index.rst", "sphinx/index.rst"), - ("overview.rst", "sphinx/overview.rst"), - ("view.rst", "sphinx/view.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", - PUGL_VERSION=bld.env.PUGL_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() + " -l cpp -f ${SRC} ${TGT}", - source=index_xml, - target="sphinx/api/") - - # Run Sphinx to generate HTML documentation - doc_dir = bld.env.DOCDIR + "/pugl-%s/" % bld.env.PUGL_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 + "cpp/singlehtml/") diff --git a/doc/cpp/xml/meson.build b/doc/cpp/xml/meson.build new file mode 100644 index 0000000..3f87f2a --- /dev/null +++ b/doc/cpp/xml/meson.build @@ -0,0 +1,21 @@ +doxygen = find_program('doxygen') + +cpp_doxygen_input = [] +foreach h : c_headers + cpp_headers + cpp_doxygen_input += ['..' / h] +endforeach + +config = configuration_data() +config.set('PUGL_HEADERS', ' '.join(cpp_doxygen_input)) +config.set('PUGL_SRCDIR', pugl_src_root) + +cpp_doxyfile = configure_file(configuration: config, + input: '../Doxyfile.in', + output: 'Doxyfile') + +cpp_index_xml = custom_target( + 'cpp-index.xml', + command: [doxygen, '@INPUT0@'], + input: [cpp_doxyfile] + c_header_files + cpp_header_files, + output: 'index.xml') + diff --git a/doc/meson.build b/doc/meson.build new file mode 100644 index 0000000..ba6ea11 --- /dev/null +++ b/doc/meson.build @@ -0,0 +1,18 @@ +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('_static') + subdir('c') + subdir('cpp') +endif + +if meson.version().version_compare('>=0.53.0') + summary('Documentation', build_docs, bool_yn: true) +endif + |