SilentVoid13 / Templater

A template plugin for obsidian
https://silentvoid13.github.io/Templater
GNU Affero General Public License v3.0
3.14k stars 188 forks source link

Templater Plugin Syntax Not Working #627

Closed margarita-rivera closed 2 years ago

margarita-rivera commented 2 years ago

I've presented this in the Bryan Jenks Community - work flow seems to be okay so he suggested to reach out here if in case it might be a technical issue

Issue:

Templater syntax not working

Example:

<%tp.date.now()%> remains <%tp.date.now()%> instead of:

<%tp.date.now()%> to 2022-04-23

I've uninstalled/installed templates I am using and in loading a template it still shows this way:

Screen Shot 2022-04-23 at 7 28 31 PM

Settings/Other actions taken:

Screen Shot 2022-04-23 at 7 29 40 PM Screen Shot 2022-04-23 at 7 29 48 PM Screen Shot 2022-04-24 at 11 50 41 AM Screen Shot 2022-04-23 at 7 30 39 PM

Thanks for much taking time to read this! Hoping I just missed some setting here or something and this works soon fingers crossed

AB1908 commented 2 years ago

Does replacing templates in file not resolve those commands?

woocore commented 2 years ago

I have the same problems, too.

welpdx commented 2 years ago

Would you be able create a new vault with the bare minimum set up and see if the issue persists? If it does, can you upload that vault here?

I ask because I'm sorry but couldn't reproduce this issue

Demo demo

Edit: hid demo gif

ghost commented 2 years ago

I seem to be having this issue as well. None of the docs snippets render. I have tried:

None of these have resolved the problem.

welpdx commented 2 years ago

@Miusaky, How are you executing Obsidian commands? (I.e., <% tp.date.now() %>)

There are 5 ways to execute Obsidian Comands.

You can execute Obsidian Commands that start with <% and <%* via these 3 ways:

  1. Create new note from template. (Default hotkey: Alt + N)
    new note from template demo
  2. Open Insert Template modal. (Default hotkey: Alt + E)
    new note from template demo
  3. Replace templates in the active file. (Default hotkey: Alt + R)
    Replace templates in the active file demo

You can also use dynamic commands <%+:

  1. Using Dynamic Commands by switching from writing to reading mode.

    Demo with Dynamic Commands demo
  2. Using Folder Templates. Adds Template content in new file, and executing Templater Commands

    Using Folder Template demo
ghost commented 2 years ago

@welpdx I needed to enable 'Trigger Templater on new file creation'. It renders the date now. Should have read through the settings first. Thanks.

welpdx commented 2 years ago

@Miusaky Thanks for reporting back! I'm happy that you were able to fix your issue.

I had thought you had the same settings as @margarita-rivera, and that is why I did not mention the Trigger Templater on new file creation setting. Sorry.

By the way, I also didn't read the settings closely when I first started using it lol. It took me a while to get Templater working because I kept thinking that switching to obsidian's reading mode could execute static Templater commands (<% <%*) ! 🤦‍♂️