aboutsummaryrefslogtreecommitdiffstats
path: root/doc/c
diff options
context:
space:
mode:
Diffstat (limited to 'doc/c')
-rw-r--r--doc/c/Doxyfile.in (renamed from doc/c/Doxyfile)10
-rw-r--r--doc/c/api/meson.build5
-rw-r--r--doc/c/meson.build44
-rw-r--r--doc/c/wscript45
-rw-r--r--doc/c/xml/meson.build19
5 files changed, 72 insertions, 51 deletions
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')