Folks have been hoping for a Table of Contents plugin for a while. This isn’t that, but if you’re on a Mac and have Keyboard Maestro, I’ve created a simple macro that will produce a Table of Contents from a selection of files.
To use it, you select a few files in Finder and activate the macro. The macro copies a bulleted list to your clipboard where each line corresponds with each selected file in link format.
E.g., if you have two files named A.md and B.md, the macro copies the following bulleted list to your clipboard:
- [[A]]
- [[B]]
Here’s what the macro looks like:
And here’s an export for you to install in KM yourself.
This macro produces the full vault path link for the ToC. A key thing you’ll have to edit for it to work for you is the vault root string. Switch the string /Users/ryanjamurphy/Dropbox/Materials with the path to your Obsidian Vault in the Search and Replace action.
If you just want filenames—i.e., you don’t want [[../some folder/some file]]—you can swap the Search and Replace action for a Filter action that deletes the path. Here’s a version of the macro with those changes.
Enjoy!