[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 }} # Optional: {{ .Optional }}
{{- if eq .Type "bool" }} {{- if eq .Type "bool" }}
# Type: {{ .Type }}{{ if .SupportTemplate }} (Supports Templating){{ end }} # Type: {{ .Type }}{{ if .SupportTemplate }} (Supports Templating){{ end }}
{{ .Key }}: {{ eq .Default "true" }} {{ .Key }}: {{ eq .Default "true" }}{{ if .DefaultComment }} # {{ .DefaultComment }}{{ end }}
{{- end }} {{- end }}
{{- if eq .Type "duration" }} {{- if eq .Type "duration" }}
# Type: {{ .Type }}{{ if .SupportTemplate }} (Supports Templating){{ end }} # 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 }} {{- end }}
{{- if eq .Type "int64" }} {{- if eq .Type "int64" }}
# Type: {{ .Type }}{{ if .SupportTemplate }} (Supports Templating){{ end }} # 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 }} {{- end }}
{{- if eq .Type "string" }} {{- if eq .Type "string" }}
# Type: {{ .Type }}{{ if .SupportTemplate }} (Supports Templating){{ end }} # Type: {{ .Type }}{{ if .SupportTemplate }} (Supports Templating){{ end }}
{{ .Key }}: "{{ .Default }}" {{ .Key }}: "{{ .Default }}"{{ if .DefaultComment }} # {{ .DefaultComment }}{{ end }}
{{- end }} {{- end }}
{{- if eq .Type "stringslice" }} {{- if eq .Type "stringslice" }}
# Type: array of strings{{ if .SupportTemplate }} (Supports Templating in each string){{ end }} # Type: array of strings{{ if .SupportTemplate }} (Supports Templating in each string){{ end }}
{{ .Key }}: [] {{ .Key }}: []{{ if .DefaultComment }} # {{ .DefaultComment }}{{ end }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- else }} {{- else }}

View file

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