SilentXx SmartToc

"Investing is not about how much money you make, but about whether you can maintain returns over the long term. —— Peter Lynch"

🤖 SilentXx SmartToc

An open-source AI table-of-contents component. Whether or not an article has a heading structure, it builds the most suitable sidebar outline automatically — real heading trees, AI semantic sections, pseudo-heading detection, paragraph navigation, five levels of fallback, and the article itself is never modified.

📦

npm install

npm i silentxx-smart-toc
🐙

Open source on GitHub

AheheXx1982/silentxx-smart-toc · MIT

🧠

Five-level fallback

Headings → AI sections → pseudo-headings → paragraphs → empty

Live demo — AI-generated outline

The text below deliberately has no headings at all. The sidebar outline is clustered semantically by AI — try clicking an entry to jump, and scroll to watch the highlight follow.

📑 Table of contents
No table of contents

If you run a blog or a content site, you have probably hit this: articles migrated from a newsletter, a forum or an old CMS carry no Markdown headings at all. The old outline component sees no h2 or h3 and simply tells you “no table of contents”. In a three-thousand-word piece the reader never knows where they are.

SmartToc’s core is a five-level fallback chain: if the article has proper headings, use the heading tree; if there are no headings but build-time AI data exists, use semantic sections; if the author used plain short sentences as mini-headings, detect them as pseudo-headings; if there is nothing at all, fall back to paragraph navigation. Every level tries to give the reader the best navigation available.

For existing articles with no heading structure, the AI clusters adjacent paragraphs by meaning — paragraphs about the same thing become one chapter — and then writes a short precise title for each chapter. The outline data lives in a separate JSON file; the component only renders it into the sidebar, and not a single character of the article changes. Any LLM that can emit JSON can generate that file, and it is cached once at build time.

The component is open source on GitHub under the MIT licence, published as silentxx-smart-toc. Installation is one npm command, wrap the body in an article tag, and everything else is automatic. The docs are bilingual with an architecture diagram and a FAQ — five minutes from quick start to running.

This is the first SilentXx open-source release, but it will not be the last. The options trading system, the AI automation workflows, the content production pipeline — tools that have proven themselves here will be released over time. If this component is useful to you, a star or an issue telling us your use case is very welcome.

Features

🤖

AI semantic sections

Heading-less articles get concise AI-clustered titles, written only into the outline tree, never into the article

🌲

Heading tree

Level indentation + automatic numbering (1. / 1.1 / 1.2…), expanded by default, scroll accordion tracking

✨

Pseudo-heading detection

Recognises short standalone sentences authors use as mini-headings and turns them into a clean outline

🧭

Scroll highlight + smooth jump

Highlights as you read, smooth-scrolls when you click an entry

🆔

Stable CJK anchors

Generates real anchor ids taken from the text itself (CJK included) instead of weak heading-0 ids

📦

Zero content changes

A pure client-side component; it never touches the Markdown source or the render chain

Changelog

v1.2AI semantic sections (build-time JSON data) + the tocDataUrl prop
v1.1Pseudo-heading detection (standalone sentences of 5–30 characters)
v1.0Heading tree + paragraph navigation, scroll highlight, CJK anchors