silverbullet/plugs/template/template.plug.yaml

81 lines
1.6 KiB
YAML
Raw Permalink Normal View History

2023-08-28 23:12:15 +08:00
name: template
functions:
# API
renderTemplate:
2024-02-04 22:32:14 +08:00
env: server
path: api.ts:renderTemplate
cleanTemplate:
path: api.ts:cleanTemplate
instantiatePageTemplate:
path: page.ts:instantiatePageTemplate
# Indexing
indexTemplate:
path: index.ts:indexTemplate
events:
# Special event only triggered for template pages
- page:indexTemplate
2023-11-06 16:14:16 +08:00
2023-12-22 01:37:50 +08:00
# Completion
2023-11-06 16:14:16 +08:00
templateSlashCommand:
path: snippet.ts:snippetSlashComplete
2023-11-06 16:14:16 +08:00
events:
- slash:complete
2023-11-06 16:14:16 +08:00
insertSnippetTemplate:
path: snippet.ts:insertSnippetTemplate
2023-12-22 01:37:50 +08:00
handlebarHelperComplete:
path: var.ts:templateVariableComplete
2023-12-22 01:37:50 +08:00
events:
- editor:complete
2023-11-06 16:14:16 +08:00
2024-02-04 23:36:59 +08:00
templateAttributeComplete:
path: var.ts:templateAttributeComplete
events:
- editor:complete
# Widget
templateWidget:
path: widget.ts:includeWidget
codeWidget: include
renderMode: markdown
blockWidget:
path: widget.ts:templateWidget
codeWidget: template
renderMode: markdown
2023-12-22 01:37:50 +08:00
transclusionWidget:
path: widget.ts:transclusionWidget
codeWidget: transclusion
renderMode: markdown
navigateButton:
path: widget.ts:navigateButton
# API invoked when a new page is created
newPage:
path: page.ts:newPage
2023-08-28 23:12:15 +08:00
# Commands
2023-12-22 01:37:50 +08:00
newPageCommand:
path: page.ts:newPageCommand
2023-08-28 23:12:15 +08:00
command:
2023-12-22 01:37:50 +08:00
name: "Page: From Template"
key: "Alt-Shift-t"
requireMode: rw
2023-12-22 01:37:50 +08:00
# Lint
lintTemplateFrontmatter:
path: lint.ts:lintTemplateFrontmatter
events:
- editor:lint
lintTemplateBlocks:
path: lint.ts:lintTemplateBlocks
events:
- editor:lint