Debian Codegraph @

subprojects/meson-docs/docs/markdown/Hotdoc-module.md

raw
1 ---
2 short-description: Hotdoc module
3 authors:
4 - name: Thibault Saunier
5 email: [email protected]
6 years: [2018]
7 has-copyright: false
8 ...
9
10 # Hotdoc module
11
12 This module provides helper functions for generating documentation using
13 [hotdoc].
14
15 *Added 0.48.0*
16
17 ## Usage
18
19 To use this module, just do: **`hotdoc = import('hotdoc')`**. The
20 following functions will then be available as methods on the object
21 with the name `hotdoc`. You can, of course, replace the name `hotdoc`
22 with anything else.
23
24 ### hotdoc.generate_doc()
25
26 Generates documentation using [hotdoc] and installs it into `$prefix/share/doc/html`.
27
28 **Positional argument:**
29
30 * `project_name`: The name of the hotdoc project
31
32 **Keyworded arguments:**
33
34 * `sitemap` ([[@str]] or [[@file]]) (**required**): The hotdoc sitemap file
35 * `index` ([[@str]] or [[@file]]) (**required**): Location of the index file
36 * `dependencies`([[@build_tgt]]): Build targets to use when generating documentation.
37 * `depends`([[@custom_tgt]]): Custom targets on which this documentation target depends.
38 * `subprojects`: A list of `HotdocTarget` that are used as subprojects for hotdoc to generate
39 the documentation.
40 * ... Any argument of `hotdoc` can be used replacing dashes (`-`) with underscores (`_`).
41 For a full list of available parameters, just have a look at `hotdoc help`.
42
43 *Changed in 0.64.1:* `depends:` added.
44 Previously, all types of targets were accepted by `dependencies:`.
45 This is now deprecated.
46 Use `dependencies:` only with build targets, to pass their configuration to hotdoc.
47 Use `depends:` to set up dependency relationships on custom targets.
48
49 **Returns:**
50
51 `HotdocTarget`: A [[custom_target]] with the
52 following extra methods:
53
54 * `config_path`: Path to the generated `hotdoc` configuration file.
55
56 ### hotdoc.has_extensions()
57
58 **Positional arguments:**
59
60 * `...`: The hotdoc extension names to look for
61
62 **No keyworded arguments**
63
64 **Returns:** `true` if all the extensions where found, `false` otherwise.
65
66 ### Example
67
68 ``` meson
69 hotdoc = import('hotdoc')
70
71 hotdoc.generate_doc('foobar',
72 project_version: '0.1',
73 sitemap: 'sitemap.txt',
74 index: 'index.md',
75 c_sources: ['path/to/file.c'],
76 c_smart_index: true,
77 languages: ['c'],
78 install: true,
79 )
80 ```
81
82 [hotdoc]: https://hotdoc.github.io/