Generate a Markdown table of contents from document headings with anchor links.
The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.
Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.
ATX and setext headings are collected, text is lowercased and punctuation removed for a slug, and indented links are emitted up to the selected depth. Repeated headings receive numeric suffixes.
# Introduction ## Getting Started ### Installation ## Usage
Level Text Slug ----- --------------- --------------- 1 Introduction introduction 2 Getting Started getting-started 3 Installation installation 2 Usage usage
README contents, design-document outlines, and static-site sidebars generate heading links.