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

[Templates v2] Add the ability to use VS Code snippet variables in template metadata #692

Open
movermeyer opened this issue Jun 27, 2021 · 2 comments

Comments

@movermeyer
Copy link
Collaborator

#655 added metadata to templates, including the filepath attribute.

As part of #534, I had dreamed of being able to use any VS Code snippet variable in the filepath.

---
foam_template:
  filepath: `journal/${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE}.md`
---

This would allow Foam: Open Daily Note to make use of templates easily.
However, this is not currently possible. VS Code does not currently offer an interface for resolving the snippet variables without opening the snippet in an editor for the user.


Figure out a workaround, or get VS Code to expose an interface that would suit our needs.

@pderaaij
Copy link
Collaborator

pderaaij commented Jul 7, 2021

Would it be an option to open an editor, fill it with the template and resolve the snippets and then save the file? If we parsed the file as a note, you would have access to the frontmatter and the resolved filepath. But it's a path with many things that have to fall into place.

@riccardoferretti
Copy link
Collaborator

I have added a request to improve the support for snippets outside of editors: microsoft/vscode#155868

Let's upvote it to get it in their backlog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants