Pedro Duarte posts about how to highlight various blocks of code in a program:
I’ve been exploring ways to improve the user experience of code blocks.
I’ve been spending a lot of time writing documentation for the Modulz products. Specifically for Stitches and Radix. And I wanted more than just pretty colors.
This was my wishlist:
- Syntax highlight
- Apply multiple themes
- Highlight specific lines
- Highlight specific words
- Interact with the content
- Make specific words link to other pages
- Show line numbers
- Make it collapsible/expandable
- Render a preview
In this post, I’ll share with you how I built a custom code block component.
See the methodology used in the post here.