Skip to content

Table of Contents ​

A table of contents is a list of links to your document's headings. WriteRoom writes it as ordinary Markdown between two comments, so it works anywhere Markdown is read.

If you publish with a tool like Pandoc or a website builder, let it make the table of contents. This one is for documents read as Markdown, like a README.

markdown
<!-- toc -->
- [Installing](#installing)
  - [Requirements](#requirements)
- [Usage](#usage)
<!-- /toc -->

To add or update a table of contents ​

  • Format > Headings > Generate Table of Contents

A new one goes above your first section, after any title and introduction. To move it, cut and paste. If the document already has one, it's updated, rewriting only the entries that changed.

To go to a heading ​

  • Command-click its entry
  • Or Go > Open Link (Command-Return) with the caret in the entry

What's listed? ​

Every heading except the title, which is a lone # heading at the start of the document. Headings in quotes, lists and code blocks aren't listed.

Links use the same heading anchors as GitHub. To give a heading your own anchor, end it with {#name}: ## Installing {#setup}.

Options ​

Options go in the opening comment, then Generate Table of Contents to apply them.

  • levels=2-3 lists only heading levels 2 through 3. levels=2 lists level 2 alone.
markdown
<!-- toc levels=2-3 -->

See also ​