3
0

Doc codegen tweaks & cleanup

This commit is contained in:
Tomaž Jerman
2020-12-05 10:30:10 +01:00
parent 01cfbf92a8
commit 402289016d
11 changed files with 56 additions and 49 deletions

View File

@@ -8,37 +8,44 @@
// - {{ .Source }}
{{- end }}
= Resources and events
{{- range .Definitions }}
{{- range .Resources }}
= {{ .ResourceString }}
== {{ .ResourceString }}
== Events
=== Events
.Events:
{{- if .BeforeAfter }}
.Before/after events:
{{- range $ba := .BeforeAfter }}
* `before('{{ $ba }}')`
{{- end }}
{{- range $ba := .BeforeAfter }}
* `after('{{ $ba }}')`
{{- end }}
{{- end }}
{{ if .On -}}
.On events:
{{- range $on := .On }}
* `on('{{ $on }}')`
{{- end }}
{{- end }}
== Argument properties
=== Exec arguments
.Argument properties:
[%header, cols=3*]
|===
|Name|Type|Immutable
|Name|Type|Mutable
{{- range $p := .Properties }}
| `{{ $p.Name }}`
| `{{ $p.Type }}`
{{- if $p.Immutable }}
| yes
{{ else }}
| no
{{ else }}
| yes
{{ end -}}
{{ end -}}

View File

@@ -8,26 +8,22 @@
// - {{ .Source }}
{{- end }}
= ENV options
{{ range .Definitions }}
= {{ .Docs.Title }}
== {{ .Docs.Title }}
{{ if .Docs.Intro }}
{{ .Docs.Intro }}
{{ end }}
{{- range .Properties }}
=== *{{ toUpper .Env }}* `{{ .Type }}`
{{ range .Properties }}
== *{{ toUpper .Env }}* `{{ .Type }}`
{{ if .Default }}
{{ if or .Default .Description -}}
{{ if .Default -}}
Default::
`{{ .Default }}`
`{{ .Default }}`
{{ end -}}
{{ if .Description }}
{{ if .Description -}}
Description::
{{ .Description }}
{{ end -}}
{{ end }}
{{ end }}
{{ .Description }}
{{ end -}}{{ end -}}
{{ end }}{{ end }}