nextra
nextra copied to clipboard
Rehype support highlighting with URL parameter
Hello Gentlemen,
I hope to make the Rehype Code Highlighter support highlighting codes with URL parameters like the following:
http://localhost:3007/modules/overview?filename=my-file.js{2-3}
Has this been requested and should I look for another component for this case?
Thank you!
This is tricky, first you'll have to make your site always SSR, then you need a way to dynamically render the codeblock and pass options to it.
Overall this is a very strange use case to me, may I ask why you need that?
I think the same as @shuding, don’t see much benefit of it, also your query params should contain a param or hash of which code block you wanna change in the case if there are many code blocks on the page
Hi @shuding @B2o5T
Thank you for taking the time for this inquiry!
I'm trying to connect the source links from this page:
to this code page but I'm thinking I should just link it to our Github repo:
closed as too overkill
Hi @B2o5T
Just to add for those who are using the rehype.
I've experienced performance issues when using rehype with source codes that have more than 1,000 lines. It was failing to deploy on Vercel servers.
Thank you