From 462dd65663983a7946a3bef287532aa79c4cf803 Mon Sep 17 00:00:00 2001 From: ingalless Date: Tue, 23 Feb 2021 19:50:37 +0000 Subject: [PATCH] Document templates in-place (#32) * Document templates in-place * Improve template copy Co-authored-by: Riccardo Co-authored-by: Jonathan Co-authored-by: Riccardo --- .foam/templates/your-first-template.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .foam/templates/your-first-template.md diff --git a/.foam/templates/your-first-template.md b/.foam/templates/your-first-template.md new file mode 100644 index 0000000..d1c1767 --- /dev/null +++ b/.foam/templates/your-first-template.md @@ -0,0 +1,25 @@ +# Foam Note Templates + +Foam includes note templates! +This allows you to easily create notes that have similar structure without having to use copy/paste :) + +Templates support the [VS Code's Snippet Syntax](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-syntax), which means you can: +- add variables to the newly created note +- add tabstop to automatically navigate to the key parts of the note, just like a form +Below you can see an example showing a todo list and a timestamp. + +## Todo List + +1. ${1:First tabstop} +2. ${2:A second tabstop} +3. ${3:A third tabstop} + +Note Created: ${CURRENT_YEAR}${CURRENT_MONTH}${CURRENT_DATE} + +--- + +Try out the above example by running the `Foam: Create New Note From Template` command and selecting the `your-first-template` template. Notice what happens when your new note is created! + +To remove this template, simply delete the `.foam/templates/your-first-template.md` file. + +Enjoy!