Jump to content

TOC 1.0: Create, update and remove a markdown TOC (table of contents)

Recommended Posts


TOC Workflow creates, updates and removes a markdown table of contents that can be useful when writing a more complex document. It should work fine when exported to a html document.

Note that, due a bug/limitation of current OSX PDF print function, TOC will not work in a PDF saved/converted by most of writing applications.

How to Use

Create a TOC

  • open your markdown editor and type your text
  • when you finish it show Alfred and type the keyword toc
  • press Return key
  • the workflow will select the text, copy it, add the TOC and anchor, then paste the text back
You can also set a hotkey to create a TOC.

Update a TOC

If you have edited the text after inserting the TOC then just run the keyword toc again and the workflow will create an updated TOC.

Remove a TOC

The workflow can also remove the TOC and anchors for good. It can be handy if you e.g. want to work with a cleaner text, without TOC and anchors.

To remove show Alfred, type the keyword toc, hold Command key then press Return key.

You can also set a hotkey to remove it.


Type your markdown text as always and don't you worry about TOC:


Show Alfred, type the keyword toc then press return key (or use the hotkey) to create a TOC and the anchors:


Preview the document to see the TOC:



Before using the workflow for good make some tests and backup your texts first.

Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...