Code Monkey home page Code Monkey logo

Comments (4)

Robert-Forrest avatar Robert-Forrest commented on May 25, 2024 1

I have now disabled+enabled the extension, restarted obsidian, and re-installed the extension, and the issue persists in all cases.
(EDIT: I also have disabled all other plugins just in case there was some sort of conflict occurring)

After some more consideration problems only seem to arise when I have user-defined templates.

The {{ }} are only present when a template is applied when they contain a user-defined template, e.g. {{tp_yesterday}} renders properly as 2020-11-19, but if I define a user template "today" as "powershell (Get-Date -UFormat '%A, %d %B %Y')", applying the template with {{today}} gives {{Friday, 20 November 2020}}.

Also, while having the user-defined "today" template, if I try to use the internal template {{tp_today}}, applying the template to a document produces {{tp_Friday, 20 November 2020}}. It seems that wherever the text containing the name of a user-defined template is found, that template is inserted - If I define a template just called "a" with the same formula as the "today" template above, and apply it to a document containing just the string "the cat sat on the mat", the document produced is:

"The cFriday, 20 November 2020t sFriday, 20 November 2020t on the mFriday, 20 November 2020t"

I hope that this is useful info, if there are any more details about my environment that would be helpful let me know.

Thanks for this extension by the way, its much more useful than the core template functionality!

from templater.

SilentVoid13 avatar SilentVoid13 commented on May 25, 2024 1

Oh, okay ! Sorry, I misunderstood your initial question.

The curly braces are only necessary for internal templates, so stuff like {{tp_today}}.
This is to recognize them and to avoid conflicts with user defined templates.

For user defined templates, you set whatever template keyword you want, like you experienced with the letter a. You could also define a template like so: [[today]]. This is up to you. Curly braces {{ }} are not added nor imposed to user template keywords.

Maybe the README is a bit confusing about this ?

from templater.

SilentVoid13 avatar SilentVoid13 commented on May 25, 2024

Hello @Robert-Forrest, that issue seems weird, i'm not able to reproduce it.
I'm testing on a fresh new vault with version 0.4.2 and obsidian 0.9.15 as well.
I'm running Linux, but I tried on a Windows VM and couldn't reproduce this bug either.
You're the first one having this issue, and this seems like a problem with your machine, or your obsidian app.
Try restarting obsidian and try disabling / re-enabling Templater.
If this doesn't work, try uninstalling Templater and re-installing it.
Tell me how this goes.

from templater.

Robert-Forrest avatar Robert-Forrest commented on May 25, 2024

Ah! I see, I understand now - On reading the README again this has become clear, this was just down to me not grasping the way the template names worked properly.

Thanks for your help!

from templater.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.