MDX Cheatsheet

MS
Salman Alfarisi
Fullstack Engineer
Rehype Pretty Code
rehype-pretty-code
is a Rehype plugin powered by the
shiki
syntax highlighter that provides beautiful code blocks for Markdown or MDX. It works on both the server at build-time (avoiding runtime syntax highlighting) and on the client for dynamic highlighting.
Editor-Grade Highlighting
Enjoy the accuracy and granularity of VS Code's syntax highlighting engine and the popularity of its themes ecosystem — use any VS Code theme you want!
Line Numbers and Line Highlighting
You can highlight specific lines or words using [!code highlight]
, track diffs using [!code ++]
and [!code --]
, and even highlight a word using [!code word:"refs"]
- Image by Nahid Hatami