This commit uses gi-docgen and obsolete gtk-doc.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
dnf -y upgrade
dnf -y install @development-tools
dnf -y install meson gobject-introspection-devel systemd-devel
- dnf -y install gtk-doc python3-gobject
+ dnf -y install gi-docgen python3-gobject
- name: Initialization for build.
run: |
meson --prefix=/tmp. -Ddoc=true -Dwarning_level=3 . build
sudo lxc exec builder -- su ubuntu -c 'sudo apt-get -y full-upgrade'
sudo lxc exec builder -- su ubuntu -c 'sudo apt-get install -y git build-essential'
sudo lxc exec builder -- su ubuntu -c 'sudo apt-get install -y meson ninja-build libglib2.0-dev libudev-dev gobject-introspection libgirepository1.0-dev'
- sudo lxc exec builder -- su ubuntu -c 'sudo apt-get install -y gtk-doc-tools python3-gi'
+ sudo lxc exec builder -- su ubuntu -c 'sudo apt-get install -y gi-docgen python3-gi'
- name: Checkout repository.
uses: actions/checkout@v2
- name: Generate archive and expand it inner the container.
* libudev1 <https://www.freedesktop.org/wiki/Software/systemd/>
* Meson <https://mesonbuild.com/>
* (optional) PyGObject <https://pygobject.readthedocs.io/> to execute tests
-* (optional) gtk-doc <https://www.gtk.org/gtk-doc/> to generate documentation
+* (optional) gi-docgen <https://gnome.pages.gitlab.gnome.org/gi-docgen/> to generate documentation
How to build
============
arguments for them. For example ::
$ pkg-config --cflags --libs alsactl
- -I/usr/include/alsa-gobject -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lalsactl
+ -I/usr/include/alsa-gobject/ctl -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lalsactl
Generate documentation ::
$ meson --prefix=xxx -D doc=true . build
$ cd build
$ meson install
- $ xdg-open xxx/share/gtk-doc/html/alsactl/index.html
+ $ xdg-open xxx/share/doc/html/index.html
Design note
===========
--- /dev/null
+[library]
+version = "@VERSION@"
+description = "alsactl"
+authors = "Takashi Sakamoto"
+license = "LGPL-3.0-or-later"
+website_url = "https://alsa-project.github.io/alsa-gobject-docs/alsactl/"
+browse_url = "https://github.com/alsa-project/alsa-gobject"
+repository_url = "https://github.com/alsa-project/alsa-gobject.git"
+
+dependencies = [
+ "GLib-2.0",
+ "GObject-2.0",
+]
+
+[dependencies."GLib-2.0"]
+name = "GLib"
+description = "The base utility library"
+docs_url = "https://docs.gtk.org/glib/"
+
+[dependencies."GObject-2.0"]
+name = "GObject"
+description = "The base type system and object class"
+docs_url = "https://docs.gtk.org/gobject/"
+
+[source-location]
+base_url = "https://github.com/alsa-project/alsa-gobject/blob/master/"
+file_format = "{filename}#L{line}"
+
+[extra]
+content_files = [
+ "overview.md",
+]
+
+urlmap_file = "urlmap.js"
--- /dev/null
+ext_contents = [
+ 'overview.md',
+]
+
+doc_toml = configure_file(
+ input: 'alsactl.toml.in',
+ output: 'alsactl.toml',
+ configuration: conf,
+)
+
+custom_target('alsactl-doc',
+ input: [ doc_toml, alsactl_gir[0] ],
+ output: 'alsactl',
+ command: [
+ gidocgen,
+ 'generate',
+ '--no-namespace-dir',
+ '--config=@INPUT0@',
+ '--output-dir=@OUTPUT@',
+ '--content-dir=@0@'.format(meson.current_source_dir()),
+ '@INPUT1@',
+ ],
+ depend_files: [ ext_contents ],
+ build_by_default: true,
+ install: true,
+ install_dir: doc_dir,
+)
--- /dev/null
+Title: Overview
+
+This library is designed for applications to manipulate ALSA control character device and operate
+control functionality abstracted as card and element. ALSACtlCard represent the card. It holds
+file descriptor and creates GSource for event dispatching by GLib's GMainContext/GMainLoop.
--- /dev/null
+baseURLs = [
+ [ 'GLib', 'https://docs.gtk.org/glib/' ],
+ [ 'GObject', 'https://docs.gtk.org/gobject/' ],
+]
+conf = configuration_data()
+conf.set('VERSION', meson.project_version())
+
+doc_dir = join_paths(get_option('datadir'), 'doc', meson.project_name())
+
+dependency('gi-docgen',
+ version: '>= 2021.8',
+ fallback: ['gi-docgen', 'dummy_dep'],
+)
+gidocgen = find_program('gi-docgen')
+
+subdir('ctl')
subdir('reference')
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
- "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
-<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
-<!ENTITY version SYSTEM "../version.xml">
-]>
-
-<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
- <bookinfo>
- <title>ALSACtl Reference Manual</title>
- <releaseinfo>This document is for the ALSACtl library, version &version;.
- </releaseinfo>
- </bookinfo>
-
- <chapter id="introduction">
- <title>Introduction</title>
- <para>This library is designed for applications to manipulate ALSA
- control character device and operate control functionality abstracted
- as card and element. ALSACtlCard represent the card. It holds file
- descriptor and creates GSource for event dispatching by GLib's
- GMainContext/GMainLoop.</para>
- </chapter>
-
- <chapter id="alsactl-enumerations">
- <title>ALSACtl enumerations</title>
- <xi:include href="xml/alsactl-enum-types.xml"/>
- </chapter>
-
- <chapter id="alsactl-global-methods">
- <title>ALSACtl global methods</title>
- <xi:include href="xml/query.xml"/>
- </chapter>
-
- <chapter id="alsactl-objects">
- <title>ALSACtl objects</title>
- <xi:include href="xml/card.xml"/>
- <xi:include href="xml/card-info.xml"/>
- <xi:include href="xml/elem-id.xml"/>
- <xi:include href="xml/elem-info.xml"/>
- <xi:include href="xml/elem-value.xml"/>
- <xi:include href="xml/alsactl-sigs-marshal.xml"/>
- </chapter>
-
- <index id="index-all">
- <title>Index of all symbols</title>
- <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
- </index>
-
- <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
-
-</book>
+++ /dev/null
-alsactl_elem_type_get_type
-alsactl_elem_iface_type_get_type
-alsactl_elem_access_flag_get_type
-alsactl_event_type_get_type
-alsactl_elem_event_mask_get_type
-alsactl_card_get_type
-alsactl_card_info_get_type
-alsactl_elem_id_get_type
-alsactl_elem_info_get_type
-alsactl_elem_value_get_type
+++ /dev/null
-gnome.gtkdoc('alsactl',
- src_dir : alsactl_dir,
- main_xml : 'alsactl-docs.xml',
- scan_args: [
- '--ignore-headers=privates.h',
- ],
- gobject_typesfile: 'alsactl.types',
- dependencies: alsactl_dependency,
- install : true,
-)
-conf = configuration_data()
-conf.set('VERSION', meson.project_version())
-
configure_file(
input : 'version.xml.in',
output : 'version.xml',
configuration : conf,
)
-subdir('ctl')
subdir('timer')
subdir('seq')
subdir('hwdep')
)
# Generate metadata for gobject introspection.
-gnome.generate_gir(library,
+alsactl_gir = gnome.generate_gir(library,
sources: enums + marshallers + headers + sources,
nsversion: '0.0',
namespace: namespace,
header: 'alsactl.h',
install: true,
)
-
-# For documentation of gtk-doc.
-alsactl_dir = include_directories('.')
-alsactl_dependency = declare_dependency(
- link_with: library,
- dependencies: dependencies,
-)