summaryrefslogtreecommitdiffstats
path: root/docs/HACKING.md
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-05-17 21:32:49 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-05-19 03:25:26 +0200
commit89f52a780e54b2eb0905a6e613f6d4afcb22256b (patch)
treed70c132a4aa6f7a2a249e45dc75e83c6c3e90c6f /docs/HACKING.md
parentmeson: add workaround for old meson (diff)
downloadsystemd-89f52a780e54b2eb0905a6e613f6d4afcb22256b.tar.xz
systemd-89f52a780e54b2eb0905a6e613f6d4afcb22256b.zip
docs/HACKING: add note about template engines
Diffstat (limited to '')
-rw-r--r--docs/HACKING.md22
1 files changed, 20 insertions, 2 deletions
diff --git a/docs/HACKING.md b/docs/HACKING.md
index 6306eee139..4374ba097d 100644
--- a/docs/HACKING.md
+++ b/docs/HACKING.md
@@ -106,13 +106,31 @@ And after that, head over to your repo on GitHub and click "Compare & pull reque
Happy hacking!
+## Templating engines in .in files
+
+Some source files are generated during build. We use two templating engines:
+* meson's `configure_file()` directive uses syntax with `@VARIABLE@`.
+
+ See https://mesonbuild.com/Reference-manual.html#configure_file for
+ details.
+
+* most files are rendered using jinja2, with `{{VARIABLE}}` and `{% if … %}`,
+ `{% elif … %}`, `{% else … %}`, `{% endif … %}` blocks. `{# … #}` is a
+ jinja2 comment, i.e. that block will not be visible in the rendered
+ output. `{% raw %} … {% endraw %}` creates a block where the jinja2 syntax
+ is not interpreted.
+
+ See https://jinja2docs.readthedocs.io/en/stable/templates.html#synopsis
+ for details.
+
+Please note that files for both template engines use the `.in` extension.
## Developer and release modes
In the default meson configuration (`-Dmode=developer`), certain checks are
enabled that are suitable when hacking on systemd (such as internal
-documentation consistency checks). Those are not useful when compiling for code
-for distribution and can be disabled by setting `-Dmode=release`.
+documentation consistency checks). Those are not useful when compiling for
+distribution and can be disabled by setting `-Dmode=release`.
## Fuzzers