ea6b34d841ee9aa0938802a9de651e80ef3c7d91
[platform/upstream/gstreamer.git] / meson.build
1 project('GStreamer manuals and tutorials', 'c',
2   version: '1.17.0.1',
3   meson_version: '>=0.48.0')
4
5 hotdoc = import('hotdoc')
6 hotdoc_subprojects = []
7
8 apiversion = '1.0'
9 if host_machine.system() == 'windows'
10   pathsep = ';'
11 else
12   pathsep = ':'
13 endif
14
15 libs = ''
16 plugins_doc = ''
17 deps = []
18 plugins_sitemap = ''
19 if get_option('built_subprojects') != ''
20     foreach project_name: get_option('built_subprojects').split(',')
21         sub = subproject(project_name)
22         if sub.get_variable('build_hotdoc')
23             message('Building @0@ documentation'.format(project_name))
24
25             foreach lib: sub.get_variable('libs_doc')
26               hotdoc_subprojects += [lib]
27               libs += lib.full_path() + pathsep
28               deps += [lib]
29             endforeach
30
31             foreach plugin_doc: sub.get_variable('plugins_doc')
32               plugins_doc += plugin_doc.full_path() + pathsep
33               hotdoc_subprojects += [plugin_doc]
34               deps += [plugin_doc]
35             endforeach
36         else
37             message('@0@ did not build hotdoc documentation, can\'t build API doc'.format(project_name))
38         endif
39     endforeach
40 endif
41
42 if get_option('use_portal_index')
43   index = 'markdown/index.md'
44 else
45   index = 'markdown/simple-index.md'
46 endif
47 sitemap_gen = find_program('scripts/generate_sitemap.py')
48 sitemap = configure_file(command: [sitemap_gen, '@INPUT@', '@OUTPUT@',
49   index.split('/')[1], libs, plugins_doc],
50   input: 'sitemap.txt',
51   output: 'sitemap.txt')
52
53 html_theme = 'https://github.com/hotdoc/hotdoc_lumen_theme/releases/download/0.9/hotdoc_lumen_theme-0.9.tar.xz?sha256=ec3807f13eda2d4914fcf251b7e9607e90f33430725a2b1d433a90c9210a52fc'
54
55 gstreamer_doc = hotdoc.generate_doc('GStreamer',
56     project_version: apiversion,
57     sitemap: sitemap,
58     index: index,
59     install: true,
60     extra_assets: [join_paths(meson.current_source_dir(), 'images')],
61     syntax_highlighting_activate: true,
62     html_theme: html_theme,
63     include_paths: join_paths(meson.current_source_dir(), 'examples'),
64     html_extra_theme: join_paths(meson.current_source_dir(), 'theme/extra'),
65     dependencies: deps,
66     subprojects: hotdoc_subprojects,
67     disable_incremental_build: true,
68     gst_list_plugins_page: 'plugins_doc.md',
69     devhelp_activate: true,
70     build_always_stale: true,
71     edit_on_github_repository: 'https://gitlab.freedesktop.org/gstreamer/gst-docs/',
72 )