Skip to content

Commit ec6c84a

Browse files
committed
Try switching to askama templates
1 parent 352df97 commit ec6c84a

File tree

8 files changed

+241
-51
lines changed

8 files changed

+241
-51
lines changed

Cargo.lock

Lines changed: 163 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ clap = "2"
1717
regex = "1"
1818
log = "0.4"
1919
simplelog = "0.10"
20+
askama = "0.8"
2021

2122

2223
[package.metadata.rpm.cargo]

askama.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[general]
2+
# Directories to search for templates, relative to the crate root.
3+
dirs = ["data/templates"]

data/templates/assembly.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ For more information about nesting assemblies, see: https://redhat-documentation
44
See also the complementary step on the last line of this file.
55
////
66

7-
ifdef::context[:parent-context-of-${module_id}: {context}]
7+
ifdef::context[:parent-context-of-{{module_id}}: {context}]
88

99
////
1010
Base the file name and the ID on the assembly title. For example:
@@ -16,17 +16,17 @@ The ID is an anchor that links to the module. Avoid changing it after the module
1616
////
1717

1818
ifndef::context[]
19-
[id="${module_id}"]
19+
[id="{{module_id}}"]
2020
endif::[]
2121
ifdef::context[]
22-
[id="${module_id}_{context}"]
22+
[id="{{module_id}}_{context}"]
2323
endif::[]
24-
= ${module_title}
24+
= {{module_title}}
2525
////
2626
If the assembly covers a task, start the title with a verb in the gerund form, such as Creating or Configuring.
2727
////
2828
29-
:context: ${module_id}
29+
:context: {{module_id}}
3030
3131
////
3232
The `context` attribute enables module reuse. Every module ID includes {context}, which ensures that the module has a unique ID so you can include it multiple times in the same guide.
@@ -53,7 +53,7 @@ The following include statements pull in the module files that comprise the asse
5353
include::modules/TEMPLATE_CONCEPT_explaining_a_concept.adoc[leveloffset=+1]
5454
////
5555
56-
${include_statements}
56+
{{include_statements}}
5757
5858
////
5959
[leveloffset=+1] ensures that when a module title is a level 1 heading (= Title), the heading will be interpreted as a level-2 heading (== Title) in the assembly. Use [leveloffset=+2] and [leveloffset=+3] to nest modules in an assembly.
@@ -78,6 +78,6 @@ Optional. Delete if not used.
7878
////
7979
Restore the context to what it was before this assembly.
8080
////
81-
ifdef::parent-context-of-${module_id}[:context: {parent-context-of-${module_id}}]
82-
ifndef::parent-context-of-${module_id}[:!context:]
81+
ifdef::parent-context-of-{{module_id}}[:context: {parent-context-of-{{module_id}}}]
82+
ifndef::parent-context-of-{{module_id}}[:!context:]
8383

data/templates/concept.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ The ID is an anchor that links to the module. Avoid changing it after the module
1111
The `context` attribute enables module reuse. Every module ID includes {context}, which ensures that the module has a unique ID so you can include it multiple times in the same guide.
1212
////
1313

14-
[id="${module_id}_{context}"]
15-
= ${module_title}
14+
[id="{{module_id}}_{context}"]
15+
= {{module_title}}
1616
////
1717
In the title of concept modules, include nouns or noun phrases that are used in the body text. This helps readers and search engines find the information quickly. Do not start the title of concept modules with a verb. See also _Wording of headings_ in _The IBM Style Guide_.
1818
////

data/templates/procedure.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ The ID is an anchor that links to the module. Avoid changing it after the module
99
The `context` attribute enables module reuse. Every module ID includes {context}, which ensures that the module has a unique ID even if it is reused multiple times in a guide.
1010
////
1111

12-
[id="${module_id}_{context}"]
13-
= ${module_title}
12+
[id="{{module_id}}_{context}"]
13+
= {{module_title}}
1414
////
1515
Start the title of a procedure module with a verb, such as Creating or Create. See also _Wording of headings_ in _The IBM Style Guide_.
1616
////

data/templates/reference.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ The ID is an anchor that links to the module. Avoid changing it after the module
99
The `context` attribute enables module reuse. Every module ID includes {context}, which ensures that the module has a unique ID even if it is reused multiple times in a guide.
1010
////
1111

12-
[id="${module_id}_{context}"]
13-
= ${module_title}
12+
[id="{{module_id}}_{context}"]
13+
= {{module_title}}
1414
////
1515
In the title of a reference module, include nouns that are used in the body text. For example, "Keyboard shortcuts for ___" or "Command options for ___." This helps readers and search engines find the information quickly.
1616
////

0 commit comments

Comments
 (0)