Omit Text From Templater Action

Things I have tried

I have tried looking up to see if there was a way to have text in a template but for templater to ignore it but have found nothing.

What I’m trying to do

I am trying to do documentation of what I am configuring in my template note. An example of this is listed below. I would like to make notes on my template so that later on when I forgot what that thing is modifying, I can use it as mental refresher. I don’t want the note text to show in the note when created using templater

This creates the Zulu creation time

Created Zulu: <% moment().utc().format() %>

Great idea! One kind of hacky option might be to wrap the note-to-self text inside a Javascript comment block and then inside a templater execution command with an appropriate whitespace remover at the end. E.g.

<%*  /* This creates the Zulu creation time. */  -%>

The /* and */ denote the beginning and end of a potentially multi-line javascript content. The -%> removes a linebreak after the end of the templater bit, see here in the docs.

Maybe someone else will have a less hacky idea!

1 Like