mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-01-10 09:27:46 +08:00
Remove all template tag lines from the .d.ts file (#2030)
This commit is contained in:
parent
8ec4e26703
commit
83252ef641
2 changed files with 9 additions and 10 deletions
|
@ -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)
|
||||
|
|
4
commands/types/dnscontrol.d.ts
vendored
4
commands/types/dnscontrol.d.ts
vendored
|
@ -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/`.
|
||||
|
|
Loading…
Reference in a new issue