Pros and Cons of Using the Zettelkasten prefixer core plugin

Artem Kirsanov’s “My simple note-taking setup” recommend not using the Zettelkasten prefixer core plugin. Instead, it recommends registering the date & time the Zettel was created by including {{date: YYYYMMDD}}{{time: HHmm}} and {{title}} in the YAML towards the top of a zettel.

But Jamie Todd Rubin gives an example in which he queries Obsidian to find his daughter’s most recent school health form. The query includes the daughter’s first name as a tag and the text “school health form” in the file name. The query returns 3 results, and Rubin finds the most recent by inspecting the Zettelkasten prefixes in the 3 titles.

Is there any way to duplicate this using Kirsanov’s simpler method, which puts the date & time in the note’s body rather than its file name?

1 Like

Sure, just add the year to the query (which Rubin could have done, too).

(If I had yearly school forms, I’d put the year in the name if they weren’t filed in school-year folders.)

I’m not sure these are the same thing. Rubin’s approach yields a list of notes with “School Health Form” in the title and sorted by the dates of the notes, and from this list he selects the note with the most recent date. But doesn’t adding the year to the query assume the user already knows the year of the most recent note?

To be clear, I can see how Kirsanov’s approach could work with something like the Nunjucks templating language, especially since it can integrate JavaScript code into a template.

For example, here are two examples of psuedocode that would do the trick.

Psuedocode to reproduce Rubin’s results

    select all notes with "school health form" in the title
        sort results by date  <! "date" is in the note's body !>
        display results

Psuedocode to streamline Rubin’s approach

    chosen <- select all notes with "school health form" in the title
    display chosen[max(date(chosen)]

This second method selects the most recent note without requiring the user to examine a list. Both methods assume certain algorithms are available: the first requires a sort algorithm, and the second method requires a max algorithm. The second also assumes the ability to index and subscript records by date. Since Nunjucks can incorporate JavaScripts, it should be possible to do this, maybe without even a JS library.

One might also use the DataView community plugin to implement this as a SQL query.

But the problem with these solutions is that they require a moderate level of programming knowledge, and, depending on how familiar such knowledge is, they could take an afternoon or more to implement. (E.g., I’ve written plenty SQL, but I haven’t used it in well over a decade; it would take me substantial time to get back up to speed; and I wouldn’t want to do this for a 1-shot task.)

I’m more interested in something as quick and simple as Rubin’s approach but without date-time strings in the note titles.

I did assume that, probably influenced by the example of school health forms.

What is your use case? Do you expect to have long sets of files where the date order is important (Rubins’s sorting of 3 files seems a very small win)? In that case (for me: daily notes, receipts, etc.) I think including the date in the name of those files (not all files) is the simplest, most sensible solution. If you don’t want that, I’d suggest DataView. If you don’t want DataView, either…maybe someone could write a plugin that tracks when files were created and enables sorting by that in search?

If the files don’t change long after creation, you can sort by last-modified date.

My concern regarding this is about the “Unlinked mentions”. Adding the Zettel prefix means that nothing will ever show up in this section. Anyway to get around this?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.