Q:
Given:
{{define A}}
D
E
F
{{end}}
Or multi-line variables just like that, let's say I have the template setup like below:
How do I make "template A" stay properly indented on rendering?
A:
Option 1:
A
B
C
{{template A | indent 5 }}
Option 2:
A
B
C
{{template A | pindent 5 }}
Ref:
|
{ |
|
`{{ indent 2 "a" }}`, |
|
"a", |
|
}, |
|
{ |
|
`{{ indent 2 "a\nb\nc" }}`, |
|
"a\n b\n c", |
|
}, |
|
{ |
|
`{{ pindent 2 "a" }}`, |
|
" a", |
|
}, |
|
{ |
|
`{{ pindent 2 "a\nb\nc" }}`, |
|
" a\n b\n c", |
|
}, |
PS. I like "Option 1" more because it is more intuitive.
Q:
Given:
Or multi-line variables just like that, let's say I have the template setup like below:
How do I make "template A" stay properly indented on rendering?
A:
Option 1:
Option 2:
Ref:
easygen/t_strings_test.go
Lines 186 to 201 in e7798da
PS. I like "Option 1" more because it is more intuitive.