summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2021-05-13 23:06:17 +0200
committerJens Georg <mail@jensge.org>2021-06-19 13:25:32 +0200
commit12bdc3de5f1f430bb55135dd01a153e61025a57b (patch)
tree4dece06dcaca5cf5de4b9efdf493712b43b737de
parent14f7509ea66bc926a3d720c7f7be8ce56057fef4 (diff)
downloadgssdp-12bdc3de5f1f430bb55135dd01a153e61025a57b.tar.gz
doc: Use gi-docgen for the documentation
-rw-r--r--.gitlab-ci.yml11
-rw-r--r--doc/gssdp.toml.in19
-rw-r--r--doc/meson.build44
-rw-r--r--meson.build6
-rw-r--r--subprojects/gi-docgen.wrap7
5 files changed, 70 insertions, 17 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3fd4f4a..6d6c99b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -61,14 +61,14 @@ check-merge-request:
.gssdp.fedora@common:
variables:
- BASE_TAG: '2021-05-15.9'
+ BASE_TAG: '2021-05-22.0'
FDO_UPSTREAM_REPO: GNOME/gssdp
FDO_DISTRIBUTION_PACKAGES: 'clang clang-analyzer gcovr git libasan libubsan python3-gobject python3-pip xmlto'
FDO_DISTRIBUTION_EXEC: |
dnf install -y 'dnf-command(builddep)' &&
dnf builddep -y gssdp --setopt=install_weak_deps=False &&
dnf clean all &&
- pip3 install meson
+ pip3 install meson markdown toml typogrify
.gssdp.fedora:34@x86_64:
extends: .gssdp.fedora@common
@@ -188,9 +188,10 @@ pages:
stage: website
script:
- meson doc-build -Dgtk_doc=true
- - ninja -C doc-build gssdp-doc
+ - ninja -C doc-build doc/GSSDP
- mkdir -p public
- - mv doc-build/doc/html public/docs
+ - mv doc-build/doc/GSSDP public/GSSDP
+
artifacts:
paths:
- public
@@ -199,4 +200,6 @@ pages:
only:
- master
- /^wip\/.*\/ci.*$/
+ - /^wip\/.*\/.*doc.*$/
+
diff --git a/doc/gssdp.toml.in b/doc/gssdp.toml.in
new file mode 100644
index 0000000..c945d32
--- /dev/null
+++ b/doc/gssdp.toml.in
@@ -0,0 +1,19 @@
+[library]
+namespace = "GSSDP"
+version = "@VERSION@"
+browse_url = "https://gitlab.gnome.org/GNOME/gssdp/"
+repository_url = "https://gitlab.gnome.org/GNOME/gssdp.git"
+website_url = "https://gupnp.org"
+license = "LGPL-2.1-or-later"
+description = "SSDP implementation using GObject"
+dependencies = [ "GObject-2.0", "Soup-2.4", "libxml2-2.0" ]
+devhelp = true
+search_index = true
+
+[theme]
+name="basic"
+show_index_summary = true
+
+[source-location]
+base_url = "https://gitlab.gnome.org/GNOME/gssdp/-/blob/master"
+
diff --git a/doc/meson.build b/doc/meson.build
index 383417e..c3f43d4 100644
--- a/doc/meson.build
+++ b/doc/meson.build
@@ -4,16 +4,34 @@ configure_file(input: 'version.xml.in',
output: 'version.xml', configuration:
entities)
-gnome.gtkdoc('gssdp',
- main_xml : 'gssdp-docs.xml',
- gobject_typesfile : 'gssdp.types',
- dependencies : [gssdp, dependencies],
- src_dir : ['libgssdp'],
- ignore_headers : [
- 'gssdp-socket-source.h',
- 'gssdp-client-private.h',
- 'gssdp-protocol.h',
- 'gssdp-pktinfo-message.h',
- 'gssdp-net.h'
- ],
- install : true)
+gidocgen = find_program('gi-docgen', required: true)
+
+gssdp_toml = configure_file (
+ input: 'gssdp.toml.in',
+ output: 'gssdp.toml',
+ configuration: entities
+)
+
+docs_dir = join_paths(get_option('prefix'), get_option('datadir')) / 'doc/gssdp-1.2/reference'
+
+custom_target(
+ 'gssdp-doc',
+ input: gir[0],
+ output: 'GSSDP',
+ command : [
+ gidocgen,
+ 'generate',
+ '--quiet',
+ '--add-include-path=@0@'.format(meson.current_build_dir() / '../libgssdp'),
+ '--config', gssdp_toml,
+ '--output-dir=@OUTPUT@',
+ '--no-namespace-dir',
+ '--content-dir=@0@'.format(meson.current_source_dir()),
+ '@INPUT@',
+ ],
+ depend_files : gssdp_toml,
+ build_by_default: true,
+ install: true,
+ install_dir : docs_dir,
+)
+
diff --git a/meson.build b/meson.build
index ec3b9aa..275116e 100644
--- a/meson.build
+++ b/meson.build
@@ -80,6 +80,12 @@ if get_option('vapi') and get_option('introspection')
subdir('vala')
endif
+
+gidocgen_dep = dependency('gi-docgen', version: '>= 2021.1',
+ fallback: ['gi-docgen', 'dummy_dep'],
+ required: get_option('gtk_doc') and get_option('introspection')
+ )
+
if get_option('gtk_doc')
subdir('doc')
endif
diff --git a/subprojects/gi-docgen.wrap b/subprojects/gi-docgen.wrap
new file mode 100644
index 0000000..fb001c2
--- /dev/null
+++ b/subprojects/gi-docgen.wrap
@@ -0,0 +1,7 @@
+[wrap-git]
+directory=gi-docgen
+url=https://gitlab.gnome.org/GNOME/gi-docgen.git
+push-url=ssh://git@gitlab.gnome.org:GNOME/gi-docgen.git
+revision=main
+depth=1
+