The linking of two notes is one of the most important functions in a zettelkasten. In addition to the mere linking, the user makes a number of other requirements for this function:
- the link should be robust, i.e. if the linked document changes, all links should continue to work. This requirement is not met by a link via the title only.
- the link should also be easy to understand at the place where it is integrated. The pure ID of the linked document does not fulfill this requirement.
- the linking of the markdown files should work independently of ThoughtTank.
- in a web-based card tray, the content of the document should also be reflected in the URL.
Each note is a separate markdown file in the /notes
directory.
As filename we use an Id which we derive from the time of the first creation.
So [...](/notes/<ID>)
is the simplest form of linking in markdown, which meets the requirements 1 & 3.
For better readability, we recommend to include the title of the linked note in the markdown code: [...](/notes/<ID> "<Title of note ID>")
. This additionally fulfills requirement 3. Thought Tank saves such a link in the clipboard when you click on the “Copy Link” button. If the title in the linked note changes, the old title in the link remains, but the link still works.
To make the title already visible from the URL (requirement 4), we use rewrite mechanisms of the web server. We create a link to https://.../notes/<ID>/title-of-note-id/
and instruct the web server to accept all links of the form /notes/:id/:title
and to redirect them to /notes/:id
without error message. This also allows external links to notes whose title has changed to remain functional.
The title of a note is well chosen if it is also suitable as text for linking. When using the hashtag [#](/notes/<ID> "<Title of note ID>")
we replace the hashtag #
in the generated file with the title of the linked note.
However, the user can choose any text under which to link the note. For example the markdown code
We integrated many [wonderful features](/notes/2020041409284289 "Thought Tank features to build well documented and connected thought") to support you in building a self-hosted Zettelkasten.
translates into:
We integrated many wonderful features to support you in building a self-hosted Zettelkasten.
If you move your mouse over the link you can also see the title of the target document. We update this “tooltip” even if your link’s title became outdated.