# jonschlinkert/markdown-toc

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/jonschlinkert-markdown-toc).**

1,752 stars · 711 forks · JavaScript · MIT

## Links

- GitHub: https://github.com/jonschlinkert/markdown-toc
- Homepage: https://github.com/jonschlinkert
- awesome-repositories: https://awesome-repositories.com/repository/jonschlinkert-markdown-toc.md

## Topics

`javascript` `jonschlinkert` `markdown` `markdown-toc` `md` `navigation` `node` `nodejs` `project` `readme` `remarkable` `table-of-contents` `toc` `toc-generator`

## Description

Markdown-toc is a utility for generating and maintaining tables of contents within markdown files. It functions as both a command-line interface and a programmatic library, enabling the automated creation of structured navigation links based on the heading hierarchy of a document.

The tool distinguishes itself through its marker-based injection system, which allows for the precise placement and updating of navigation blocks within existing files. It includes a dedicated transformation pipeline for slugifying heading text into URL-friendly identifiers, ensuring that generated links remain consistent and functional as documentation evolves.

Beyond basic generation, the project provides a suite of parsing utilities that extract heading metadata and hierarchy levels. These features support custom documentation workflows, including the ability to filter content, apply depth constraints, and integrate with various markdown rendering engines to facilitate automated documentation maintenance.

## Tags

### Web Development

- [Table of Contents Generators](https://awesome-repositories.com/f/web-development/table-of-contents-generators.md) — Generates and injects structured table of contents navigation links based on document heading hierarchy.
- [Marker-Based Injection Utilities](https://awesome-repositories.com/f/web-development/content-insertion-utilities/dynamic-content-insertion/marker-based-injection-utilities.md) — Uses marker-based injection to precisely place and update generated content blocks within existing markdown files.

### Development Tools & Productivity

- [Document Parsing CLI Tools](https://awesome-repositories.com/f/development-tools-productivity/document-parsing-cli-tools.md) — Provides a command-line interface for automating table of contents maintenance using configurable insertion markers.
- [Automatic Table of Contents](https://awesome-repositories.com/f/development-tools-productivity/documentation-navigation/document-structure-navigators/outline-management/automatic-table-of-contents.md) — Injects generated tables of contents into markdown files using comment markers to define precise insertion points. ([source](https://github.com/jonschlinkert/markdown-toc#readme))

### Part of an Awesome List

- [Slugification Tools](https://awesome-repositories.com/f/awesome-lists/devtools/slugification-tools.md) — Provides a transformation pipeline for slugifying heading text into URL-friendly identifiers for consistent link generation.
- [Utility Tools](https://awesome-repositories.com/f/awesome-lists/devtools/utility-tools.md) — Tool for generating tables of contents for Markdown files.

### Content Management & Publishing

- [Hierarchy Traversers](https://awesome-repositories.com/f/content-management-publishing/content-management-systems/content-architecture-modeling/document-models/document-sectioning/document-content-structuring/flat-heading-hierarchies/heading-hierarchies/hierarchy-traversers.md) — Implements recursive traversal of heading hierarchies to calculate nesting levels for structured navigation.
- [README Section Injections](https://awesome-repositories.com/f/content-management-publishing/document-footer-injections/readme-section-injections.md) — Automates the injection and refreshing of table of contents sections within project README files.
- [Markdown Documentation](https://awesome-repositories.com/f/content-management-publishing/markdown-documentation.md) — Maintains markdown documentation by automating the creation and updating of navigation structures.
