[docs] Allow to comment default value for actor docs

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2023-08-14 16:03:06 +02:00
parent 8a40f105e3
commit 3c00298760
Signed by: luzifer
GPG Key ID: D91C3E91E4CAD6F5
2 changed files with 6 additions and 5 deletions

View File

@ -20,23 +20,23 @@ All these actions can be executed by your bot as soon as you add them to rules.
# Optional: {{ .Optional }}
{{- if eq .Type "bool" }}
# Type: {{ .Type }}{{ if .SupportTemplate }} (Supports Templating){{ end }}
{{ .Key }}: {{ eq .Default "true" }}
{{ .Key }}: {{ eq .Default "true" }}{{ if .DefaultComment }} # {{ .DefaultComment }}{{ end }}
{{- end }}
{{- if eq .Type "duration" }}
# Type: {{ .Type }}{{ if .SupportTemplate }} (Supports Templating){{ end }}
{{ .Key }}: {{ if eq .Default "" }}0s{{ else }}{{ .Default }}{{ end }}
{{ .Key }}: {{ if eq .Default "" }}0s{{ else }}{{ .Default }}{{ end }}{{ if .DefaultComment }} # {{ .DefaultComment }}{{ end }}
{{- end }}
{{- if eq .Type "int64" }}
# Type: {{ .Type }}{{ if .SupportTemplate }} (Supports Templating){{ end }}
{{ .Key }}: {{ if eq .Default "" }}0{{ else }}{{ .Default }}{{ end }}
{{ .Key }}: {{ if eq .Default "" }}0{{ else }}{{ .Default }}{{ end }}{{ if .DefaultComment }} # {{ .DefaultComment }}{{ end }}
{{- end }}
{{- if eq .Type "string" }}
# Type: {{ .Type }}{{ if .SupportTemplate }} (Supports Templating){{ end }}
{{ .Key }}: "{{ .Default }}"
{{ .Key }}: "{{ .Default }}"{{ if .DefaultComment }} # {{ .DefaultComment }}{{ end }}
{{- end }}
{{- if eq .Type "stringslice" }}
# Type: array of strings{{ if .SupportTemplate }} (Supports Templating in each string){{ end }}
{{ .Key }}: []
{{ .Key }}: []{{ if .DefaultComment }} # {{ .DefaultComment }}{{ end }}
{{- end }}
{{- end }}
{{- else }}

View File

@ -11,6 +11,7 @@ type (
ActionDocumentationField struct {
Default string `json:"default"`
DefaultComment string `json:"default_comment"`
Description string `json:"description"`
Key string `json:"key"`
Long bool `json:"long"`