"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tpl/internal/go_templates/texttemplate/doc.go" between
hugo-0.80.0.tar.gz and hugo-0.81.0.tar.gz

About: Hugo is a static site generator that takes a source directory of Markdown files and templates and uses these as input to create a complete website (written in Go).

doc.go  (hugo-0.80.0):doc.go  (hugo-0.81.0)
skipping to change at line 43 skipping to change at line 43
tmpl, err := template.New("test").Parse("{{.Count}} items are made of {{. Material}}") tmpl, err := template.New("test").Parse("{{.Count}} items are made of {{. Material}}")
if err != nil { panic(err) } if err != nil { panic(err) }
err = tmpl.Execute(os.Stdout, sweaters) err = tmpl.Execute(os.Stdout, sweaters)
if err != nil { panic(err) } if err != nil { panic(err) }
More intricate examples appear below. More intricate examples appear below.
Text and spaces Text and spaces
By default, all text between actions is copied verbatim when the template is By default, all text between actions is copied verbatim when the template is
executed. For example, the string " items are made of " in the example above app executed. For example, the string " items are made of " in the example above
ears appears on standard output when the program is run.
on standard output when the program is run.
However, to aid in formatting template source code, if an action's left delimite However, to aid in formatting template source code, if an action's left
r delimiter (by default "{{") is followed immediately by a minus sign and white
(by default "{{") is followed immediately by a minus sign and ASCII space charac space, all trailing white space is trimmed from the immediately preceding text.
ter Similarly, if the right delimiter ("}}") is preceded by white space and a minus
("{{- "), all trailing white space is trimmed from the immediately preceding tex sign, all leading white space is trimmed from the immediately following text.
t. In these trim markers, the white space must be present:
Similarly, if the right delimiter ("}}") is preceded by a space and minus sign "{{- 3}}" is like "{{3}}" but trims the immediately preceding text, while
(" -}}"), all leading white space is trimmed from the immediately following text "{{-3}}" parses as an action containing the number -3.
.
In these trim markers, the ASCII space must be present; "{{-3}}" parses as an
action containing the number -3.
For instance, when executing the template whose source is For instance, when executing the template whose source is
"{{23 -}} < {{- 45}}" "{{23 -}} < {{- 45}}"
the generated output would be the generated output would be
"23<45" "23<45"
For this trimming, the definition of white space characters is the same as in Go : For this trimming, the definition of white space characters is the same as in Go :
 End of changes. 2 change blocks. 
14 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)