Project Docs Github
Log in
ittf site docs concepts t templateengine introduction.html.ittf Edit
  • /ittf/site/docs/concepts/t/templateengine/introduction.html.ittf
  • /ittf/site/docs/concepts/t/section.html.ittf
  • /ittf/site/docs/t/to-docs.html.ittf

/ittf/site/docs/concepts/t/templateengine/introduction.html.ittf (primary)

edit
                                            
1 $group
2 $
3 var sect = {
4 title: 'Template engine'
5 };
6 section( §)
7 p ITTF Documents are composable templates,
8 \b and their nodes can contain template commands and
9 to-docs( JsWizzi )
10 + expressions.
11 p The buildup of an
12 to-docs( mTree )
13 + can repeat node branches using commands
14 \b like '$foreach', '$backeach' and '$while' and can include or exclude node branches
15 \b using '$if', '$elif' and '$else' commands.
16 p JsWizzi statements and expressions are executed in the evaluation context
17 \b of an ITTF Document code unit (file)
18 \b and may access global context variables.
19 ittf-panel
20 title The $foreach command
21 schema ittf
22 ittf
23 ...
24 ${'$'}foreach item-name in collection-name
25 ... node branch ...
26 p Descendant nodes of this command are a repeat template; item-name
27 \b is user defined and collection-name is a JsWizzi expression that must evaluate
28 \b to an iterable javascript object, in the fragment or global scope.
29 p The var statement that declares item-name is auto-generated.
30 p Descendant nodes are repeated having item-name as a value in scope.
31 ittf-panel
32 title The $while command
33 schema ittf
34 ittf
35 ...
36 ${'$'}while jswizzi-expression
37 ... node branch ...
38 ${'$'} jswizzi-exit-condition-change
39 p Descendant nodes are repeated
40 \b until the jswizzi-expression evaluates to false.
41 p $ or $global commands must be used to modify the context values of the exit condition.
42 \b There is a limit of 10000 iterations to guard against accidental loops, after that an exception is raised.
43 p TODO make the limit of 10000 iterations configurable and an optional parameter of the loadMTree function.
44 ittf-panel
45 title The $break, $continue commands
46 schema ittf
47 ittf
48 ...
49 ${'$'}foreach ...
50 ...
51 ${'$'}break
52 ...
53 ${'$'}continue
54 ...
55 ${'$'}$while ...
56 ...
57 ${'$'}break
58 p This statements have the same meaning than in javascript and operate
59 \b breaking or continuing the template repetition.
60 \b Labels for continuation are not implemented.

/ittf/site/docs/concepts/t/section.html.ittf

edit
                                            
1 $group
2 $params §
3 article
4 . doc-title
5 id ${sect.id}
6 + ${sect.title}
7 . doc-summary
8 $hook

/ittf/site/docs/t/to-docs.html.ittf

edit
                                            
1 a
2 $params name
3 $if name.toLowerCase() === 'mtree' || name.toLowerCase() === 'mtrees'
4 a ${name}
5 href ${wzCtx.Params.baseUrl}/docs/mtrees.html
6 $elif name.toLowerCase() === 'ITTF Document' || name.toLowerCase() === 'ITTF Documents'
7 a ${name}
8 href ${wzCtx.Params.baseUrl}/docs/ittfdocuments.html
9 $elif name === 'Template engine'
10 a ${name}
11 href ${wzCtx.Params.baseUrl}/docs/templateengine.html
12 $elif name.toLowerCase() === 'jswizzi'
13 a ${name}
14 href ${wzCtx.Params.baseUrl}/docs/jswizzi.html
15 $elif name.toLowerCase() === 'wizzi model' || name.toLowerCase() === 'wizzi models'
16 a ${name}
17 href ${wzCtx.Params.baseUrl}/docs/wizzimodels.html
18 $elif name.toLowerCase() === 'wizzi schema' || name.toLowerCase() === 'wizzi schemas'
19 a ${name}
20 href ${wzCtx.Params.baseUrl}/docs/wizzischemas.html
21 $elif name.toLowerCase() === 'wizzi model dom' || name.toLowerCase() === 'wizzi model doms'
22 a ${name}
23 href ${wzCtx.Params.baseUrl}/docs/wizzimodeldoms.html
24 $elif name.toLowerCase() === 'model transformers'
25 a ${name}
26 href ${wzCtx.Params.baseUrl}/docs/modeltransformers.html
27 $elif name.toLowerCase() === 'artifact generations'
28 a ${name}
29 href ${wzCtx.Params.baseUrl}/docs/artifacts.html
30 $elif name.toLowerCase() === 'wizzi api' || name.toLowerCase() === 'wizzi.wizzifactory'
31 a ${name}
32 href ${wzCtx.Params.baseUrl}/docs/wizziapi.html
33 $else
34 h1 ERROR to-docs unknown ${name}
Save
Save & Refresh
Cancel