This is a work in progress template for the Templater Plugin within ObsidianMD. It’s job to to track daily activities as seen here.
The script currently works, but has yet to be configured appropiately for the average user. Expect users and idiosyncrasies.
- ObsidianMD
- Templater (with a defined templates folder)
- Daily Notes (built-in)
- Copy the template.md into your Templater directory
- (Optional) Edit
dailyNotePathSchema
variable to match your Daily Note configuration By default it’s set to[Logs]/YYYY/MM - MMMM (Y)/Y-MM-DD[.md]
which is equivalent to setting Daily Notes to the following:- Date Format: YYYY/MM -\ MMMM \(Y\)/Y-MM-DD
- New File Location: “Logs”
The brackets (
[]
) aroundLogs
and.md
are to escape the text from processing. Use this syntax to reference folders or non-date-related formats. - Define a “workflow” directory
In this directory, every file will be treated as a workflow for you to select from. Additionally, you can set default attribute fields with the
attributes
frontmatter array variable. - Add metadata to your daily note (see
dailyNote.md
for example) Each daily note will require the following:- workflow_path: a string containing your workflow directory (i.e, “%%, “%/Workflow”, “%/Work”)
- activity_regex: a regex pattern for parsing
Set this to the following unless you know what you’re doing:
- #(?<emoji>\S+) (?<time>==\d\d:\d\d==-==\d\d:\d\d==) (?<workflow_metadata>\(.{0,2}\s+.*\)+)\s+\^id-(?<id>\d{1,})\n\s- :PROPERTIES:\n\s\s- :BEGAN: (?<begin_time>\d{10}|#BEG)[ ]*\n\s\s- :ENDED: (?<end_time>\d{10}|#END)[ ]*(?:\n\s- (?<notes>.*))?(?<extra_notes>(?:\n\s{2,}- .*)*)?
Note here that the `(?<VAR>)` indictates a named capture group. Currently, id, begin_time, and end_time are required.
- time_start_placeholder_tag: a tag (without `#`) that will act as placeholder for the start times of your activities
- time_stop_placeholder_tag: a tag (without `#`) that will act as placeholder for the end times of your activities
- And try it out by running the template