+ {{.Description}}
+ {{- if or .Schema.XValidations .Schema.Format .Schema.Enum .Schema.Default .Schema.Minimum .Schema.Maximum }}
+
+ {{- end}}
+ {{- if .Schema.XValidations }}
+ Validations:
+ {{- range .Schema.XValidations -}}
+
{{ .Rule }}: {{ .Message }}
+ {{- end -}}
+ {{- end }}
+ {{- if .Schema.Format }}
+ Format: {{ .Schema.Format }}
+ {{- end }}
+ {{- if .Schema.Enum }}
+ Enum: {{ .Schema.Enum | toStrings | join ", " }}
+ {{- end }}
+ {{- if .Schema.Default }}
+ Default: {{ .Schema.Default }}
+ {{- end }}
+ {{- if .Schema.Minimum }}
+ Minimum: {{ .Schema.Minimum }}
+ {{- end }}
+ {{- if .Schema.Maximum }}
+ Maximum: {{ .Schema.Maximum }}
+ {{- end }}
+
+
{{.Required}}
+
+ {{- end -}}
+
+
+
+{{- end}}{{/* range .Types */}}
+{{- end}}{{/* range .Kinds */}}
+{{- end}}{{/* range .Groups */}}
diff --git a/samples/Go Template/letter.tmpl b/samples/Go Template/letter.tmpl
new file mode 100644
index 0000000000..ead07fe231
--- /dev/null
+++ b/samples/Go Template/letter.tmpl
@@ -0,0 +1,11 @@
+Dear {{.Name}},
+{{if .Attended}}
+It was a pleasure to see you at the wedding.
+{{- else}}
+It is a shame you couldn't make it to the wedding.
+{{- end}}
+{{with .Gift -}}
+Thank you for the lovely {{.}}.
+{{end}}
+Best wishes,
+Josie
diff --git a/samples/Go Template/prettier.html.tmpl b/samples/Go Template/prettier.html.tmpl
new file mode 100644
index 0000000000..6c8c20675d
--- /dev/null
+++ b/samples/Go Template/prettier.html.tmpl
@@ -0,0 +1,12 @@
+{{ if or .Prev .Next -}}
+ {{ $p := where site.Pages }}
+
+{{ end -}}
diff --git a/samples/Smarty/header.tpl b/samples/Smarty/header.tpl
new file mode 100644
index 0000000000..ff63c92151
--- /dev/null
+++ b/samples/Smarty/header.tpl
@@ -0,0 +1,6 @@
+{* Smarty example from https://github.com/smarty-php/smarty/blob/master/demo/templates/header.tpl *}
+
+
+{$title} - {$Name}
+
+
diff --git a/samples/Smarty/index.tpl b/samples/Smarty/index.tpl
new file mode 100644
index 0000000000..a0f5ac36ca
--- /dev/null
+++ b/samples/Smarty/index.tpl
@@ -0,0 +1,86 @@
+{* Smarty example from https://github.com/smarty-php/smarty/blob/master/demo/templates/index.tpl *}
+{config_load file="test.conf" section="setup"}
+{include file="header.tpl" title=foo}
+
+
+
+{* bold and title are read from the config file *}
+ {if #bold#}{/if}
+ {* capitalize the first letters of each word of the title *}
+ Title: {#title#|capitalize}
+ {if #bold#}{/if}
+
+ The current date and time is {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
+
+ Example of accessing server environment variable SERVER_NAME: {$smarty.server.SERVER_NAME}
+
+ The value of {ldelim}$Name{rdelim} is {$Name}
+
+variable modifier example of {ldelim}$Name|upper{rdelim}
+
+{$Name|upper}
+
+
+An example of a section loop:
+
+ {section name=outer
+ loop=$FirstName}
+ {if $smarty.section.outer.index is odd by 2}
+ {$smarty.section.outer.rownum} . {$FirstName[outer]} {$LastName[outer]}
+ {else}
+ {$smarty.section.outer.rownum} * {$FirstName[outer]} {$LastName[outer]}
+ {/if}
+ {sectionelse}
+ none
+ {/section}
+
+ An example of section looped key values:
+
+ {section name=sec1 loop=$contacts}
+ phone: {$contacts[sec1].phone}
+
+
+ fax: {$contacts[sec1].fax}
+
+
+ cell: {$contacts[sec1].cell}
+
+ {/section}
+
+ {/strip}
+
+
+
+This is an example of the html_select_date function:
+
+
+
+This is an example of the html_select_time function:
+
+
+
+This is an example of the html_options function:
+
+
+
+{include file="footer.tpl"}
diff --git a/test/test_heuristics.rb b/test/test_heuristics.rb
index a0effa0112..41852501f3 100755
--- a/test/test_heuristics.rb
+++ b/test/test_heuristics.rb
@@ -1078,6 +1078,13 @@ def test_toc_by_heuristics
})
end
+ def test_tpl_by_heuristics
+ assert_heuristics({
+ "Go Template" => all_fixtures("Go Template", "*.tpl"),
+ "Smarty" => all_fixtures("Smarty", "*.tpl")
+ })
+ end
+
def test_ts_by_heuristics
assert_heuristics({
"TypeScript" => all_fixtures("TypeScript", "*.ts"),
diff --git a/vendor/README.md b/vendor/README.md
index a0ceb6b4e5..879c55835f 100644
--- a/vendor/README.md
+++ b/vendor/README.md
@@ -234,6 +234,7 @@ This is a list of grammars that Linguist selects to provide syntax highlighting
- **Go:** [tree-sitter/tree-sitter-go](https://github.com/tree-sitter/tree-sitter-go) 🐌
- **Go Checksums:** [golang/vscode-go](https://github.com/golang/vscode-go)
- **Go Module:** [golang/vscode-go](https://github.com/golang/vscode-go)
+- **Go Template:** [jinliming2/vscode-go-template](https://github.com/jinliming2/vscode-go-template)
- **Go Workspace:** [golang/vscode-go](https://github.com/golang/vscode-go)
- **Godot Resource:** [godotengine/godot-vscode-plugin](https://github.com/godotengine/godot-vscode-plugin)
- **Golo:** [TypeUnsafe/sublime-golo](https://github.com/TypeUnsafe/sublime-golo)
diff --git a/vendor/grammars/vscode-go-template b/vendor/grammars/vscode-go-template
new file mode 160000
index 0000000000..1ddab7c2d3
--- /dev/null
+++ b/vendor/grammars/vscode-go-template
@@ -0,0 +1 @@
+Subproject commit 1ddab7c2d3ef86fc4ea58df85d578d5da989d145
diff --git a/vendor/licenses/git_submodule/vscode-go-template.dep.yml b/vendor/licenses/git_submodule/vscode-go-template.dep.yml
new file mode 100644
index 0000000000..5b298cded7
--- /dev/null
+++ b/vendor/licenses/git_submodule/vscode-go-template.dep.yml
@@ -0,0 +1,31 @@
+---
+name: vscode-go-template
+version: 1ddab7c2d3ef86fc4ea58df85d578d5da989d145
+type: git_submodule
+homepage: https://github.com/jinliming2/vscode-go-template.git
+license: mit
+licenses:
+- sources: LICENSE
+ text: |
+ MIT License
+
+ Copyright (c) 2021 Liming Jin
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+notices: []