Skip to content

fix: compile TOCs from rendered headings and harden directive fallbacks - #373

Merged
gitfromwildan merged 1 commit into
mainfrom
fix/compiled-toc-directive-a11y-docs
Sep 7, 2026
Merged

gitfromwildan merged 1 commit into
mainfrom
fix/compiled-toc-directive-a11y-docs

Conversation

@gitfromwildan

Copy link
Copy Markdown
Member

Summary

  • Replaces regex-based TOC extraction with rehypeCollectTocs over compiled MDX output.
  • Collects final heading IDs after slugging and custom rehype transforms.
  • Preserves authored directive source for unsupported literal fallbacks.
  • Hardens Mermaid rerender chaining across rapid chart changes.
  • Adds Tabs keyboard navigation and fixes Tooltip ID linkage.
  • Stabilizes pagination layout and refreshes Mermaid pan/zoom docs.

Packages affected

  • @docubook/core: compiled TOC collection, directive source preservation
  • @docubook/flame: TOCs from serialized output, doc updates
  • @docubook/markdown: Mermaid run-chain fix, Tabs keyboard nav, Tooltip IDs
  • @docubook/ui-react: pagination shrink hardening

Files changed

  • packages/core/README.md
  • packages/core/src/extract.ts
  • packages/core/src/index.ts
  • packages/core/src/plugins/rehypeCollectTocs.ts
  • packages/core/src/plugins/remarkDirectiveToMdx.ts
  • packages/flame/.docu/node/mdx.ts
  • packages/flame/docs/components/mermaid.mdx
  • packages/flame/docs/getting-started/formatting.mdx
  • packages/markdown/src/components/MermaidMdx.tsx
  • packages/markdown/src/components/TabsMdx.tsx
  • packages/markdown/src/components/TooltipMdx.tsx
  • packages/ui-react/src/base/pagination.tsx

Tests

  • Core: 97 tests passed.
  • Flame: 483 tests passed.
  • Markdown: 114 tests passed.
  • Core and Markdown TypeScript checks passed.
  • Oxlint: 0 warnings, 0 errors.
  • git diff --cached --check: passed.

- replace regex TOC extraction with rehypeCollectTocs on compiled output
- collect final heading IDs after slugging and custom rehype transforms
- preserve authored directive source for unsupported literal fallbacks
- harden Mermaid rerender chain, add Tabs keyboard nav, fix Tooltip IDs
- stabilize pagination layout and refresh mermaid docs
@pullfrog

pullfrog Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Pullfrog  | Review this ➔

@vercel

vercel Bot commented Sep 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docu Ignored Ignored Sep 7, 2026 6:06am UTC

@gitfromwildan
gitfromwildan merged commit e418c62 into main Sep 7, 2026
13 checks passed
@gitfromwildan
gitfromwildan deleted the fix/compiled-toc-directive-a11y-docs branch September 7, 2026 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant