Steps to convert Data Source or Resource documentation from the hand-built README.md to using tfplugindocs
- The details for a given
resource
ordata source
may have been previously documented in README.md. - Add documentation into the
Schema()
function asMarkdownDescription
elements within theapstra/data_source_<name>.go
orapstra/resource_<name>.go
files at various levels:- at the level of each Attribute (or nested Attribute) element
- on each individual attribute
- Migrate the example block(s) of terraform config which may have been documented in README.md into
examples/<type>/<name>/example.tf
- Delete that
data-source
orresource
documentation from README.md. - Execute
go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
from the repo root to rebuild the docs. - Alternate: install tfplugindocs:
go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@latest