TextIndex: a Markdown Pre-Processor and Syntax Extension for End-of-Book Indexes
Matt Gemmell released another Markdown writer’s tool, this time a Python-based pre-processor for generating indexes for books: TextIndex.
TextIndex introduces curly braces in some places to mark words (or phrases) for index generation, like in the following example, piggybacking on what looks a bit like footnotes (which would use square brackets) or links:
Most mechanical keyboard firmware{^} supports the use of [key combinations]{^}.
This would put “firmware” and “key combinations” into the index, so that the index will list the page this sentence is printed on for both terms. Simple as that.
From there, it only gets more flexible as you cross-reference related terms, introduce aliases or handle plurals.
Scroll down on the TextIndex page for an example index that was generated for that documentation page itself.
I love the simplicity of this. The syntax introduced is purely additive: curly braces are not used in Markdown for anything else, which means you can both process it like TextIndex does without false positives, and strip it with similar confidence without accidentally removing something you want to keep.