# Templates The top-level `templates` option describes a few key fields, such as [`url`](#url) which are evaluated by [`nunjucks`][nunjucks]. [`checks`](#checks) are _also_ evaluated as `nunjucks` templates. Additional `templates` can be defined and [imported][import] for reuse as blocks or macros in other `templates` or `checks`. [nunjucks]: https://mozilla.github.io/nunjucks/templating.html [import]: https://mozilla.github.io/nunjucks/templating.html#import ## Context Each `template` gets an object of this form: ```json { "config": { "forms": { "a-form-key": {} } }, "data": { "a-form-key": { "some-data-data": "from_form" } } } ``` ## Markdown Most non-`url` templates are rendered as [Markdown][md]. Much of [GitHub flavored Markdown][gfm] is supported, but not platform-specific features like magic `#{issue}` transforms and `mermaid` fenced code blocks. Indeed, no syntax highlighting is supported, so generally any fence info will be discarded. [gfm]: https://github.github.com/gfm [md]: https://daringfireball.net/projects/markdown ### Copy Code All `pre` tags (generated with triple ticks, tildes, etc) will be rendered with a `copy` button. This helps for URL-based workflows that don't allow for populating key parameters such as GitLab's `/new/` URL, or otherwise complex ones (GitHub's `/edit/`). In this case, it is recommended to provide a [`below_{form}`](#below-form) template which shows the file content, with narrative describing how to copy the code and what to do with it. ### Special Templates A few well-known template names and patterns are used globally. #### `url` The `templates.url` field should generate a valid URL. All whitespace should be escaped (e.g. use `" " | urlencode` to get `%20`), as any remaining will be removed. #### `submit_button` Markdown to show on the submit button, if all `checks` and schema validation are successful. If this evaluates to the empty string, no submit button will be shown. #### `submit_target` The [`target`][target] for the `submit_button`. If an empty string, the default behavior of replacing the current page will be used. - use `_blank` to open a new browser tab - use the name of an `