Code Blocks
Display inline code and code blocks
Basic
Inline Code
To denote a word
or phrase
as code, enclose it in backticks (`).
Code Block
Use fenced code blocks by enclosing code in three backticks and follow the leading ticks with the programming language of your snippet to get syntax highlighting. Optionally, you can also write the name of your code after the programming language. Syntax Highlighting is supported by default using Rehype Code.
Advanced
Package Install
The package install block automatically detects common package managers (npm, yarn, pnpm) and displays installation commands for each. Users can switch between different package managers using tabs.
Shiki Transformers
We support some of the Shiki Transformers, allowing you to highlight/style specific lines.
Twoslash Notations
Learn more about Twoslash notations.