From 4022827c6e3daa5727057212978f83f8c930b5af Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Sat, 18 Oct 2025 16:46:55 +0200 Subject: [PATCH] chore: remove existing files before generating new files (#2676) --- .gitattributes | 1 + docs/content/dns/zz_gen_hetznerv1.md | 67 ---------------------------- internal/dns/docs/generator.go | 21 +++++++++ 3 files changed, 22 insertions(+), 67 deletions(-) delete mode 100644 docs/content/dns/zz_gen_hetznerv1.md diff --git a/.gitattributes b/.gitattributes index a91e62484..ae17ee40c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ **/zz_gen_*.* linguist-generated +docs/data/zz_cli_help.toml linguist-generated diff --git a/docs/content/dns/zz_gen_hetznerv1.md b/docs/content/dns/zz_gen_hetznerv1.md deleted file mode 100644 index 737004fe4..000000000 --- a/docs/content/dns/zz_gen_hetznerv1.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -title: "Hetzner" -date: 2019-03-03T16:39:46+01:00 -draft: false -slug: hetznerv1 -dnsprovider: - since: "v4.27.0" - code: "hetznerv1" - url: "https://hetzner.com" ---- - - - - - - -Configuration for [Hetzner](https://hetzner.com). - - - - -- Code: `hetznerv1` -- Since: v4.27.0 - - -Here is an example bash command using the Hetzner provider: - -```bash -HETZNER_API_TOKEN="xxxxxxxxxxxxxxxxxxxxx" \ -lego --email you@example.com --dns hetznerv1 -d '*.example.com' -d example.com run -``` - - - - -## Credentials - -| Environment Variable Name | Description | -|-----------------------|-------------| -| `HETZNER_API_TOKEN` | API token | - -The environment variable names can be suffixed by `_FILE` to reference a file instead of a value. -More information [here]({{% ref "dns#configuration-and-credentials" %}}). - - -## Additional Configuration - -| Environment Variable Name | Description | -|--------------------------------|-------------| -| `HETZNER_HTTP_TIMEOUT` | API request timeout in seconds (Default: 30) | -| `HETZNER_POLLING_INTERVAL` | Time between DNS propagation check in seconds (Default: 2) | -| `HETZNER_PROPAGATION_TIMEOUT` | Maximum waiting time for DNS propagation in seconds (Default: 60) | -| `HETZNER_TTL` | The TTL of the TXT record used for the DNS challenge in seconds (Default: 120) | - -The environment variable names can be suffixed by `_FILE` to reference a file instead of a value. -More information [here]({{% ref "dns#configuration-and-credentials" %}}). - - - - -## More information - -- [API documentation](https://docs.hetzner.cloud/reference/cloud#dns) - - - - diff --git a/internal/dns/docs/generator.go b/internal/dns/docs/generator.go index d618ce568..676f65f5b 100644 --- a/internal/dns/docs/generator.go +++ b/internal/dns/docs/generator.go @@ -48,6 +48,11 @@ func main() { log.Fatal(err) } + err = cleanDocumentation() + if err != nil { + log.Fatal(err) + } + for _, m := range models.Providers { // generate documentation err = generateDocumentation(m) @@ -71,6 +76,22 @@ func main() { fmt.Printf("Documentation for %d DNS providers has been generated.\n", len(models.Providers)+1) } +func cleanDocumentation() error { + paths, err := filepath.Glob(filepath.Join(docOutput, "zz_gen_*.md")) + if err != nil { + return err + } + + for _, p := range paths { + err = os.RemoveAll(p) + if err != nil { + return err + } + } + + return nil +} + func generateDocumentation(m descriptors.Provider) error { filename := filepath.Join(docOutput, "zz_gen_"+m.Code+".md")