forked from siderolabs/talos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: rework machine config documentation generation
Generate a structured table of contents following the structure of the config. Make high-level examples follow the full structure of the config. Document new multi-doc machine config. Fixes siderolabs#8023 Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
- Loading branch information
Showing
5 changed files
with
859 additions
and
1,814 deletions.
There are no files selected for viewing
This file contains 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 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,37 @@ | ||
{{ .Description }} | ||
{{- $anchors := .Anchors -}} | ||
{{- $struct := index .Structs 0 }} | ||
|
||
{{ block "struct" dict "Struct" $struct "Level" 2 "Name" $struct.Type "Path" $struct.Type "Types" .Types }} | ||
{{ repeat "#" .Level }} {{ .Name }} {#{{ .Path }}} | ||
|
||
{{ if .Struct.Description -}} | ||
{{ .Struct.Description }} | ||
{{ end }} | ||
|
||
{{ range $example := .Struct.Examples }} | ||
{{ yaml $example.GetValue "" }} | ||
{{ end }} | ||
|
||
{{ if .Struct.Fields -}} | ||
| Field | Type | Description | Value(s) | | ||
|-------|------|-------------|----------| | ||
{{ range $field := $.Struct.Fields -}} | ||
{{ if $field.Name -}} | ||
|`{{ $field.Name }}` | | ||
{{- $type := index $.Types $field.Type }}{{ if $type }}<a href="#{{ $.Path }}.{{ $field.Name }}">{{ $field.Type }}</a>{{ else }}{{ $field.Type }}{{ end }} | | ||
{{- fmtDesc $field.Description }} {{ with $field.Examples }}<details><summary>Show example(s)</summary>{{ range . }}{{ yaml .GetValue $field.Name }}{{ end }}</details>{{ end }} | | ||
{{- range $value := $field.Values }}`{{ $value }}`<br />{{ end }} | | ||
{{ end -}} | ||
{{ end }} | ||
{{ end }} | ||
|
||
|
||
{{ range $field := .Struct.Fields }} | ||
{{- $struct := index $.Types $field.Type -}} | ||
{{- if $struct -}} | ||
{{ template "struct" dict "Struct" $struct "Level" (add $.Level 1) "Name" $field.Name "Types" $.Types "Path" (printf "%s.%s" $.Path $field.Name) }} | ||
{{- end -}} | ||
{{ end }} | ||
|
||
{{ end }} |
This file contains 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 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
Oops, something went wrong.