Terminology

To understand how Templater works, let's define a few terms:

  • A template is a file that contains commands.
  • A text snippet that starts with an opening tag <%, ends with a closing tag %> is what we will call a command.
  • A function is an object that we can invoke inside a command and that returns a value (the replacement string)

There are two types of functions you can use:

Example

The following template contains 2 commands, calling 2 different internal functions:

Yesterday: <% tp.date.yesterday("YYYY-MM-DD") %>
Tomorrow: <% tp.date.tomorrow("YYYY-MM-DD") %>

We'll see in the next part the syntax required to write some commands.