TOC Navigation

Never lose your place in a long article

WebInk builds a clickable table of contents from any web page — with real-time scroll tracking that always shows where you are.

All Features
Table of Contents8
1Getting Started
1.1Installation
1.2Configuration
2Basic Usage
3API Reference
3.1Authentication
3.2Endpoints
3.2.1Rate Limits

How it works

A list from the article

WebInk reads headings inside the extracted article, down to the depth you set. The default is H1 through H3. Empty headings are skipped.

Scroll-aware highlighting

An Intersection Observer on the live headings picks the active row. The top margin accounts for a sticky header, and the lower half of the viewport is ignored.

Depth, numbers, and placement

Set the maximum level from 1 to 6, turn on numbering, and choose whether the list is written at the top, the bottom, or at a {{toc}} placeholder.

How the list is built

The TOC tab fills in after a conversion of the current tab succeeds. The content script clones the document, runs Defuddle, and reads headings from that article HTML, from H1 down to the maximum depth. The same article is what the HTML to Markdown path converts. Headings that Defuddle removed, including most navigation and footers, never enter the list.

Each kept heading is matched back to an element on the live page so a click can scroll. The match is exact text first. Headings that share the same text are paired in order, so the second “Overview” is not stuck on the first. If exact text fails, a looser match is allowed only when the shorter string is more than half as long as the longer one. A heading with no matching element is dropped. If the live element has no id, WebInk writes toc- plus that heading’s index in the extracted list. An id that was already on the element is kept.

Clicks, highlight, and the header offset

Clicking a row sends the anchor to the page. The page measures a sticky or fixed header or nav that sits at the top. The first element that matches wins. If nothing matches, the height used is 20 pixels. The scroll target is the heading’s position minus that height, minus another 50 pixels, with smooth scrolling. The heading then gets a short blue flash that lasts about two seconds.

While you scroll, an Intersection Observer watches those elements. Its top margin is the header height plus 10 pixels, and the lower half of the viewport is ignored. The topmost heading in that area is active. If none intersect, the nearest heading above it is used.

Pages that come out well, and pages that do not

A long article with real heading elements in the main column is the case this list is built for. No headings, or headings only in a bar the extractor discards, produce an empty list, and copy or download toasts that there is no TOC content. Depth runs from 1 to 6 and defaults to 3. A site that swaps the article without a full load can leave the previous list until the tab finishes loading again.

Templates, the note, and ZIP export

Defaults leave the list out of the Markdown: include-in-note is off, numbering is off, and the position is the top. Turn inclusion on and the list is written at the top or the bottom of the article body before the content template runs. The Markdown form is a bold “Table of Contents” line followed by a nested bullet list. Each item links to # plus the anchor. With numbering on, the bullet carries a dotted index such as 1.2, counted from the shallowest heading that was kept.

If the content template contains {{toc}}, that placeholder is filled and the automatic insert is skipped, so the list appears where you wrote the placeholder. Custom position with no placeholder falls back to prepending the list. Copy on the TOC tab, and the download button, write only the list. The file name is the page title plus -toc.md. ZIP export packages the note afterward. It does not rebuild headings, and it does not turn the fragment links into files.

Questions about the list

Why is a heading missing from the list?
The list comes from the article Defuddle extracted. A heading the extractor drops, an empty heading, or a heading with no matching live element is skipped. The default depth stops at H3, so raise Maximum Depth to include H4–H6. Headings that exist only inside a shadow root are not found by the document query.
Why does the highlight sit on a different section than the one I am reading?
The observer ignores the lower half of the viewport and the strip under a sticky header. The topmost heading in the remaining area is active. If none intersect, the nearest heading above that area is used. Header height is the first sticky or fixed header or nav at the top, or 20 pixels when none match. A sticky banner that matches first can throw the offset off.
Why do the TOC links fail after I save the note?
Each item links to the id on the live page: the heading’s existing id, or toc- plus its index in the extracted list. That id is written onto the page element so the side panel can scroll. The downloaded note does not turn those fragments into heading slugs. They resolve in a note app only when that app has an element with the same id.

Navigate any article like a pro

Install WebInk and get instant table of contents on every page you visit.

Add to Chrome
More from WebInk