-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support code highlighting #2
base: main
Are you sure you want to change the base?
Support code highlighting #2
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@rickyzhangca can you provide a better test plan? What's the syntax? |
This reverts commit 40598cf.
@rickyzhangca how would this work with our current code block component? |
it's plug-and-play, just two things to do!
but testing in client locally with npm link is kinda hard, i tried both npm link and yarn link and had no luck (likely because both package stat with
|
…ting-on-code-blocks
Feature
specify the language for the snippet and highlight lines, see examples below (using screenshots because github can't escape ```)
Syntax
after specifying the language, specify one or multiple line ranges to highlight, surrounded by {}, it can be
{integer}
,{integer-integer}
, or combined like{integer-integer, integer}
Examples
highlight one line
highlight multiple lines with
highlight line range with
combine them with
Note
Test plan
see the deployment below to preview it, or to test locally,
yarn
cd examples
cd pages-router
orcd app-router
yarn add file:../../
yarn dev
examples/pages-router/examples/highlight.mdx
orexamples/app-router/examples/highlight.mdx
and restart the page to see changes