Skip to content
Snippets Groups Projects
Commit 1d6ce2eb authored by Eliott Sammier's avatar Eliott Sammier
Browse files

Template st:module now better supports unbound variables

parent 1c69742d
No related branches found
No related tags found
1 merge request!1Main
...@@ -9,8 +9,7 @@ template mt:module(?mod) { ...@@ -9,8 +9,7 @@ template mt:module(?mod) {
format { format {
"""+++ """+++
title = "%s" title = "%s"
weight = %s0 %sbookCollapseSection = true
bookCollapseSection = true
+++ +++
# %1$s # %1$s
...@@ -21,7 +20,7 @@ bookCollapseSection = true ...@@ -21,7 +20,7 @@ bookCollapseSection = true
# (not explicitly documented but confirmed from testing), including # (not explicitly documented but confirmed from testing), including
# "%1$" position specifiers, which allows reusing the 1st param by index # "%1$" position specifiers, which allows reusing the 1st param by index
?title ?title
?weight coalesce(st:format("weight = %s\n", ?weight * 10), "")
} st:nl() } st:nl()
group { group {
...@@ -42,6 +41,8 @@ bookCollapseSection = true ...@@ -42,6 +41,8 @@ bookCollapseSection = true
# Module / section attributes # Module / section attributes
?mod :titre ?title . ?mod :titre ?title .
optional {
?mod :index ?index . ?mod :index ?index .
bind(?index + 1 as ?weight) bind(?index + 1 as ?weight)
} }
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment