docs/plans/2026-05-25-unify-docs-code-block-line-numbers.md
Make Plate docs code blocks match the shadcn-style code surface by showing line numbers for multi-line source snippets.
rehype-pretty-code already supports showLineNumbers metadata and the CSS already styles [data-line-numbers].showLineNumbers, but generated/client code blocks still render without line numbers.apps/www/src/components/codeblock.tsx and InstallationCode force showLineNumbers={false}.code rendered with data-line-numbers, but lines were only class="line", while the docs CSS increments counters on [data-line].showLineNumbers metadata to multi-line MDX source blocks before rehype-pretty-code runs.showLineNumbers metadata for multi-line non-command MDX source blocks.data-line in rehype-pretty-code onVisitLine so the existing CSS counter renders.pnpm install, pnpm --filter www build:source, pnpm --filter www typecheck, and pnpm lint:fix.localhost:3001/docs/installation/react: React install code block shows line numbers 1-6; HTML contains both data-line-numbers and data-line.localhost:3001/docs/plugin-shortcuts: lines had data-line, but generated code lacked data-line-numbers, so the CSS counter never started.__showLineNumbers__ flag across rehype-pretty-code and apply data-line-numbers to each generated code element after dual-theme expansion.localhost:3001/docs/plugin-shortcuts in Browser: the MyDocumentPlugin block has data-line-numbers, 31 data-line rows, and visible line numbers.pnpm install, pnpm --filter www build:source, pnpm --filter www typecheck, pnpm lint:fix, and git diff --check.This produced reusable knowledge: showLineNumbers metadata is not sufficient unless line nodes match the local CSS selector. Updated docs/solutions/ui-bugs/2026-05-25-docs-code-block-light-theme-must-use-light-shiki-tokens.md.