DOCS: Add to styleguide info about top-of-doc params (#2404)

This commit is contained in:
Tom Limoncelli 2023-05-30 19:46:37 -04:00 committed by GitHub
parent e9b4b9b34d
commit e6f3fb42f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,6 +31,33 @@ Within the git repo, docs are grouped:
1. Add the page to the `documentation` folder (possibly a sub folder)
2. List the page in `SUMMARY.md` so that it will appear in the table of contents, sidebar, etc.
## Top-of-Document parameters
Files in the `documentation/functions/{record,domain,global}` subdirectories
have a header at the top that is used to populate other systems.
Here's an example from [`A`](functions/domain/A.md)
```
---
name: A
provider: NAMEDOTCOM
parameters:
- name
- address
- modifiers...
parameter_types:
name: string
address: string | number
"modifiers...": RecordModifier[]
---
```
* `name`: The name of the function/constant in the document. This should match the filename (aside from the `.md` suffix).
* `parameters`: These are the names of the parameters that the function accepts. `modifiers...` indicates that a variable number of modifiers can be added.
* `parameter_types`: The typescript type for each parameter. This is used when generating `types-dnscontrol.d.ts`
* `provider`: If a feature is only available for one provider
## Documentation previews
> "Preview links are only accessible by GitBook users. We're working on a feature that will allow preview links to be viewable by anyone who accesses the PR." — _[GitBook](https://docs.gitbook.com/product-tour/git-sync/github-pull-request-preview#how-to-access-preview-links)_
@ -45,7 +72,7 @@ Include a blank line between paragraphs.
Leave one blank line before and after a heading.
Javascript code should use double quotes (`"`) for strings, not single quotes
JavaScript code should use double quotes (`"`) for strings, not single quotes
(`'`). They are equivalent but consistency is good.
### Headings