From fd42485d7db032eba9527177ebc2dc291d2ceb3e Mon Sep 17 00:00:00 2001 From: Jeffrey Cafferata Date: Fri, 28 Oct 2022 17:27:06 +0200 Subject: [PATCH] DOCS: Automatically make a table of contents (TOC) (#1778) --- docs/_functions/domain/AKAMAICDN.md | 1 + docs/_functions/domain/AZURE_ALIAS.md | 1 + docs/_functions/domain/CF_REDIRECT.md | 1 + docs/_functions/domain/CF_TEMP_REDIRECT.md | 1 + docs/_functions/domain/CF_WORKER_ROUTE.md | 1 + docs/_functions/domain/R53_ALIAS.md | 1 + docs/_functions/record/DMARC_BUILDER.md | 3 +- docs/_functions/record/R53_ZONE.md | 1 + docs/_includes/table-of-contents.md | 28 +++++++++++++++++ docs/css/site.css | 11 ++++++- docs/js.md | 36 ++++++++++++++++++++++ 11 files changed, 82 insertions(+), 3 deletions(-) create mode 100644 docs/_includes/table-of-contents.md diff --git a/docs/_functions/domain/AKAMAICDN.md b/docs/_functions/domain/AKAMAICDN.md index f493f3995..33072d836 100644 --- a/docs/_functions/domain/AKAMAICDN.md +++ b/docs/_functions/domain/AKAMAICDN.md @@ -4,6 +4,7 @@ parameters: - name - target - modifiers... +provider: AKAMAIEDGEDNS --- AKAMAICDN is a proprietary record type that is used to configure [Zone Apex Mapping](https://blogs.akamai.com/2019/08/fast-dns-zone-apex-mapping-dnssec.html). diff --git a/docs/_functions/domain/AZURE_ALIAS.md b/docs/_functions/domain/AZURE_ALIAS.md index 94cfbed5e..3a7735fe6 100644 --- a/docs/_functions/domain/AZURE_ALIAS.md +++ b/docs/_functions/domain/AZURE_ALIAS.md @@ -5,6 +5,7 @@ parameters: - type - target - modifiers ... +provider: AZURE_DNS --- AZURE_ALIAS is a Azure specific virtual record type that points a record at either another record or an Azure entity. diff --git a/docs/_functions/domain/CF_REDIRECT.md b/docs/_functions/domain/CF_REDIRECT.md index 6fbd449ff..785bc6ce5 100644 --- a/docs/_functions/domain/CF_REDIRECT.md +++ b/docs/_functions/domain/CF_REDIRECT.md @@ -3,6 +3,7 @@ name: CF_REDIRECT parameters: - destination - modifiers... +provider: CLOUDFLAREAPI --- `CF_REDIRECT` uses Cloudflare-specific features ("Forwarding URL" Page Rules) to diff --git a/docs/_functions/domain/CF_TEMP_REDIRECT.md b/docs/_functions/domain/CF_TEMP_REDIRECT.md index 92d4f0c5d..93a661e17 100644 --- a/docs/_functions/domain/CF_TEMP_REDIRECT.md +++ b/docs/_functions/domain/CF_TEMP_REDIRECT.md @@ -3,6 +3,7 @@ name: CF_TEMP_REDIRECT parameters: - destination - modifiers... +provider: CLOUDFLAREAPI --- `CF_TEMP_REDIRECT` uses Cloudflare-specific features ("Forwarding URL" Page diff --git a/docs/_functions/domain/CF_WORKER_ROUTE.md b/docs/_functions/domain/CF_WORKER_ROUTE.md index 299bd2c30..5db408864 100644 --- a/docs/_functions/domain/CF_WORKER_ROUTE.md +++ b/docs/_functions/domain/CF_WORKER_ROUTE.md @@ -3,6 +3,7 @@ name: CF_WORKER_ROUTE parameters: - pattern - script +provider: CLOUDFLAREAPI --- `CF_WORKER_ROUTE` uses the [Cloudflare Workers](https://developers.cloudflare.com/workers/) diff --git a/docs/_functions/domain/R53_ALIAS.md b/docs/_functions/domain/R53_ALIAS.md index a776b9fef..aa1de52ac 100644 --- a/docs/_functions/domain/R53_ALIAS.md +++ b/docs/_functions/domain/R53_ALIAS.md @@ -4,6 +4,7 @@ parameters: - name - target - ZONE_ID modifier +provider: ROUTE53 --- R53_ALIAS is a Route53 specific virtual record type that points a record at either another record or an AWS entity (like a Cloudfront distribution, an ELB, etc...). It is analogous to a CNAME, but is usually resolved at request-time and served as an A record. Unlike CNAMEs, ALIAS records can be used at the zone apex (`@`) diff --git a/docs/_functions/record/DMARC_BUILDER.md b/docs/_functions/record/DMARC_BUILDER.md index 49ff122ca..70b7a1af3 100644 --- a/docs/_functions/record/DMARC_BUILDER.md +++ b/docs/_functions/record/DMARC_BUILDER.md @@ -1,6 +1,5 @@ --- -layout: default -title: DMARC Builder +name: DMARC_BUILDER --- # DMARC Builder diff --git a/docs/_functions/record/R53_ZONE.md b/docs/_functions/record/R53_ZONE.md index 2888515e7..b1d487439 100644 --- a/docs/_functions/record/R53_ZONE.md +++ b/docs/_functions/record/R53_ZONE.md @@ -2,6 +2,7 @@ name: R53_ZONE parameters: - zone_id +provider: ROUTE53 --- R53_ZONE lets you specify the AWS Zone ID for an entire domain (D()) or a specific R53_ALIAS() record. diff --git a/docs/_includes/table-of-contents.md b/docs/_includes/table-of-contents.md new file mode 100644 index 000000000..8f3e54228 --- /dev/null +++ b/docs/_includes/table-of-contents.md @@ -0,0 +1,28 @@ + + {{include.title}} + +{% if include.provider-jsId != nill %} + for + + + {{include.provider-name}} + + +{% endif %} + + diff --git a/docs/css/site.css b/docs/css/site.css index ea1edf5d7..690ae2d95 100644 --- a/docs/css/site.css +++ b/docs/css/site.css @@ -80,4 +80,13 @@ body { .dim { color: #eeeeee -} \ No newline at end of file +} + +.table-of-contents { + width: 100%; +} + +.table-of-contents td { + vertical-align: top; + width: 50%; +} diff --git a/docs/js.md b/docs/js.md index 986edb87f..04a089daf 100644 --- a/docs/js.md +++ b/docs/js.md @@ -8,6 +8,42 @@ title: JavaScript DSL DNSControl uses javascript as its primary input language to provide power and flexibility to configure your domains. The ultimate purpose of the javascript is to construct a [DNSConfig](https://godoc.org/github.com/StackExchange/dnscontrol/models#DNSConfig) object that will be passed to the go backend and operated on. + + + + + +
+ {% include table-of-contents.md + docs-functions-dir="domain" + html-anchor="domain-modifiers" + title="Domain Modifiers" + %} + {% assign showProviders = 'AKAMAIEDGEDNS, AZURE_DNS, CLOUDFLAREAPI, ROUTE53' %} + {% for provider in site.providers %} + {% if showProviders contains provider.jsId %} + {% include table-of-contents.md + docs-functions-dir="domain" + html-anchor="domain-modifiers" + title="Domain Modifiers" + provider-name=provider.name + provider-jsId=provider.jsId + %} + {% endif %} + {% endfor %} + + {% include table-of-contents.md + docs-functions-dir="global" + html-anchor="top-level-functions" + title="Top Level Functions" + %} + {% include table-of-contents.md + docs-functions-dir="record" + html-anchor="record-modifiers" + title="Record Modifiers" + %} +
+ {% include funcList.md title="Top Level Functions" dir="global" %} {% include funcList.md title="Domain Modifiers" dir="domain" %}