summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2017-03-13 12:10:10 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2017-03-13 12:29:46 +0000
commitf33d681c51aa2fd9754e8282889fb86dd30291e4 (patch)
treec64d95c0238bc98417f0f5c8438eff2239bf9c02 /doc
parent629681dfb80cd5c5688cb05cc21a0174d5660949 (diff)
downloadjson-glib-f33d681c51aa2fd9754e8282889fb86dd30291e4.tar.gz
Build API reference with Meson
We can use the gnome module to generate the JSON-GLib API reference. https://bugzilla.gnome.org/show_bug.cgi?id=773603
Diffstat (limited to 'doc')
-rw-r--r--doc/reference/json-glib-docs.xml11
-rw-r--r--doc/reference/meson.build34
-rw-r--r--doc/reference/xml/gtkdocentities.ent.in8
-rw-r--r--doc/reference/xml/meson.build11
4 files changed, 60 insertions, 4 deletions
diff --git a/doc/reference/json-glib-docs.xml b/doc/reference/json-glib-docs.xml
index ed5ce65..5a07fd2 100644
--- a/doc/reference/json-glib-docs.xml
+++ b/doc/reference/json-glib-docs.xml
@@ -1,13 +1,16 @@
<?xml version="1.0"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
- "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
-<!ENTITY version SYSTEM "version.xml">
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+ "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
+[
+ <!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
+ <!ENTITY % gtkdocentities SYSTEM "xml/gtkdocentities.ent">
+ %gtkdocentities;
]>
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
<bookinfo>
<title>JSON-GLib Reference Manual</title>
- <releaseinfo>for JSON-GLib &version;</releaseinfo>
+ <releaseinfo>for JSON-GLib &package_api_version;</releaseinfo>
<copyright>
<year>2007, 2008</year>
diff --git a/doc/reference/meson.build b/doc/reference/meson.build
new file mode 100644
index 0000000..95a7860
--- /dev/null
+++ b/doc/reference/meson.build
@@ -0,0 +1,34 @@
+subdir('xml')
+
+private_headers = [
+ 'json-debug.h',
+ 'json-enum-types.h',
+ 'json-glib.h',
+ 'json-gobject-private.h',
+ 'json-marshal.h',
+ 'json-private.h',
+ 'json-scanner.h',
+ 'json-types-private.h',
+]
+
+glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix')
+glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
+docpath = join_paths(json_datadir, 'gtk-doc', 'html')
+
+gnome.gtkdoc('json-glib',
+ main_xml: 'json-glib-docs.xml',
+ src_dir: [ join_paths(meson.source_root(), 'json-glib'), join_paths(meson.build_root(), 'json-glib'), ],
+ dependencies: json_glib_dep,
+ gobject_typesfile: 'json-glib.types',
+ scan_args: [
+ '--rebuild-types',
+ '--ignore-decorators=_JSON_EXTERN',
+ '--ignore-headers=' + ' '.join(private_headers),
+ ],
+ fixxref_args: [
+ '--html-dir=@0@'.format(docpath),
+ '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')),
+ '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')),
+ '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')),
+ ],
+ install: true)
diff --git a/doc/reference/xml/gtkdocentities.ent.in b/doc/reference/xml/gtkdocentities.ent.in
new file mode 100644
index 0000000..f12c9ff
--- /dev/null
+++ b/doc/reference/xml/gtkdocentities.ent.in
@@ -0,0 +1,8 @@
+<!ENTITY package "@PACKAGE@">
+<!ENTITY package_bugreport "@PACKAGE_BUGREPORT@">
+<!ENTITY package_name "@PACKAGE_NAME@">
+<!ENTITY package_string "@PACKAGE_STRING@">
+<!ENTITY package_tarname "@PACKAGE_TARNAME@">
+<!ENTITY package_url "@PACKAGE_URL@">
+<!ENTITY package_version "@PACKAGE_VERSION@">
+<!ENTITY package_api_version "@PACKAGE_API_VERSION@">
diff --git a/doc/reference/xml/meson.build b/doc/reference/xml/meson.build
new file mode 100644
index 0000000..668435a
--- /dev/null
+++ b/doc/reference/xml/meson.build
@@ -0,0 +1,11 @@
+ent_conf = configuration_data()
+ent_conf.set('PACKAGE', 'JSON-GLib')
+ent_conf.set('PACKAGE_BUGREPORT', 'https://bugzilla.gnome.org/enter_bug.cgi?product=json-glib')
+ent_conf.set('PACKAGE_NAME', 'JSON-GLib')
+ent_conf.set('PACKAGE_STRING', 'json-glib')
+ent_conf.set('PACKAGE_TARNAME', 'json-glib-' + meson.project_version())
+ent_conf.set('PACKAGE_URL', 'http://wiki.gnome.org/Project/JsonGlib')
+ent_conf.set('PACKAGE_VERSION', meson.project_version())
+ent_conf.set('PACKAGE_API_VERSION', apiversion)
+configure_file(input: 'gtkdocentities.ent.in', output: 'gtkdocentities.ent', configuration: ent_conf)
+