1 project('GStreamer manuals and tutorials', 'c',
3 meson_version : '>= 0.62')
5 hotdoc_p = find_program('hotdoc')
6 if not hotdoc_p.found()
7 message('Hotdoc not found, not building the documentation')
11 hotdoc_req = '>= 0.12.2'
12 hotdoc_version = run_command(hotdoc_p, '--version', check: false).stdout()
13 if not hotdoc_version.version_compare(hotdoc_req)
14 error('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version))
17 hotdoc = import('hotdoc')
18 hotdoc_subprojects = []
21 if host_machine.system() == 'windows'
27 python3 = import('python').find_installation()
29 built_subprojects = get_option('built_subprojects')
30 if built_subprojects != ''
31 message('Have subprojects list from options')
33 read_file_contents = '''
37 assert len(sys.argv) >= 2
40 with open(fname, 'r') as f:
45 # gst-build will generate this file for us to consume so that subproject
46 # changes can still work
47 fname = join_paths(meson.project_build_root(), '..', '..', 'GstDocumentedSubprojects')
50 '-c', read_file_contents,
54 if cmdres.returncode() == 0
55 built_subprojects = cmdres.stdout().strip()
56 message('Have subprojects from file: @0@'.format(fname))
64 if built_subprojects != ''
65 foreach project_name: built_subprojects.split(',')
66 sub = subproject(project_name)
67 if sub.get_variable('build_hotdoc')
68 message('Building @0@ documentation'.format(project_name))
70 foreach lib: sub.get_variable('libs_doc', [])
71 hotdoc_subprojects += [lib]
72 libs += lib.full_path() + pathsep
76 foreach plugin_doc: sub.get_variable('plugins_doc', [])
77 plugins_doc += plugin_doc.full_path() + pathsep
78 hotdoc_subprojects += [plugin_doc]
82 message('@0@ did not build hotdoc documentation, can\'t build API doc'.format(project_name))
86 deps += [dependency('gstreamer-' + apiversion, fallback: ['gstreamer', 'gst_dep'])]
88 if get_option('use_portal_index')
89 index = 'markdown/index.md'
91 index = 'markdown/simple-index.md'
93 sitemap_gen = find_program('scripts/generate_sitemap.py')
94 sitemap = configure_file(command: [sitemap_gen, '@INPUT@', '@OUTPUT@',
95 'gi-index', libs, plugins_doc],
97 output: 'sitemap.txt')
99 html_theme = 'https://github.com/hotdoc/hotdoc_lumen_theme/releases/download/0.13.2/hotdoc_lumen_theme-0.13.2.tar.xz?sha256=5721189b7e985f27381ee20137f4a9003049a70a75ab1221a69fd04d27e752bc'
101 gstreamer_doc = hotdoc.generate_doc('GStreamer',
102 project_version: apiversion,
107 extra_assets: [join_paths(meson.current_source_dir(), 'images')],
108 syntax_highlighting_activate: true,
109 html_theme: html_theme,
111 meson.current_source_dir() / 'examples',
112 meson.current_source_dir() / 'markdown' / 'tutorials' / 'basic',
113 meson.current_source_dir() / 'markdown' / 'templates',
114 meson.current_source_dir() / 'markdown' / 'tutorials' / 'playback',
116 html_extra_theme: join_paths(meson.current_source_dir(), 'theme/extra'),
118 subprojects: hotdoc_subprojects,
119 disable_incremental_build: true,
120 gst_list_plugins_page: 'gst-index',
121 gst_index: join_paths(meson.current_source_dir(), 'markdown/plugins_doc.md'),
122 devhelp_activate: true,
123 devhelp_online: 'https://gstreamer.freedesktop.org/documentation/',
124 build_always_stale: true,
125 edit_on_github_repository: 'https://gitlab.freedesktop.org/gstreamer/gst-docs/',
126 previous_symbol_index: join_paths(meson.current_source_dir(), 'symbols', 'symbol_index.json'),
127 fatal_warnings: get_option('fatal_warnings')
130 cdata = configuration_data()
131 cdata.set('GST_API_VERSION', apiversion)
132 readme = configure_file(input: 'scripts/RELEASE_README.md',
134 configuration : cdata)
136 run_target('release',
137 command: [find_program('scripts/release.py'),
138 gstreamer_doc.full_path(),
139 meson.project_version(),
140 meson.current_build_dir()],
141 depends: [gstreamer_doc]