-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Autogenerate Telegraf docs from influxdata/telegraf repo. #5656
base: master
Are you sure you want to change the base?
Conversation
This is a rough first pass at autogenerating Telegraf docs from READMEs in the influxdata/telegraf repo. I expect we'll need to tweak separation of concerns between the two repos and maybe there's a better Hugo-ish approach for templating and leveraging data.
build-telegraf/plugins.sh
Outdated
|
||
EOF | ||
else | ||
echo "Plugin directory not found: $plugin_dir" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We currently have 20 external plugins that are listed on the plugins page but are not part of the Telegraf repo. How do we want to handle these? @srebhan, do you have any thoughts?
@@ -23,5 +23,6 @@ <h3 id="{{ $type }}-{{ .id }}">{{ .name }}</h3> | |||
<a class="btn github-link" href="{{ if .link }}{{ .link }}{{ else }}https://github.com/influxdata/telegraf/blob/release-{{ $latestTelegrafVersion }}/plugins/{{ $type }}s/{{ .id }}/README.md{{ end }}" target="_blank"> | |||
<span class="icon-github"></span> <span class="hide">View</span> | |||
</a> | |||
<div>{{ .Site.GetPage "/telegraf/v1/input-plugins/apache/_index.md" }}</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume you'll iterate over the page data to do something here?
build-telegraf/plugins.sh
Outdated
telegraf_v1_ref: | ||
parent: $parent | ||
name: $(basename "$plugin_dir") | ||
tags: [$(basename "$plugin_dir")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing that would be nice to account for here is introduced
and deprecated
versions. Were you thinking we'd do that by injecting frontmatter or adding that frontmatter to the readmes?
This is a simplistic POC for autogenerating Telegraf docs from READMEs in the influxdata/telegraf repo. I expect we'll need to tweak separation of concerns between the two repos and maybe there's a better Hugo-ish approach for templating and leveraging data.
It doesn't take into account any existing content, like the plugin browse page or previous changes that we might want to port over.