Change note formatting/template based on tag or folder

Inspired by the Auto Note Mover, DB Folder and Templater plugins. Auto Note Mover allows you to automatically send notes to folders according to their tags, while DB Folder allows you to create Notion-like databases sourcing an entire folder or tag (or more recently dataview queries).

Conceptual Idea

I’m thinking that if I send a note to a folder with Auto Note Mover, such as #literature-note, I want it to automatically format with a template for #literature-note.

Sketch of Concept

Let’s say I send “NOTE A” to “root/Zettelkasten/Literature Note/NOTE A”. It then detects which folder it is in, and automatically generates a predefined template if there is no previously inserted template:

---
template: #t/Literature-Notes
tags: _____
source-note: _____
---
blah blah blah

But here’s the part where I’d like to become even more flexible… The interchangeability between different templates. So for example I wanted to convert “NOTE A” to a Source Note, I will send that note to “root/Zettelkasten/Source Note/NOTE A” instead, and the following template will occur:

---
template: #t/Source-Notes
tags: ____
source: _____
URL: ____
author: _____
---
blah blah blah

The thing to note here is that if there is a tags: ____ YAML or tags:: ___ inline attribute, the values are preserved when changing note types. So if there were tags: dogs, cats, then the same tags will be passed along to the newly applied template.

Possible Logic Flow

  1. Plugin detects new location of note, then checks if there is any existing template.
    1a. If a template exists, it checks if it is correct and matching the folder.
    1b. If there is no template, it then prepares to apply the corresponding template.
  2. Plugin checks if there are any existing fields that correspond to the current template. If the template contains tags or source for example, it will then copy these values to populate the new template.

Wondering if this is something people would want?

2 Likes