You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, this is a proposal to have a better control over templates.
The problem
I need frontmatter in my templates for metadata, but I don't want them included in the output unless I choose to. I suppose this could be solved with user functions, unfortunately they're not available on mobile.
What I've tried
I'm currently using file.include() to get the content of a template, which I then strip of its unwanted parts with replace(). It works (although less handy than an internal function), but the real issue is that I don't always have the possibility to use this method.
What I propose
What is really needed is a mean to indicate Templater which part of a file is usable and which is not, per file.
A command like prune_before(direction?: bool = true) could do it, like this:
<% tp.<internal_module>.prune_before() %> would make Templater process content situated after the command.
<% tp.<internal_module>.prune_before(false) %> would make Templater process content situated before the command.
This could let prune_before() be used before and/or after the targeted content.
The text was updated successfully, but these errors were encountered:
Thanks for the fast reply! It's exactly what I needed! I still think a more formal way to do it would be useful but having this is already fantastic! :)
Hi, this is a proposal to have a better control over templates.
The problem
I need frontmatter in my templates for metadata, but I don't want them included in the output unless I choose to. I suppose this could be solved with user functions, unfortunately they're not available on mobile.
What I've tried
I'm currently using
file.include()
to get the content of a template, which I then strip of its unwanted parts withreplace()
. It works (although less handy than an internal function), but the real issue is that I don't always have the possibility to use this method.What I propose
What is really needed is a mean to indicate Templater which part of a file is usable and which is not, per file.
A command like
prune_before(direction?: bool = true)
could do it, like this:<% tp.<internal_module>.prune_before() %>
would make Templater process content situated after the command.<% tp.<internal_module>.prune_before(false) %>
would make Templater process content situated before the command.This could let
prune_before()
be used before and/or after the targeted content.The text was updated successfully, but these errors were encountered: