twitch-bot/actorDocs.tpl
Knut Ahlers 3c00298760
[docs] Allow to comment default value for actor docs
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2023-08-14 16:04:03 +02:00

48 lines
1.7 KiB
Smarty

---
title: "Available Actions"
---
{{ "{{< lead >}}" }}
All these actions can be executed by your bot as soon as you add them to rules. Read their documentation to learn how to master them.
{{ "{{< /lead >}}" }}
{{ range .Actors }}
## {{ .Name }}
{{ .Description }}
```yaml
- type: {{ .Type }}
{{- if gt (len .Fields) 0 }}
attributes:
{{- range .Fields }}
# {{ .Description }}
# Optional: {{ .Optional }}
{{- if eq .Type "bool" }}
# Type: {{ .Type }}{{ if .SupportTemplate }} (Supports Templating){{ end }}
{{ .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 }}{{ if .DefaultComment }} # {{ .DefaultComment }}{{ end }}
{{- end }}
{{- if eq .Type "int64" }}
# Type: {{ .Type }}{{ if .SupportTemplate }} (Supports Templating){{ 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 }}"{{ if .DefaultComment }} # {{ .DefaultComment }}{{ end }}
{{- end }}
{{- if eq .Type "stringslice" }}
# Type: array of strings{{ if .SupportTemplate }} (Supports Templating in each string){{ end }}
{{ .Key }}: []{{ if .DefaultComment }} # {{ .DefaultComment }}{{ end }}
{{- end }}
{{- end }}
{{- else }}
# Does not have configuration attributes
{{- end }}
```
{{ end }}
{{ if false }}<!-- vim: set ft=markdown: -->{{ end }}