Skip to content

Instantly share code, notes, and snippets.

@evantravers
Last active March 10, 2020 20:26
Show Gist options
  • Save evantravers/f6048a2e2acd809964de3c53662f2692 to your computer and use it in GitHub Desktop.
Save evantravers/f6048a2e2acd809964de3c53662f2692 to your computer and use it in GitHub Desktop.

Simple Markdown Zettelkasten

(Simple Markdown Zettelkasten, or SMZ for giggles.)

As I've lurked productivity twitter, I've noticed that a lot of the digital Zettelkasten1 systems that I've seen fall into two categories: ones using markdown plain text files, and ones using a dedicated tool like Roam/Notion. Systems using markdown files can differ wildly given the eccentricities of the particular user, and their favorite text editor.

After some research, here is what I believe to be the most compatible markdown format for plain-text Zettelkasten files.

tags: #notes, #productivity

> When in the course of human events, it becomes necessary to build something from scratch that you can buy off the shelf...

[Source](http://evantravers.com/articles/2020/01/01/fictional-post/)

Sometimes the pursuit of something is worth the effort required to attain it.

Related to [[12473 - Abusing historical speeches.md]]'s discussion of plagiarizing 19th century speech craft.

Implementation Details

My goals were simplicity and portability. I want files that are most compatible with different apps and editors, so that I can easily take my knowledge-base anywhere.

Simple Manifesto

Use small, bare markdown files.

Use simple file links for connections between notes.

Use plaintext for tags/contexts.

Basic actions

There are certain things that all ZK systems must do:

  • Note retrieval: for example, how fast and easy is full-text search?
  • Note creation: does it take many clicks or keystrokes to create a new Zettel note?
  • Note connections: which mechanisms does the app support to create connections?
  • Data export: how does the application manage to get everything out without losing information? How does it manage to get stuff in?

Source��

One thing that a self-built system has to take into account is how these actions are possible on desktop and mobile. Given that we are dealing with a folder of plain-text files, any computer can edit the files… the question is whether it's easy.

Connections

Sometimes an idea just links to another idea, but sometimes the connection is the valuable idea, and there should be a note in the middle. (If A and B have shared concept, create a note linking the two concepts our notes. A ⬅ thought related to the relationship of A to B ➡ B)

It'd be good to have standardized actions for connecting and splitting/extracting.

Links

Although it's not part of the official markdown spec, it seems a fair number of major editors support "wikilink" or "free link" style links (e.g., [[link]]). The ones that don't aren't really trying to support this kind of weird wiki/database style flow, so I feel pretty comfortable continuing down this path.

Some examples I tried today:

Supports:

Doesn't support:

  • Drafts
  • Vim's default markdown syntax
  • iA Writer
  • Ulysses

It's worth noting that some apps support the file extension, some just want the title. I think that for maximum compatibility I'm going to embrace the file extension.

Tags

Mediawiki Tags (:tag:)

Previously, I have been lightly using vimwiki style tags (I think they get them from mediawiki?) They look like :this:. I don't like writing the regex for these tags, and I can't find anything but vimwiki that supports them.

Hashtags (#tag)

At this link, @sirupsen is using #hashtag style, but that conflicts with the markdown syntax for a header, so I'm worried about the ramifications.

NvUltra is using MMD style front matter for tags, and syncing them to OS X metadata, which is very cool.

Drafts.app doesn't list files by filename, but by the first line in the document, so while it supports MMD front matter, it looks weird. I am not worried about this, Drafts is where text is captured, not stored.

1Writer uses the #hashtag format, the blogger here uses a combo of MMD and hashtag, which I may adopt since 1Writer is pretty nifty on the iPhone. iA Writer uses #hashtags too.

Backlinking

It's very handy to pull a list of items that link to the current file. It seems like searching for the current file name should be sufficient, since I'm using the [[freelink]] syntax to link.

My implementation of SMZ

I'm going to use vim on desktop, and 1Writer and Drafts on mobile.

nvim

I'll need to override "go to definition" in markdown to Ack/Rg all the entries of that tag, and write omnicomplete func to autocomplete tags… or steal this from someone else's work.

(Extraction? Search for files that don't have a tags: in their front matter? rg --files-without-match "^tags: ")

1Writer

1Writer is largely done. It supports linking, searching for tags, and jumping through connections.

Drafts

Drafts integration

  • MVP: place in inbox or in correct folder.
  • Cool: autocomplete from generated tags file?

File System

Booknotes and link highlights would need to be broken up into individual zettel over time.

I need a source archive to link to, similar to current wiki?

  • links
  • Bibliography/booknotes

References

I've been scouring my own old wiki for references…

Footnotes

  1. For this document, I'm not going to try to define what the Zettelkasten system or practice is, there are entire blogs and YouTube videos dedicated to this topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment