Skip to content
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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jstirnaman
Copy link
Contributor

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.

image

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.

EOF
else
echo "Plugin directory not found: $plugin_dir"
Copy link
Collaborator

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>
Copy link
Collaborator

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?

telegraf_v1_ref:
parent: $parent
name: $(basename "$plugin_dir")
tags: [$(basename "$plugin_dir")]
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants