Topic / jinja
5 pages
- Mapping AsciiDoc conditionals to Jinja
One OpenShift source file serves Enterprise, OKD, ROSA and Dedicated. Translating ifdef to Jinja keeps audience selection a render-time choice instead of baking one variant in.
- Mapping AsciiDoc ifeval to Jinja
ifeval couples a parent document to its modules by comparing context strings. Jinja expresses the same coupling — including the unsetting that stops it leaking.
- Mapping AsciiDoc includes and level offsets to Jinja
Includes map to Jinja natively. Level offsets do not exist in Jinja at all, so DogsBay extends it — and the extension has to be fence-aware.
- Mapping AsciiDoc variables to Jinja
Attribute definitions become Jinja set statements, references become expressions — with one naming rule you have to apply, because hyphens mean subtraction.
- Why Jinja is the right target
AsciiDoc preprocessing and Jinja templating express the same three ideas — variables, conditionals, includes. That correspondence is what makes the conversion faithful.