Giter Club home page Giter Club logo

Comments (3)

Zachatoo avatar Zachatoo commented on July 21, 2024 1

You can also do this.

<% tp.file.include('[[Article]]') %>

It appears that the ; in an interpolation command doesn't work. Same error message shows if I do this in the Article.md template:

# <% tp.file.title; %>

So this doesn't really have anything to do with tp.file.include(), rather the use of ; in interpolation commands. You can only use them in execution commands.

Unlikely to fix this, since the documentation doesn't have any ; in it's interpolation commands, I'm going to say this is not a supported feature. Thanks for the report, I didn't know about this behavior until now!

from templater.

stracker-phil avatar stracker-phil commented on July 21, 2024

Hm, I found a workaround for the issue, I do not know why it works, though:

<%* const res = tp.file.include( '[[Article]]' ); -%>
<% res %>

This correctly renders the included template in the current note

from templater.

stracker-phil avatar stracker-phil commented on July 21, 2024

Wow, I was so focused on the .include() function that I did not think about this being a general syntax issue.

Thanks for clarifying, with that change, the template works!

An idea: Maybe it's possible to trim the trailing ; from the interpolation string before passing it to rusty for parsing. But that's a nice-to-have, and I'm not even sure if you can do this, or if that's part of rusty's internal logic.

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.