From 83252ef6417e1d85da6187d689e650c53783255a Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 31 Jan 2023 16:42:17 -0500 Subject: [PATCH] Remove all template tag lines from the .d.ts file (#2030) --- build/generate/functionTypes.go | 15 +++++++++------ commands/types/dnscontrol.d.ts | 4 ---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/build/generate/functionTypes.go b/build/generate/functionTypes.go index 15403445b..29e8f40b3 100644 --- a/build/generate/functionTypes.go +++ b/build/generate/functionTypes.go @@ -88,12 +88,15 @@ func generateFunctionTypes() (string, error) { continue } - body = body + "\n" - body = strings.ReplaceAll(body, "{% hint style=\"danger\" %}", "") - body = strings.ReplaceAll(body, "{% hint style=\"info\" %}", "") - body = strings.ReplaceAll(body, "{% hint style=\"success\" %}", "") - body = strings.ReplaceAll(body, "{% hint style=\"warning\" %}", "") - body = strings.ReplaceAll(body, "{% endhint %}", "") + lines := strings.Split(body, "\n") + body = "" + for _, line := range lines { + if strings.HasPrefix(line, "{%") && strings.HasSuffix(line, "%}") { + continue + } + body += line + "\n" + } + body = strings.ReplaceAll(body, "**NOTE**", "NOTE") body = strings.ReplaceAll(body, "**WARNING**", "WARNING") body = fixRuns(body) diff --git a/commands/types/dnscontrol.d.ts b/commands/types/dnscontrol.d.ts index 93b7a5624..12fc03a96 100644 --- a/commands/types/dnscontrol.d.ts +++ b/commands/types/dnscontrol.d.ts @@ -1758,17 +1758,13 @@ declare function getConfiguredDomains(): string[]; * One more important thing to note: `require_glob()` is as smart as `require()` is. It loads files always relative to the JavaScript * file where it's being executed in. Let's go with an example, as it describes it better: * - * {% code title="dnsconfig.js" %} * ```javascript * require("domains/index.js"); * ``` - * {% endcode %} * - * {% code title="domains/index.js" %} * ```javascript * require_glob("./user1/"); * ``` - * {% endcode %} * * This will now load files being present underneath `./domains/user1/` and **NOT** at below `./domains/`, as `require_glob()` * is called in the subfolder `domains/`.