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

mt:module template more legible

parent 1d6ce2eb
No related branches found
No related tags found
1 merge request!1Main
...@@ -5,23 +5,17 @@ PREFIX st: <http://ns.inria.fr/sparql-template/> ...@@ -5,23 +5,17 @@ PREFIX st: <http://ns.inria.fr/sparql-template/>
# Recursive template for Modules and SousParties (because SousParties are just # Recursive template for Modules and SousParties (because SousParties are just
# leaf-level modules) # leaf-level modules)
template mt:module(?mod) { template mt:module(?mod) {
mt:start_marker(?mod) "/_index.md" st:nl() mt:start_marker(?mod) "/_index.md" "\n"
format {
"""+++
title = "%s"
%sbookCollapseSection = true
+++
# %1$s "+++\n"
'title = "' ?title '"\n'
{{< section >}}
"""
# STTL format{} apparently supports printf-style format string syntax
# (not explicitly documented but confirmed from testing), including
# "%1$" position specifiers, which allows reusing the 1st param by index
?title
coalesce(st:format("weight = %s\n", ?weight * 10), "") coalesce(st:format("weight = %s\n", ?weight * 10), "")
} st:nl() "bookCollapseSection = true\n"
"+++\n\n"
"# " ?title "\n\n"
"{{< section >}}\n\n"
group { group {
st:call-template(mt:module, ?child) ; separator='' st:call-template(mt:module, ?child) ; separator=''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment