Skip to content

Commit

Permalink
Amend adding new rtypes procedure.
Browse files Browse the repository at this point in the history
  • Loading branch information
systemcrash committed Mar 26, 2023
1 parent cea02eb commit 26d042e
Showing 1 changed file with 4 additions and 29 deletions.
33 changes: 4 additions & 29 deletions documentation/adding-new-rtypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,39 +291,14 @@ tests, please ask!

## Step 8: Write documentation

Add a new Markdown file to `documentation/functions/domain`. Copy an existing file (`CNAME.md` is a good example). The section between the lines of `---` is called the front matter and it has the following keys:
Add a new Markdown file to `documentation/language_reference/domain_modifier_functions` (if the new record type is service provider specific, add it to the appropriate subfolder, creating the folder if it does not exist). Copy an existing file (`CNAME.md` is a good example). The section between the lines of `---` is called the front matter and it has the following keys:

- `name`: The name of the record. This should match the file name and the name of the record in `helpers.js`.
- `parameters`: A list of parameter names, in order. Feel free to use spaces in the name if necessary. Your last parameter should be `modifiers...` to allow arbitrary modifiers like `TTL` to be applied to your record.
- `parameter_types`: an object with parameter names as keys and TypeScript type names as values. Check out existing record documentation if you’re not sure to put for a parameter. Note that this isn’t displayed on the website, it’s only used to generate the `.d.ts` file.

The rest of the file is the documentation. You can use Markdown syntax to format the text.

Add the new file `FOO.md` to the documentation table of contents [`documentation/SUMMARY.md`](SUMMARY.md#domain-modifiers), and/or to the [`Service Provider specific`](SUMMARY.md#service-provider-specific) section if you made a record specific to a provider, and to the [`Record Modifiers`](SUMMARY.md#record-modifiers) section if you created any `*_BUILDER` or `*_HELPER` or similar functions for the new record type:

{% code title="documentation/SUMMARY.md" %}
```diff
...
* Domain Modifiers
...
* [DnsProvider](language_reference/domain_modifier_functions/DnsProvider.md)
+ * [FOO](language_reference/domain_modifier_functions/FOO.md)
* [FRAME](language_reference/domain_modifier_functions/FRAME.md)
...
* Service Provider specific
...
* ClouDNS
* [CLOUDNS_WR](language_reference/domain_modifier_functions/service_provider_specific/ClouDNS/CLOUDNS_WR.md)
+ * ASDF
+ * [NINJA_RECORD](language_reference/domain_modifier_functions/service_provider_specific/XYZ/FOO_NINJA.md)
* NS1
* [NS1_URLFWD](language_reference/domain_modifier_functions/service_provider_specific/NS1/NS1_URLFWD.md)
...
* Record Modifiers
...
* [DMARC_BUILDER](language_reference/record_modifier_functions/DMARC_BUILDER.md)
+ * [FOO_HELPER](language_reference/record_modifier_functions/FOO_HELPER.md)
* [SPF_BUILDER](language_reference/record_modifier_functions/SPF_BUILDER.md)
...
```
{% endcode %}
If you create any helper functions such as `FOO_BUILDER`, place the markdown files documenting them in their appropriate folder e.g. `documentation/language_reference/record_modifier_functions`.

At the next run of `go generate ./...` - the documentation tables and links within the new markdown files should be automatically generated and refreshed.

0 comments on commit 26d042e

Please sign in to comment.