You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--providers-schema <ARG> path to the providers schema JSON file, which contains the output of the terraform providers schema -json command. Setting this flag will skip building the provider and calling Terraform CLI
71
71
--rendered-provider-name <ARG> provider name, as generated in documentation (ex. page titles, ...)
72
72
--rendered-website-dir <ARG> output directory based on provider-dir (default: "docs")
73
-
--tf-version <ARG> terraform binary version to download
73
+
--tf-version <ARG> terraform binary version to download. If not provided, will look for a terraform binary in the local environment. If not found in the environment, will download the latest version of Terraform
74
74
--website-source-dir <ARG> templates directory based on provider-dir (default: "templates")
75
75
--website-temp-dir <ARG> temporary directory (used during generation)
76
76
```
@@ -115,6 +115,14 @@ You can browse their respective docs on the Terraform Registry,
and [here](https://registry.terraform.io/providers/hashicorp/tls/latest/docs).
117
117
118
+
### Usage of Terraform binary
119
+
120
+
If the `--providers-schema` flag is not provided, `tfplugindocs` will use the [Terraform binary](https://github.com/hashicorp/terraform) to generate the provider schema with the commands:
We recommend using the latest version of Terraform when using `tfplugindocs`, however, the version can be specified with the `--tf-version` flag if needed.
125
+
118
126
#### About the `id` attribute
119
127
120
128
If the provider schema didn't set`id`for the given resource/data-source, the documentation generated
@@ -263,7 +271,7 @@ using the following data fields and functions:
263
271
|`tffile`| A special case of the `codefile` function, designed for Terraform files (i.e. `.tf`). |
264
272
|`trimspace`| Equivalent to [`strings.TrimSpace`](https://pkg.go.dev/strings#TrimSpace). |
265
273
|`upper`| Equivalent to [`strings.ToUpper`](https://pkg.go.dev/strings#ToUpper). |
266
-
274
+
267
275
## Disclaimer
268
276
269
277
This is still under development: while it's being used for production-ready providers, you might still find bugs
fs.StringVar(&cmd.flagExamplesDir, "examples-dir", "examples", "examples directory based on provider-dir")
81
81
fs.StringVar(&cmd.flagWebsiteTmpDir, "website-temp-dir", "", "temporary directory (used during generation)")
82
82
fs.StringVar(&cmd.flagWebsiteSourceDir, "website-source-dir", "templates", "templates directory based on provider-dir")
83
-
fs.StringVar(&cmd.tfVersion, "tf-version", "", "terraform binary version to download")
83
+
fs.StringVar(&cmd.tfVersion, "tf-version", "", "terraform binary version to download. If not provided, will look for a terraform binary in the local environment. If not found in the environment, will download the latest version of Terraform")
84
84
fs.BoolVar(&cmd.flagIgnoreDeprecated, "ignore-deprecated", false, "don't generate documentation for deprecated resources and data-sources")
0 commit comments