3 required_hotdoc_extensions = ['gst-extension']
4 plugins_cache = join_paths(meson.current_source_dir(), 'gst_plugins_cache.json')
5 if gst_dep.type_name() == 'internal'
6 gst_proj = subproject('gstreamer')
7 plugins_cache_generator = gst_proj.get_variable('plugins_cache_generator')
9 plugins_cache_generator = find_program(join_paths(gst_dep.get_pkgconfig_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'),
13 if plugins.length() == 0
14 message('All ugly plugins have been disabled')
15 elif plugins_cache_generator.found()
16 plugins_doc_dep = custom_target('ugly-plugins-doc-cache',
17 command: [plugins_cache_generator, plugins_cache, '@OUTPUT@', '@INPUT@'],
19 output: 'gst_plugins_cache.json',
20 build_always_stale: true,
23 warning('GStreamer plugin inspector for documentation not found, can\'t update the cache')
26 hotdoc_p = find_program('hotdoc', required: get_option('doc'))
27 if not hotdoc_p.found()
28 message('Hotdoc not found, not building the documentation')
32 hotdoc_req = '>= 0.11.0'
33 hotdoc_version = run_command(hotdoc_p, '--version').stdout()
34 if not hotdoc_version.version_compare(hotdoc_req)
35 if get_option('doc').enabled()
36 error('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version))
38 message('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version))
43 hotdoc = import('hotdoc')
44 foreach extension: required_hotdoc_extensions
45 if not hotdoc.has_extensions(extension)
46 if get_option('doc').enabled()
47 error('Documentation enabled but @0@ missing'.format(extension))
50 message('@0@ extension not found, not building documentation'.format(extension))
56 docconf = configuration_data()
57 docconf.set('GST_API_VERSION', api_version)
59 configure_file(input : 'gst_api_version.in',
60 output : 'gst_api_version.md',
61 configuration : docconf)
66 excludes += [join_paths(meson.current_source_dir(), root_rel, '..', f)]
71 list_plugin_res = run_command(python3, '-c',
76 with open("@0@") as f:
77 print(':'.join(json.load(f).keys()), end='')
78 '''.format(plugins_cache))
80 assert(list_plugin_res.returncode() == 0,
81 'Could not list plugins from @0@'.format(plugins_cache))
83 foreach plugin_name: list_plugin_res.stdout().split(':')
84 plugins_doc += [hotdoc.generate_doc(plugin_name,
85 project_version: api_version,
86 sitemap: 'sitemap.txt',
88 gst_index: 'index.md',
89 gst_smart_index: true,
91 join_paths(root_rel, 'sys/*/*.[ch]'),
92 join_paths(root_rel, 'ext/*/*.[ch]'),
93 join_paths(root_rel, 'gst/*/*.[ch]'),
95 gst_c_source_filters: excludes,
96 dependencies: [gst_dep, plugins],
97 gst_order_generated_subpages: true,
98 disable_incremental_build: true,
99 gst_cache_file: plugins_cache,
100 gst_plugin_name: plugin_name,