Giter Club home page Giter Club logo

Comments (3)

SilentVoid13 avatar SilentVoid13 commented on June 6, 2024 1

Hey @insecurejezza coming back at you because, as of Templater 1.0.0, what you describe is now possible.

You can now have a dynamic template that does something depending on the note's title, here's an example:

<%* if (tp.file.title.includes("Note")) { %>
Do stuff ...
<%* } else { %>
Do other stuff 
<%* } %>

Check https://github.com/SilentVoid13/Templater#eta-features for more informations.

Tell me if this works for you.
Closing this.

from templater.

SilentVoid13 avatar SilentVoid13 commented on June 6, 2024

Hey @insecurejezza, dynamic templates like you describe are not possible in Templater.
That's a good idea though, but I'm not sure how I could implement something like that.
Do you want this feature just to avoid having to select a template in the modal that pops up ?

from templater.

insecurejezza avatar insecurejezza commented on June 6, 2024

Not necessarily to avoid the modal, although that would remove a few key strokes.

My main use case is to make it play well with the Note Refactor Plugin. It allows you to split a single note into multiple seperate notes based on heading conditions (eg. Everything under an H1 heading becomes it's own note and the first line becomes the note name). It also applies a user defined template to the new note. Templaters internal templates are already compatible with the with note refactor, but I can only define one template. A dynamic capability would just mean that notes that are refactored will have a template applied to them that are appropriate to the note time, reducing the friction of having to go into each individual note and add the appropriate template manually.

I think having dynamic template capabilities would open up a lot more opportunities beyond my very specific (and selfish) use case though.

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.