Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change When The template variables are consumed to allow templater plugin's tp.file.include #184

Open
2 tasks done
rhhub opened this issue Nov 18, 2024 · 4 comments
Open
2 tasks done
Labels
type: enhancement New feature or request

Comments

@rhhub
Copy link

rhhub commented Nov 18, 2024

⚠️ Please check that this feature request hasn't been suggested before.

  • I searched previous Ideas in Discussions didn't find any similar feature requests.
  • I searched previous Issues didn't find any similar feature requests.

🔖 Feature description

I want to be able to place ReadItLater template variables inside markdown templates and include them using the templater plugin. Is it possible to resolve the ReadItLater template variables after the tp.file.include() are called?

link to templater plugin.

Currently

The tp.file.include() call works fine in this case but I can't place templater variables inside markdown templates because they end up unchanged in the final note.

ReadItLater Youtube note template:

---
<% tp.file.include("[[_common_yaml_template]]") %>
url: %videoURL%
channel: %channelURL%
---
## Video
%videoPlayer%

✔️ Solution

Is there a way to consume the template variables after the templater calls resolve?

ReadItLater settings Youtube note template:

<% tp.file.include("[[youtubeTemplate]]") %>

youtubeTemplate.md:

---
<% tp.file.include("[[_common_yaml_template]]") %>
url: %videoURL%
channel: %channelURL%
---
## Video
%videoPlayer%

❓ Alternatives

No response

📝 Additional Context

No response

@rhhub rhhub added the type: enhancement New feature or request label Nov 18, 2024
@adamluckdev
Copy link
Collaborator

Do you have enabled option "Trigger Templater on new file creation" in Templater plugin settings? Maybe that's because your templater syntax is not replaced.

@rhhub
Copy link
Author

rhhub commented Nov 22, 2024

Yeah it's enabled. The templater plugin syntax does get replaced (I didn't provide the output). If I put ReadItLater template variables in the templater plugin markdown file, they won't get replaced.

@adamluckdev
Copy link
Collaborator

Thanks for the clarification, now I fully understand your issue.

Basically we need to invoke Templater logic, before ReadItLater starts to replace variables in template.

@rhhub
Copy link
Author

rhhub commented Nov 22, 2024

Yeah.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants