-
Notifications
You must be signed in to change notification settings - Fork 948
[FEAT]: migrate documentation to tfplugindocs auto-generation #3241
Copy link
Copy link
Closed
Description
Summary
Migrate 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.markdown files. This has several limitations:
- Schema drift: Schema changes in Go code don't automatically reflect in docs, leading to outdated documentation
- No validation: There's no way to validate that docs match the actual provider schema
- Inconsistent formatting: Manual authoring leads to inconsistent formatting across resource docs
- No example extraction: HCL examples are embedded in markdown rather than being testable
.tffiles - Not standard: Most Terraform providers use
tfplugindocs— the upstream standard tooling
Proposed Changes
- Add
tools.gowithterraform-plugin-docsdependency - Add
docs-generate,docs-validate,docs-migrateMakefile targets - Migrate
website/docs/totemplates/+docs/format usingtfplugindocs migrate - Extract HCL examples into
examples/resources/andexamples/data-sources/ - Enable gradual adoption of
{{ .SchemaMarkdown }}for auto-generated schema docs
Benefits
- Standard tooling: Aligns with the Terraform provider ecosystem best practice
- Validation:
make docs-validatecatches documentation issues early - Gradual migration: Templates can progressively use
{{ .SchemaMarkdown }}as schema descriptions improve - Testable examples: Extracted
.tffiles can be validated independently - CI integration: Easy to add
docs-validateas a CI check
Workflow After Migration
- Edit templates in
templates/or update schema descriptions in Go source code - Run
make docs-generateto regeneratedocs/ - Run
make docs-validateto verify - Commit both
templates/changes anddocs/output
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels