Make a table of contents for your Markdown
Paste a README or any .md file. Get a linked table of contents that works on GitHub, GitLab or Pandoc, and a check of your headings.
- Free, no sign-up
- Nothing uploaded
- Markdown or HTML, or the whole file
No file handy? Try one:
Have a .md file? or drop it on the box.
How it works
- Paste or open your Markdown. Lines starting with # are headings, and so are lines underlined with === or ---. Code blocks, front matter and comments are skipped, so a # inside a shell example never lands in the table.
- Pick where the file will be read. GitHub, GitLab and Pandoc each turn a heading into a link anchor their own way; the page uses the rule of the site you pick, including the -1, -2 endings for repeated headings.
- Choose the levels and the list. H2 and H3 by default, bullets or numbers. The table updates as you change anything.
- Copy it, or download the whole file. The download has the table after your intro, between <!-- toc --> and <!-- tocstop -->. Paste the file again after an edit and the block is replaced.
- Read the heading check. More than one H1, skipped levels, empty, repeated, vague or very long headings, and bold lines that look like headings are listed with what to do.
Questions
- Will the links work on GitHub?
- Yes, with Links for set to GitHub. The page makes each anchor the way GitHub does: lower case, punctuation and emoji removed, spaces turned into hyphens, and -1, -2 added to repeated headings. GitLab and Pandoc have their own rules, so pick the site the file will be read on.
- How do I keep the table up to date?
- The downloaded file has the table between <!-- toc --> and <!-- tocstop --> lines. Paste the file here again after you edit it and the block is replaced in place. Blocks from other tools marked <!-- TOC --> or doctoc are replaced too.
- Why is a heading missing from the table?
- Only the levels chosen under Headings in the table are listed, H2 and H3 by default. Lines inside code blocks, front matter and comments are not headings, and a bold line is not a heading either: start it with ## to make it one.
- Numbers or bullets, 2 or 4 spaces?
- Both work on GitHub and GitLab. MkDocs and other Python-Markdown sites need nested items indented by 4 spaces; pick that under More options.
- What does the AI step change?
- Either your headings (one title, no skipped levels, a clear subject for vague or very long ones) or only the labels in the table, with your headings left as they are. The page refuses any answer that adds a number not in your document or drops a code name, and you can undo it.
- Is my document uploaded?
- No. The table and the check are made inside your browser tab. Only the optional AI step sends the list of headings with the first words of each section, and only when you press its button.