Note Link Janitor
Backlinks maintained using Andy Matuschak’s note link janitor
This script reads in a folder of Markdown files, notes all the wiki-style links between them, then adds a special “backlinks” section which lists passages which reference a given file.
- Links are formatted
<a href="">like this</a>.
- Note titles are inferred from the first line of each note, which is assumed to be formatted as a heading, i.e.
# Note title.
.mdfiles are siblings; the script does not currently recursively traverse subtrees (though that would be a simple modification if you need it; see
- The backlinks “section” is defined as the AST span between
## Backlinksand the next heading tag (or
<!-- -->tag). Any text you might add to this >section will be clobbered. Don’t append text after the backlinks list without a heading in between! (I like to leave my backlinks list at the end >of the file)
Make this into a chron job
MAILTO="firstname.lastname@example.org” 0 12 7 * 3 note-link-janitor <path to /notes>