Having a project template works regardless of the note taking app you use. However, if you use Obsidian, like I do, then my template has some special features that take advantage of two powerful plugins:
Using these two community plugins, I want to create through automation, a project home note that has:
- File properties filled out.
- A body template with headers to fill in that help me plan my project.
- A list of all the files in my project folder explained simply and clearly.
The first half of the Template file, uses Templater code. Templater, like the name suggests expands templates. What makes it so powerful is that it can run JavaScript, and will expand certain expressions saving you typing. For example, it knows the data and time the file was created, so it can plug that information into the file for you.
The first section of the project template file contains "front matter". Front matter is meta-data., Meta data is about the note, but not technically in the note.
In Obsidian, front matter contains properties
. To create a block of properties, you make first line of the file start with three dashes. Like this: ---
the end of the front matter will be three dashes on their own line: ---
Between those lines will be properties
. In my file I put these properties:
- aliases - these are simple names for a file.
- Author: who created the file.
- Created: The date the file was created.
- Update: The last time the file was changed.
- Tags: Searchable key words for the files subject matter.
- Comments: I use this field with the dataview table. It gives some insight as to what
Within this block of text, are some special templater codes that start with <%
and end with %>
. Templater will recognize these "brackets" and replace them with the results of the functions you put between them. For example.
tp.file.title.slice(1)
- expands the title of the file removing the first character (the underscore) to make it more readable.slice()
returns the slice of a string from the character position you give it.tp.file.creation_date("YYYY-MM-DD")
- this function expands to the date the file was created in the format of four digit year (YYYY), two digit month (MM) and two digit day (DD).
The whole front matter block looks like this:
---
aliases:
- <% tp.file.title.slice(1) %>
Author: Scott Novis
Created: <% tp.file.creation_date("YYYY-MM-DD") %>
Updated:
tags:
- ProjectPlan
- StartCard
Comments:
---
The Body
After the front matter comes the body contains the heart of the file. I created this template to prompt me to answer several questions.
- What is this project? Simply and clearly.
- What is my goal? What am I trying to achieve?
- What does done look like? As they say, begin with the end in mind.
- Branches - this heading contains a bullet list links to subnotes.
- Plans - this is where I put my current tasks.
- Journal - This contains dated entries to mark when I have worked on the file. It helps me bridge between the last time I worked on a project and the next time.
# <%tp.file.title.slice(1)%>
## Overview
_Quick overview, purpose, standards._
## Goal
_link to goal_
## Done Looks Like
_how do I know I'm done?_
## Branches
## Resources
## Plans
- [ ] What is next?
## Journal
-
You can see that I use the slice()
function again to remove the starting underscore from the file name to give the note an H1 title that is readable.
Dataview File List
After the body of the template, comes this block of code that looks a lot like SQL. This is DQL, or Dataview Query Language. Dataview is a community plugin, like Templater. Where templater automates text expansions, saving typing, Dataview treats your vault like a database. You can literally generate reports from your notes using Dataview.
This bit of DQL lists all the notes in the current folder with their comments. It would be beyond the scope of this article to explain dataview query language, but here's a quick outline.
TABLE WITHOUT ID
- this section tells dataview what fields from each file to return. In this case, we want the easily readable file name (the alias), and the comments from the front matter.WHERE
- this clause limites what files will be considered. The tricky part is thecontains()
this limits the list to files in the same folder as the home note. thefile.name != this.file.name
excludes the project note from being included in the list.SORT
- Finally, the results are sorted alphabetically by the alias name.
## Files
```dataview
TABLE WITHOUT ID
link(file.name,file.aliases[0]) as "Note",
Comments as "Description"
WHERE
contains(file.path, this.file.folder)
AND file.name != this.file.name
SORT file.aliases[0] ASC
## Connections
- [[<% tp.date.now("YYYY-MM-DD") %>]] - Daily Note for day this file was created.
So what does all of this give you?
- A file with preloaded properties.
- A structure of headings that need to be filled in.
- And a table that shows a very readable version of every file that is in this project folder.