Switch library documentation to gi-docgen
Switch from gtk-doc to gi-docgen for the library documentation and adjust the source files accordingly. We don't bother about the daemon doc headers as they're not built into any docs atm. Closes: #56
This commit is contained in:
+40
-32
@@ -1,41 +1,49 @@
|
||||
if get_option('gtk_doc')
|
||||
|
||||
subdir('xml')
|
||||
|
||||
private_headers = [
|
||||
expand_content_md_files = [
|
||||
'overview.md',
|
||||
'build-howto.md',
|
||||
'initialization.md',
|
||||
]
|
||||
|
||||
content_files = [
|
||||
'overview.xml',
|
||||
]
|
||||
toml_data = configuration_data()
|
||||
toml_data.set('VERSION', meson.project_version())
|
||||
|
||||
glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix')
|
||||
glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
|
||||
docpath = join_paths(get_option('datadir'), 'gtk-doc', 'html')
|
||||
libfeedback_toml = configure_file(
|
||||
input: 'libfeedback.toml.in',
|
||||
output: 'libfeedback.toml',
|
||||
configuration: toml_data
|
||||
)
|
||||
|
||||
dependency('gi-docgen', version: '>= 2021.1',
|
||||
fallback: ['gi-docgen', 'dummy_dep'],
|
||||
native: true,
|
||||
required: get_option('gtk_doc'))
|
||||
|
||||
gidocgen = find_program('gi-docgen')
|
||||
|
||||
docs_dir = datadir / 'doc'
|
||||
|
||||
custom_target('libfeedback-doc',
|
||||
input: [ libfeedback_toml, libfeedback_gir[0] ],
|
||||
output: 'libfeedback-0',
|
||||
command: [
|
||||
gidocgen,
|
||||
'generate',
|
||||
'--quiet',
|
||||
'--add-include-path=@0@'.format(meson.current_build_dir() / '../src'),
|
||||
'--config=@INPUT0@',
|
||||
'--output-dir=@OUTPUT@',
|
||||
'--no-namespace-dir',
|
||||
'--content-dir=@0@'.format(meson.current_source_dir()),
|
||||
'@INPUT1@',
|
||||
],
|
||||
depend_files: [ expand_content_md_files ],
|
||||
build_by_default: true,
|
||||
install: true,
|
||||
install_dir: docs_dir,
|
||||
)
|
||||
|
||||
gnome.gtkdoc('libfeedback',
|
||||
main_xml: 'libfeedback-docs.xml',
|
||||
src_dir: [
|
||||
join_paths(meson.source_root(), 'libfeedback'),
|
||||
join_paths(meson.build_root(), 'libfeedback'),
|
||||
join_paths(meson.build_root(), 'data'),
|
||||
],
|
||||
dependencies: libfeedback_dep,
|
||||
gobject_typesfile: 'libfeedback.types',
|
||||
scan_args: [
|
||||
'--rebuild-types',
|
||||
'--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')),
|
||||
'--extra-dir=@0@'.format(join_paths(glib_docpath, 'gi')),
|
||||
],
|
||||
install_dir: 'libfeedback',
|
||||
content_files: content_files,
|
||||
install: true)
|
||||
endif
|
||||
|
||||
if get_option('man')
|
||||
|
||||
Reference in New Issue
Block a user