DOCS: Documentation inline replacements (#2083)

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
Jeffrey Cafferata 2023-02-19 06:07:30 +01:00 committed by GitHub
parent b635dc5f4a
commit 7b1b964b76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 4 deletions

View file

@ -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",
"<!-- provider-matrix-start -->",
"<!-- provider-matrix-end -->",
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)
}
}

View file

@ -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-matrix-start -->
| 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` | ❌ | ✅ | ❌ | ❌ | ❔ | ✅ | ❌ | ❔ | ❔ | ✅ | ✅ | ❌ | ❔ | ❔ | ✅ | ✅ | ✅ |
<!-- provider-matrix-end -->
### Providers with "official support"