Skip to content

Templater

The templater plugin removes the tags of Templater from the PDF. Templater runs them only when a template is applied to a note. Reading view does not run them, so the PDF does not show their code either.

Markdown

<%*
const title = await tp.system.prompt("Title of the meeting");
await tp.file.rename(title);
-%>
---
type: meeting
date: <% tp.date.now("YYYY-MM-DD") %>
---
## Agenda

1. Status of open actions
2. Next steps
<% tp.file.cursor() %>

Inline code such as `<% tp.file.title %>` is shown as written.

PDF

The note without its Templater tags

  • <% ... %>, <%* ... %> and <%+ ... %> are removed, on one line or on several.
  • Whitespace control works as in Templater: - next to <% or %> removes one newline on that side of the tag, _ removes all whitespace on that side.
  • A template often starts with a <%* ... -%> block in front of its frontmatter. When the note starts with tags and the frontmatter follows them, the frontmatter is read like the frontmatter of any other note and not printed.
  • Tags inside code blocks and inline code are left as written.
  • --disable-plugin templater prints the tags as text.