1.6 KiB
1.6 KiB
description, tags
| description | tags |
|---|---|
| Templates invoked via slash commands to insert pre-defined content. | glossary |
Slash templates are a quick way to define Slash Command that insert templated content at the cursor position. They are defined as pages tagged with #meta/template/slash.
Creating a slash template
- Create a new page. The last component of the page name (after the
/if any) will be used as the slash command's name. For example, a page namedLibrary/Slash Template/action-itemscreates a/action-itemsslash command. - Tag the page with
#meta/template/slashin its Frontmatter. - Write the template content in the page body. Lua directives (
${...}) are supported and will be evaluated when the template is inserted.
Example
A page named Library/Slash Template/action-items with this content:
---
tags: meta/template/slash
description: Insert a standard action items section
---
# Action items
* [ ] |^|
Creates a /action-items slash command that inserts an action items section.
Configuration
You can configure these optional Frontmatter keys:
description: The description shown in the slash command completion menupriority: Higher priority commands appear earlier in the listonlyContexts(advanced): Only show the command in certain AST node contextsexceptContexts(advanced): Show the command everywhere except in these AST node contexts
Currently active slash templates
${template.each(query[[ from index.tag "meta/template/slash" where _.tag == "page" ]], templates.fullPageItem)}
See also: Slash Command, Template, Page Template