LR TOC (Table of Contents) adds a Contents box to the top of any post with two or more headings. Every entry jumps to its section, and every heading has a shareable link.

What it does
- A Contents box at the top of every post with at least two Markdown headings (
#, ##, ###), indented by level. Posts without enough headings are left alone.
- Jump to a section. Clicking an entry scrolls there, with the heading landing clear of the sticky header.
- Link to a section. Clicking a heading copies a direct link to it and shows a "Link copied" note. Opening that link scrolls straight to the section once the post loads.
- No clashes. Section links include the post number, so two posts in one discussion can both have an "Introduction".
- It follows your theme, light and dark, and every label is translatable.



Settings
There's nothing to set up. Install, enable, done. Two optional settings (deepest heading level, default 3, and the minimum number of headings, default 2) can be changed through Flarum's settings API, but there's no admin page for them yet.
What it doesn't do
- No floating table of contents in the corner, and no reading progress bar. The box at the top of the post does the same job without breaking.
- No anchors without a heading. If you want an anchor, add a heading.
Requirements
- Flarum 2.0 or later, PHP 8.3+
Install
composer require linkrobins/toc
Then enable it under Admin, Extensions.
Source: https://github.com/linkrobins/toc
Packagist: https://packagist.org/packages/linkrobins/toc
Every release is posted below.