Conversation
…nd copy functionality for markdown.
…and add new code block examples for Bash, PowerShell, and Bicep.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Introduces a reusable CodeBlock component and wires it into TinaMarkdown rendering so documentation code snippets get syntax highlighting and copy-to-clipboard support, plus a docs-only verification page and a small docs layout tweak.
Changes:
- Added
components/shared/CodeBlock.tsxand integrated it intotina/tinamarkdownStyles/DocAndBlogMarkdownStyle.tsxfor rendering fenced code blocks. - Added
react-syntax-highlighter(and types) dependencies and a/docs/test-code-blockMDX page for manual verification. - Updated docs layout grid sidebar widths and applied a minor MDX formatting cleanup.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/cn.ts | New cn helper added (duplicates existing helper). |
| tina/tinamarkdownStyles/DocAndBlogMarkdownStyle.tsx | Routes TinaMarkdown code blocks to the new CodeBlock renderer. |
| components/shared/CodeBlock.tsx | New client component for highlighted code + copy button. |
| content/docs/EagleEye/test-code-block.mdx | Adds a documentation page to visually test code blocks. |
| content/docs/EagleEye/prerequisites.mdx | Minor formatting cleanup. |
| app/[product]/docs/layout.tsx | Adjusts docs grid columns for fixed-width sidebar. |
| package.json | Adds syntax highlighting dependencies. |
| pnpm-lock.yaml | Lockfile updates for new dependencies. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
055f2b0 to
a30eaaa
Compare
…` to `shiki` as per tinadocs implementation
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated 10 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
content/docs/EagleEye/prerequisites.mdx:22
- Typo in the newly added code block content:
sometingshould besomething.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ut` cleanup, and conditional border, and add Shiki highlighter fallback on initialization failure.
…xt code blocks, and add explicit prop types to the skeleton component.
|
Do not merge automatically need to remove test file |
Part of #589
This PR introduces a new Code Block Component matching the implementation in , as discussed with @joshbermanssw.
It replaces the previous partial solution with a fully custom, syntax-highlighted component powered by Shiki (v3).
🚀 Key Features
// [code wikipedia_reader ++]and// [code wikipedia_reader --]// [code wikipedia_reader highlight]// [code wikipedia_reader focus]🛠️ Changes
code-block.tsx: Main client component with robust error handling and HTML sanitization.code-block-skeleton.tsx: Deterministic shimmer loader to prevent hydration mismatches.shiki-singleton.tsx: Utility to manage highlighter lifecycle and dynamic language loading.code-block.cssfor specific token styling (diffs, line numbers, scrolling).shikiand@shikijs/transformers.pnpm-lock.yamlshows bothshiki@1.x(via TinaCMS/TypeDoc) and ourshiki@3.x. This duplication is necessary for our feature requirements.🧪 Verification
test-code-block.mdx) to verify rendering across multiple languages.