2

We use scriban templating engine in my team. I am having trouble finding the resource which can help in resolving the following issue:

In this scenario I would like to indent the echo statements(this is simplifying the problem for the sake of this post) for the purpose of improving the readability.

So instead of this:

{{ if true -}}
echo "hi"
echo "foo"
echo "bar"
{{ end }}

We want this:

{{ if true }}
   echo "hi"
   echo "foo"
   echo "bar"
{{ end }}

But when we indent the text like above, then it does show up literally like that in generated output. How can I remove the beginning tab or white space from each line of a multi-line text in the generated output?

I tried the -}} but this only removes the white space of the beginning line that is the echo "hi" line.

Kiran
  • 56,921
  • 15
  • 176
  • 161

0 Answers0