Skip to content

v2.0.0

Latest

Choose a tag to compare

@stefanmaric stefanmaric released this 18 May 10:23
3b77841

Modernize the package and redesign the TOC APIs

  • Rewrite the package in TypeScript, ship ESM-only output, and replace the legacy build/test/lint/CI stack with tsdown, Vitest, oxlint/oxfmt, pnpm, and GitHub Actions.
  • Rename the DOM heading query option from selector to headings, and allow DOM inputs such as root, headings, and target to accept either CSS selectors or real DOM nodes.
  • Add domItems() and mdItems() as first-class APIs that return normalized TocItem[] data.
  • Change domList() and mdList() to render normalized TocItem[] input instead of the old tree tuple structure.
  • Simplify DOM rendering customization by supporting render on both domList() and domToc(), and remove the old class-based and anchor/id renderer hooks.
  • Keep domToc() and mdToc() as public named exports, publish explicit simpletoc, simpletoc/dom, and simpletoc/md entry points, and move tree() behind the item-based APIs.

Full Changelog: v1.0.3...v2.0.0