name: template
functions:
  # API
  renderTemplate:
    env: server
    path: api.ts:renderTemplate

  cleanTemplate:
    path: api.ts:cleanTemplate

  # Indexing
  indexTemplate:
    path: index.ts:indexTemplate
    events:
    # Special event only triggered for template pages
    - page:indexTemplate

  # Completion
  templateSlashCommand:
    path: snippet.ts:snippetSlashComplete
    events:
    - slash:complete

  insertSnippetTemplate:
    path: snippet.ts:insertSnippetTemplate

  handlebarHelperComplete:
    path: var.ts:templateVariableComplete
    events:
      - editor:complete

  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

  # API invoked when a new page is created
  newPage:
    path: page.ts:newPage

  # Commands
  newPageCommand:
    path: page.ts:newPageCommand
    command:
      name: "Page: From Template"
      key: "Alt-Shift-t"
      requireMode: rw


  # Lint
  lintTemplateFrontmatter:
    path: lint.ts:lintTemplateFrontmatter
    events:
    - editor:lint

  lintTemplateBlocks:
    path: lint.ts:lintTemplateBlocks
    events:
    - editor:lint
