-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Add Go Template and differentiate from Smarty #7687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| {{- /* Generate basic labels */ -}} | ||
| {{- define "mychart.labels" }} | ||
| labels: | ||
| generator: helm | ||
| date: {{ now | htmlDate }} | ||
| chart: {{ .Chart.Name }} | ||
| version: {{ .Chart.Version }} | ||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| {{- /* https://github.com/redhat-cop/helm-charts/blob/main/_templates.gotmpl */ -}} | ||
|
|
||
| {{ define "doc.header" -}} | ||
|
|
||
| {{ template "chart.header" . }} | ||
| [](https://opensource.org/licenses/Apache-2.0) | ||
|
|
||
| {{ template "chart.versionBadge" . }} | ||
|
|
||
| {{ template "chart.deprecationWarning" . }} | ||
|
|
||
| ## Description | ||
|
|
||
| {{ template "chart.description" . }} | ||
|
|
||
| {{- end }} | ||
|
|
||
| {{ define "doc.maintainer_and_sources" -}} | ||
|
|
||
| {{ template "chart.maintainersSection" . }} | ||
|
|
||
| ## Sources | ||
| Source: {{ template "chart.sourcesList" . }} | ||
|
|
||
| Source code: {{ template "chart.homepage" . }} | ||
|
|
||
| {{- end }} | ||
|
|
||
|
|
||
| {{ define "doc.deps" -}} | ||
|
|
||
| ## Dependencies | ||
|
|
||
| This chart has the following dependencies: | ||
|
|
||
| {{ template "chart.requirementsTable" . }} | ||
|
|
||
| {{- end }} | ||
|
|
||
| {{ define "doc.values" -}} | ||
|
|
||
| {{ template "chart.valuesSection" . }} | ||
|
|
||
| {{- end }} | ||
|
|
||
|
|
||
| {{ define "doc.footer" -}} | ||
|
|
||
| ## Installing the Chart | ||
|
|
||
| To install the chart with the release name `my-release`: | ||
|
|
||
| ```console | ||
| helm install my-release repo/<chart-name>> | ||
| ``` | ||
|
|
||
| The command deploys the chart on the Kubernetes cluster in the default configuration. | ||
|
|
||
| ## Uninstalling the Chart | ||
|
|
||
| To uninstall/delete the my-release deployment: | ||
|
|
||
| ```console | ||
| helm delete my-release | ||
| ``` | ||
|
|
||
| The command removes all the Kubernetes components associated with the chart and deletes the release. | ||
|
|
||
| {{ template "helm-docs.versionFooter" . }} | ||
|
|
||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| {{ /* Example from https://github.com/go-echarts/go-echarts/blob/master/templates/base.tpl */ }} | ||
| {{- define "base_element" -}} | ||
| <div class="container"> | ||
| <div class="item" id="{{ .ChartID }}" style="width:{{ .Initialization.Width }};height:{{ .Initialization.Height }};"></div> | ||
| </div> | ||
| {{- end -}} | ||
|
|
||
| {{- define "base_script" -}} | ||
| <script type="text/javascript"> | ||
| "use strict"; | ||
| let goecharts_{{ .ChartID | safeJS }} = echarts.init(document.getElementById('{{ .ChartID | safeJS }}'), "{{ .Theme }}", { renderer: "{{ .Initialization.Renderer }}" }); | ||
| let option_{{ .ChartID | safeJS }} = {{ template "base_option" . }} | ||
| goecharts_{{ .ChartID | safeJS }}.setOption(option_{{ .ChartID | safeJS }}); | ||
|
|
||
| {{- range $listener := .EventListeners }} | ||
| {{if .Query }} | ||
| goecharts_{{ $.ChartID | safeJS }}.on({{ $listener.EventName }}, {{ $listener.Query | safeJS }}, {{ injectInstance $listener.Handler "%MY_ECHARTS%" $.ChartID | safeJS }}); | ||
| {{ else }} | ||
| goecharts_{{ $.ChartID | safeJS }}.on({{ $listener.EventName }}, {{ injectInstance $listener.Handler "%MY_ECHARTS%" $.ChartID | safeJS }}) | ||
| {{ end }} | ||
| {{- end }} | ||
|
|
||
| {{- range .JSFunctions.Fns }} | ||
| {{ injectInstance . "%MY_ECHARTS%" $.ChartID | safeJS }} | ||
| {{- end }} | ||
| </script> | ||
| {{- end -}} | ||
|
|
||
| {{- define "base_option" }} | ||
| {{- .JSONNotEscaped | safeJS }} | ||
| {{- end }}; | ||
|
|
||
| {{- define "base" }} | ||
| {{- template "base_element" . }} | ||
| {{- template "base_script" . }} | ||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| {{- /* https://github.com/ncruces/RethinkRAW/blob/master/assets/batch.gohtml */ -}} | ||
| <!doctype html> | ||
| <html lang=en> | ||
|
|
||
| <head> | ||
| <meta charset="utf-8"> | ||
| <title>RethinkRAW: Batch processing {{len .Photos}} photos</title> | ||
| <link rel="manifest" href="/manifest.json" crossorigin="use-credentials"> | ||
| <link rel="shortcut icon" href="/favicon.ico"> | ||
| <link rel="stylesheet" href="/main.css"> | ||
| <link rel="stylesheet" href="/batch.css"> | ||
| <link rel="stylesheet" href="/raw-editor.css"> | ||
| <link rel="stylesheet" href="/dialog-polyfill.css"> | ||
| <link rel="preload" as="style" href="/normalize.css"> | ||
| <link rel="preload" as="style" href="/fontawesome.css"> | ||
| <link rel="preload" as="font" type="font/woff2" crossorigin href="/fa-solid-900.woff2"> | ||
| <script src="/dialog-polyfill.js" defer></script> | ||
| <script src="/main.js" defer></script> | ||
| <script src="/batch.js" defer></script> | ||
| <script src="/raw-editor.js" defer></script> | ||
| <noscript><meta http-equiv="refresh" content="0;url=/browser.html"></noscript> | ||
| </head> | ||
|
|
||
| <body> | ||
| {{- template "raw-editor.gohtml" "hidden"}} | ||
|
|
||
| <div id=menu-sticker> | ||
| <div id=menu> | ||
| <div class="toolbar"> | ||
| <button type=button title="Go back" class="minimal-ui" onclick="back()"><i class="fas fa-arrow-left"></i></button> | ||
| <button type=button title="Reload photos" class="minimal-ui" onclick="location.reload()"><i class="fas fa-sync"></i></button> | ||
| <button type=button title="S̲ave changes" accesskey="s" onclick="saveFile()" id=save disabled><i class="fas fa-save"></i></button> | ||
| {{- if .Export}} | ||
| <button type=button title="Ex̲port JPEGs (⌥-click for options)" accesskey="x" class="alt-off" onclick="exportFile()"><i class="fas fa-file-image"></i></button> | ||
| <button type=button title="Export…" class="alt-on" onclick="exportFile('dialog')"><i class="fas fa-file-download"></i></button> | ||
| {{- end}} | ||
| <button type=button title="Edit photos…" onclick="toggleEdit()" id=edit><i class="fas fa-sliders-h"></i></button> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| <div id=gallery> | ||
| {{- range .Photos}} | ||
| <a href="/photo/{{.Path}}" onclick="return popup(this, event)"> | ||
| <img loading=lazy title="{{.Name}}" alt="{{.Name}}" src="/thumb/{{.Path}}" onerror="parentNode.hidden=true"> | ||
| </a> | ||
| {{- else}} | ||
| <span>No RAW photos here.</span> | ||
| {{- end}} | ||
| </div> | ||
|
|
||
| <dialog id=progress-dialog> | ||
| Lorem ipsum<br> | ||
| <progress></progress> | ||
| </dialog> | ||
| </body> | ||
|
|
||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| {{- /* https://github.com/grafana/k6-operator/blob/main/docs/crd.tmpl */ -}} | ||
| --- | ||
| title: {{or .Metadata.Title "API Reference"}} | ||
| weight: {{or .Metadata.Weight 1 }} | ||
| {{- if .Metadata.Description}} | ||
| description: {{.Metadata.Description}} | ||
| {{- end}} | ||
| --- | ||
|
|
||
|
|
||
| Packages: | ||
| {{range .Groups}} | ||
| - [{{.Group}}/{{.Version}}](#{{ anchorize (printf "%s/%s" .Group .Version) }}) | ||
| {{- end -}}{{/* range .Groups */}} | ||
|
|
||
| {{- range .Groups }} | ||
| {{- $group := . }} | ||
|
|
||
| # {{.Group}}/{{.Version}} | ||
|
|
||
| Resource Types: | ||
| {{range .Kinds}} | ||
| - [{{.Name}}](#{{ anchorize .Name }}) | ||
| {{end}}{{/* range .Kinds */}} | ||
|
|
||
| {{range .Kinds}} | ||
| {{$kind := .}} | ||
| ## {{.Name}} | ||
| <sup><sup>[↩ Parent](#{{ anchorize (printf "%s/%s" $group.Group $group.Version) }} )</sup></sup> | ||
|
|
||
| {{range .Types}} | ||
|
|
||
| {{if not .IsTopLevel}} | ||
| ### {{.Name}} | ||
| {{if .ParentKey}}<sup><sup>[↩ Parent](#{{.ParentKey}})</sup></sup>{{end}} | ||
| {{end}} | ||
|
|
||
|
|
||
| {{.Description}} | ||
|
|
||
| <table> | ||
| <thead> | ||
| <tr> | ||
| <th>Name</th> | ||
| <th>Type</th> | ||
| <th>Description</th> | ||
| <th>Required</th> | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| {{- if .IsTopLevel -}} | ||
| <tr> | ||
| <td><b>apiVersion</b></td> | ||
| <td>string</td> | ||
| <td>{{$group.Group}}/{{$group.Version}}</td> | ||
| <td>true</td> | ||
| </tr> | ||
| <tr> | ||
| <td><b>kind</b></td> | ||
| <td>string</td> | ||
| <td>{{$kind.Name}}</td> | ||
| <td>true</td> | ||
| </tr> | ||
| <tr> | ||
| <td><b><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#objectmeta-v1-meta">metadata</a></b></td> | ||
| <td>object</td> | ||
| <td>Refer to the Kubernetes API documentation for the fields of the `metadata` field.</td> | ||
| <td>true</td> | ||
| </tr> | ||
| {{- end -}} | ||
| {{- range .Fields -}} | ||
| <tr> | ||
| <td><b>{{if .TypeKey}}<a href="#{{.TypeKey}}">{{.Name}}</a>{{else}}{{.Name}}{{end}}</b></td> | ||
| <td>{{.Type}}</td> | ||
| <td> | ||
| {{.Description}}<br/> | ||
| {{- if or .Schema.XValidations .Schema.Format .Schema.Enum .Schema.Default .Schema.Minimum .Schema.Maximum }} | ||
| <br/> | ||
| {{- end}} | ||
| {{- if .Schema.XValidations }} | ||
| <i>Validations</i>: | ||
| {{- range .Schema.XValidations -}} | ||
| <li>{{ .Rule }}: {{ .Message }}</li> | ||
| {{- end -}} | ||
| {{- end }} | ||
| {{- if .Schema.Format }} | ||
| <i>Format</i>: {{ .Schema.Format }}<br/> | ||
| {{- end }} | ||
| {{- if .Schema.Enum }} | ||
| <i>Enum</i>: {{ .Schema.Enum | toStrings | join ", " }}<br/> | ||
| {{- end }} | ||
| {{- if .Schema.Default }} | ||
| <i>Default</i>: {{ .Schema.Default }}<br/> | ||
| {{- end }} | ||
| {{- if .Schema.Minimum }} | ||
| <i>Minimum</i>: {{ .Schema.Minimum }}<br/> | ||
| {{- end }} | ||
| {{- if .Schema.Maximum }} | ||
| <i>Maximum</i>: {{ .Schema.Maximum }}<br/> | ||
| {{- end }} | ||
| </td> | ||
| <td>{{.Required}}</td> | ||
| </tr> | ||
| {{- end -}} | ||
| </tbody> | ||
| </table> | ||
|
|
||
| {{- end}}{{/* range .Types */}} | ||
| {{- end}}{{/* range .Kinds */}} | ||
| {{- end}}{{/* range .Groups */}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| {{ if or .Prev .Next -}} | ||
| {{ $p := where site.Pages }} | ||
| <div class="my-navigation"> | ||
| {{ with $p.Next . -}} | ||
| <a href="{{ .RelPermalink }}"> | ||
| <div class="row"> | ||
| <div class="cell py-2">{{ .Title }}</div> | ||
| </div> | ||
| </a> | ||
| {{ end -}} | ||
| </div> | ||
| {{ end -}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| {* Smarty example from https://github.com/smarty-php/smarty/blob/master/demo/templates/header.tpl *} | ||
| <HTML> | ||
| <HEAD> | ||
| <TITLE>{$title} - {$Name}</TITLE> | ||
| </HEAD> | ||
| <BODY bgcolor="#ffffff"> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.