feat(telegraf): Use metadata from autogenerated Telegraf docs in template frontmatter.
- Use plugin type and version to build related links - Insert tag list into frontmatter tags - Rename metadata in content bodypull/5656/head
parent
b8d8b9b3ef
commit
070cbbe5e1
|
@ -11,6 +11,10 @@ node_modules
|
||||||
/content/influxdb*/**/api/**/*.html
|
/content/influxdb*/**/api/**/*.html
|
||||||
!api-docs/**/.config.yml
|
!api-docs/**/.config.yml
|
||||||
/api-docs/redoc-static.html*
|
/api-docs/redoc-static.html*
|
||||||
|
/telegraf-build
|
||||||
|
!telegraf-build/templates
|
||||||
|
!telegraf-build/scripts
|
||||||
|
!telegraf-build/README.md
|
||||||
.vscode/*
|
.vscode/*
|
||||||
.idea
|
.idea
|
||||||
**/config.toml
|
**/config.toml
|
||||||
|
|
|
@ -68,14 +68,32 @@ To test manually run the build process on your local system
|
||||||
4. To generate the documentation, run the `telegraf-internal/telegraf_release/bin/docs` binary and include the Telegraf release tag to build--for example:
|
4. To generate the documentation, run the `telegraf-internal/telegraf_release/bin/docs` binary and include the Telegraf release tag to build--for example:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# From ~/Documents/github
|
# Change to `telegraf-build` in your local docs-v2 repo.
|
||||||
telegraf-internal/telegraf_release/bin/docs v1.33.0
|
cd ~/Documents/github/docs-v2/telegraf-build
|
||||||
|
# Run the `docs` binary to generate the documentation.
|
||||||
|
~/Documents/github/telegraf-internal/telegraf_release/bin/docs v1.33.0
|
||||||
```
|
```
|
||||||
|
|
||||||
Currently, the binary uses the templates in `telegraf-internal/telegraf_release/docs/templates/`, however we expect to permanently move them to `docs-v2/telegraf-build/templates` soon.
|
You can skip steps for local testing:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
~/Documents/github/telegraf-internal/telegraf_release/bin/docs -skip changelog,pull-request v1.33.0
|
||||||
|
```
|
||||||
|
|
||||||
|
The binary looks for `.tmpl` template files in `./templates` `telegraf-internal/telegraf_release/docs/templates/`, however we expect to permanently move them to `docs-v2/telegraf-build/templates` soon.
|
||||||
|
|
||||||
The `docs` binary:
|
The `docs` binary:
|
||||||
a. Clones the `docs-v2` repo and the `telegraf` repo and checks out the specified Telegraf release tag.
|
a. Clones the `docs-v2` repo and the `telegraf` repo and checks out the specified Telegraf release tag.
|
||||||
b. Commits the changes to the local `docs-v2` repo and creates a PR for the changes.
|
b. Commits the changes to the local `docs-v2` repo and creates a PR for the changes.
|
||||||
|
|
||||||
5. To test the templates and preview the changes on your local machine, review the generated files in the newly cloned `docs-v2/content/telegraf` or copy them into your existing local `docs-v2` repo (but, _don't_ commit them to version control).
|
5. To test the templates and preview the changes on your local machine, change to `telegraf-build/repos/docs-v2`, install dependencies, and start Hugo:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd ~/Documents/github/docs-v2/telegraf-build/repos/docs-v2
|
||||||
|
# Install dependencies
|
||||||
|
yarn install
|
||||||
|
# Start Hugo server
|
||||||
|
npx hugo serve
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively, copy the generated files your existing local `docs-v2` repo (but, _don't_ commit them to version control).
|
||||||
|
|
|
@ -5,9 +5,14 @@ menu:
|
||||||
parent: aggregator_plugins_reference
|
parent: aggregator_plugins_reference
|
||||||
name: {{.Name}}
|
name: {{.Name}}
|
||||||
identifier: aggregator-{{.ID}}
|
identifier: aggregator-{{.ID}}
|
||||||
tags: [{{.Name}}, "aggregator-plugins", "configuration"]
|
tags: [{{.Name}}, "aggregator-plugins", "configuration"{{range .Tags}}, "{{.}}"{{end}}]
|
||||||
|
{{if .Introduced}}introduced: "{{.Introduced}}"{{end}}
|
||||||
|
{{if .Deprecated}}deprecated: "{{.Deprecated}}"{{end}}
|
||||||
|
{{if .Removal}}removal: "{{.Removal}}"{{end}}
|
||||||
|
{{if .OS}}os_support: "{{.OS}}"{{end}}
|
||||||
related:
|
related:
|
||||||
- /telegraf/v1/configure_plugins/
|
- /telegraf/v1/configure_plugins/
|
||||||
|
- {{.URL}}, {{.Name}} Plugin Source
|
||||||
---
|
---
|
||||||
|
|
||||||
{{.Readme}}
|
{{.Readme}}
|
||||||
|
|
|
@ -5,9 +5,14 @@ menu:
|
||||||
parent: input_plugins_reference
|
parent: input_plugins_reference
|
||||||
name: {{.Name}}
|
name: {{.Name}}
|
||||||
identifier: input-{{.ID}}
|
identifier: input-{{.ID}}
|
||||||
tags: [{{.Name}}, "input-plugins", "configuration"]
|
tags: [{{.Name}}, "input-plugins", "configuration"{{range .Tags}}, "{{.}}"{{end}}]
|
||||||
|
{{if .Introduced}}introduced: "{{.Introduced}}"{{end}}
|
||||||
|
{{if .Deprecated}}deprecated: "{{.Deprecated}}"{{end}}
|
||||||
|
{{if .Removal}}removal: "{{.Removal}}"{{end}}
|
||||||
|
{{if .OS}}os_support: "{{.OS}}"{{end}}
|
||||||
related:
|
related:
|
||||||
- /telegraf/v1/configure_plugins/
|
- /telegraf/v1/configure_plugins/
|
||||||
|
- {{.URL}}, {{.Name}} Plugin Source
|
||||||
---
|
---
|
||||||
|
|
||||||
{{.Readme}}
|
{{.Readme}}
|
||||||
|
|
|
@ -5,9 +5,14 @@ menu:
|
||||||
parent: output_plugins_reference
|
parent: output_plugins_reference
|
||||||
name: {{.Name}}
|
name: {{.Name}}
|
||||||
identifier: output-{{.ID}}
|
identifier: output-{{.ID}}
|
||||||
tags: [{{.Name}}, "output-plugins", "configuration"]
|
tags: [{{.Name}}, "output-plugins", "configuration"{{range .Tags}}, "{{.}}"{{end}}]
|
||||||
|
{{if .Introduced}}introduced: "{{.Introduced}}"{{end}}
|
||||||
|
{{if .Deprecated}}deprecated: "{{.Deprecated}}"{{end}}
|
||||||
|
{{if .Removal}}removal: "{{.Removal}}"{{end}}
|
||||||
|
{{if .OS}}os_support: "{{.OS}}"{{end}}
|
||||||
related:
|
related:
|
||||||
- /telegraf/v1/configure_plugins/
|
- /telegraf/v1/configure_plugins/
|
||||||
|
- {{.URL}}, {{.Name}} Plugin Source
|
||||||
---
|
---
|
||||||
|
|
||||||
{{.Readme}}
|
{{.Readme}}
|
||||||
|
|
|
@ -8,5 +8,8 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- with .Removal }}
|
{{- with .Removal }}
|
||||||
removal: {{ . }}
|
removal: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{ with .OS }}
|
||||||
|
os_support: {{ . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
tags: [{{ .Tags | join ", " }}]
|
tags: [{{ .Tags | join ", " }}]
|
||||||
|
|
|
@ -5,9 +5,14 @@ menu:
|
||||||
parent: processor_plugins_reference
|
parent: processor_plugins_reference
|
||||||
name: {{.Name}}
|
name: {{.Name}}
|
||||||
identifier: processor-{{.ID}}
|
identifier: processor-{{.ID}}
|
||||||
tags: [{{.Name}}, "processor-plugins", "configuration"]
|
tags: [{{.Name}}, "processor-plugins", "configuration"{{range .Tags}}, "{{.}}"{{end}}]
|
||||||
|
{{if .Introduced}}introduced: "{{.Introduced}}"{{end}}
|
||||||
|
{{if .Deprecated}}deprecated: "{{.Deprecated}}"{{end}}
|
||||||
|
{{if .Removal}}removal: "{{.Removal}}"{{end}}
|
||||||
|
{{if .OS}}os_support: "{{.OS}}"{{end}}
|
||||||
related:
|
related:
|
||||||
- /telegraf/v1/configure_plugins/
|
- /telegraf/v1/configure_plugins/
|
||||||
|
- {{.URL}}, {{.Name}} Plugin Source
|
||||||
---
|
---
|
||||||
|
|
||||||
{{.Readme}}
|
{{.Readme}}
|
||||||
|
|
Loading…
Reference in New Issue