{"library":"mdast-util-toc","type":"library","category":null,"description":"mdast-util-toc is a utility within the unified (specifically mdast) ecosystem for programmatically generating a table of contents from a markdown abstract syntax tree (AST). It provides a `toc` function that processes an `mdast` tree, identifying headings and constructing a new `mdast` list node representing the table of contents. The package is currently stable at version 7.1.0, with minor and patch releases occurring periodically, and major versions introducing breaking changes like ESM-only support or Node.js version bumps. Key differentiators include its tight integration with the `mdast` AST format, allowing for flexible programmatic manipulation, and its robust options for controlling the TOC generation, such as specifying heading depth (`minDepth`, `maxDepth`), skipping specific headings, and defining parent node types. It's often used indirectly via `remark-toc` for simpler integration into `remark` pipelines, which handles the injection of the generated TOC back into the document. Its focus is purely on AST transformation, making it highly composable.","language":"javascript","status":"active","version":"7.1.0","tags":["javascript","unist","mdast","mdast-util","util","utility","markdown","table","contents","typescript"],"install":[{"cmd":"npm install mdast-util-toc","imports":["import { toc } from 'mdast-util-toc'","import type { Options, Result } from 'mdast-util-toc'","import {toc} from 'https://esm.sh/mdast-util-toc@7'"]},{"cmd":"yarn add mdast-util-toc","imports":[]},{"cmd":"pnpm add mdast-util-toc","imports":[]}],"homepage":null,"github":"https://github.com/syntax-tree/mdast-util-toc","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/mdast-util-toc","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/mdast-util-toc/compatibility"},"provenance":{"verified_status":null,"verified_at":null,"last_verified":"Wed Jun 17","next_check":"Sat Jul 18","install_tag":null}}