feat: migrate to tfplugindocs auto-generated documentation#3239
Open
mkushakov wants to merge 1 commit intointegrations:mainfrom
Open
feat: migrate to tfplugindocs auto-generated documentation#3239mkushakov wants to merge 1 commit intointegrations:mainfrom
mkushakov wants to merge 1 commit intointegrations:mainfrom
Conversation
- Add tools.go with terraform-plugin-docs dependency - Add docs-generate, docs-validate, docs-migrate targets to GNUmakefile - Migrate website/docs/ to templates/ + docs/ format using tfplugindocs migrate - Extract HCL examples into examples/resources/ and examples/data-sources/ - Fix pre-existing YAML frontmatter indentation issues in OIDC template docs - Generated docs/ output passes docs-validate The docs/ directory is now auto-generated from templates/ and should be regenerated by running 'make docs-generate' after schema or template changes.
|
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #3241
Summary
Migrates documentation from the manually-maintained
website/docs/format to auto-generated documentation using terraform-plugin-docs (tfplugindocs).Motivation
Currently, documentation is manually written in
website/docs/as.html.markdownfiles. This approach has several limitations:The
tfplugindocstool is the standard approach used by most Terraform providers and provides:templates/that can reference schema descriptions via{{ .SchemaMarkdown }}examples/that can be testeddocs/output viamake docs-generatemake docs-validateChanges
tools.go(new): Addsterraform-plugin-docsas a tool dependency alongside existingmisspellandgolangci-lintGNUmakefile: Adds three new targets:docs-generate— generatesdocs/fromtemplates/docs-validate— validates generated docsdocs-migrate— one-time migration fromwebsite/docs/totemplates/formattemplates/(new): Contains.md.tmpltemplate files migrated fromwebsite/docs/examples/resources/,examples/data-sources/(new): Extracted HCL code examplesdocs/(new): Auto-generated output — replaceswebsite/docs/website/docs/(removed): Replaced bydocs/go.mod/go.sum: Addedterraform-plugin-docsdependencyPre-existing fixes
The migration also fixed two pre-existing YAML frontmatter indentation issues in the OIDC subject claim customization template docs that caused validation failures.
Workflow
After this change, the documentation workflow becomes:
templates/or update schema descriptions in Go source codemake docs-generateto regeneratedocs/make docs-validateto verifytemplates/changes anddocs/outputTemplates can gradually be enhanced to use
{{ .SchemaMarkdown }}for auto-generated schema documentation as schema descriptions are improved in the provider source code.