From 7b1b964b760abf93c62ec158633e2141928eef6d Mon Sep 17 00:00:00 2001 From: Jeffrey Cafferata Date: Sun, 19 Feb 2023 06:07:30 +0100 Subject: [PATCH] DOCS: Documentation inline replacements (#2083) Co-authored-by: Tom Limoncelli --- build/generate/featureMatrix.go | 38 ++++++++++++++++++++++++++++++--- documentation/providers.md | 4 +++- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/build/generate/featureMatrix.go b/build/generate/featureMatrix.go index ded768c69..28b68040a 100644 --- a/build/generate/featureMatrix.go +++ b/build/generate/featureMatrix.go @@ -1,11 +1,12 @@ package main import ( - "sort" - "github.com/StackExchange/dnscontrol/v3/providers" _ "github.com/StackExchange/dnscontrol/v3/providers/_all" "github.com/fbiville/markdown-table-formatter/pkg/markdown" + "os" + "sort" + "strings" ) func generateFeatureMatrix() error { @@ -16,7 +17,12 @@ func generateFeatureMatrix() error { return err } - _ = markdownTable + replaceInlineContent( + "documentation/providers.md", + "", + "", + markdownTable, + ) return nil } @@ -277,3 +283,29 @@ type FeatureMatrix struct { Features []string Providers map[string]FeatureMap } + +func replaceInlineContent( + file string, + startMarker string, + endMarker string, + newContent string, +) { + contentBytes, err := os.ReadFile(file) + if err != nil { + panic(err) + } + content := string(contentBytes) + + start := strings.Index(content, startMarker) + end := strings.Index(content, endMarker) + + newContentString := startMarker + "\n" + newContent + endMarker + newContentBytes := []byte(newContentString) + contentBytes = []byte(content) + contentBytes = append(contentBytes[:start], append(newContentBytes, contentBytes[end+len(endMarker):]...)...) + + err = os.WriteFile(file, contentBytes, 0644) + if err != nil { + panic(err) + } +} diff --git a/documentation/providers.md b/documentation/providers.md index 47f03c746..c9366da69 100644 --- a/documentation/providers.md +++ b/documentation/providers.md @@ -11,6 +11,7 @@ a provider that supports it, we'd love your contribution to ensure it works corr If a feature is definitively not supported for whatever reason, we would also like a PR to clarify why it is not supported, and fill in this entire matrix. + | Provider name | Official Support | DNS Provider | Registrar | ALIAS | AUTODNSSEC | CAA | PTR | NAPTR | SOA | SRV | SSHFP | TLSA | DS | dual host | create-domains | NO_PURGE | get-zones | | ------------- | ---------------- | ------------ | --------- | ----- | ---------- | --- | --- | ----- | --- | --- | ----- | ---- | -- | --------- | -------------- | -------- | --------- | | `AKAMAIEDGEDNS` | ❌ | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ | ✅ | @@ -35,7 +36,7 @@ If a feature is definitively not supported for whatever reason, we would also li | `HEDNS` | ❌ | ✅ | ❌ | ✅ | ❌ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | | `HETZNER` | ❌ | ✅ | ❌ | ❌ | ❔ | ✅ | ❌ | ❔ | ❔ | ✅ | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | | `HEXONET` | ❌ | ✅ | ✅ | ❌ | ❔ | ✅ | ✅ | ❔ | ❔ | ✅ | ❔ | ✅ | ❔ | ✅ | ✅ | ✅ | ❔ | -| `HOSTINGDE` | ❌ | ✅ | ✅ | ✅ | ❔ | ✅ | ✅ | ❌ | ❔ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| `HOSTINGDE` | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | `INTERNETBS` | ❌ | ❌ | ✅ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❌ | ✅ | ❔ | | `INWX` | ❌ | ✅ | ✅ | ❌ | ❔ | ✅ | ✅ | ✅ | ❔ | ✅ | ✅ | ✅ | ❔ | ✅ | ✅ | ✅ | ✅ | | `LINODE` | ❌ | ✅ | ❌ | ❔ | ❔ | ✅ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❌ | ❌ | ✅ | ✅ | @@ -56,6 +57,7 @@ If a feature is definitively not supported for whatever reason, we would also li | `SOFTLAYER` | ❌ | ✅ | ❌ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ✅ | ❔ | ❔ | ❔ | ❔ | ❌ | ✅ | ❔ | | `TRANSIP` | ❌ | ✅ | ❌ | ✅ | ❌ | ✅ | ❔ | ✅ | ❔ | ✅ | ✅ | ✅ | ❌ | ❔ | ❌ | ✅ | ✅ | | `VULTR` | ❌ | ✅ | ❌ | ❌ | ❔ | ✅ | ❌ | ❔ | ❔ | ✅ | ✅ | ❌ | ❔ | ❔ | ✅ | ✅ | ✅ | + ### Providers with "official support"