Code Highlighting

Syntax highlighting for code blocks.


Example

function Button(props) {
let { children } = props;
return <button>{children}</button>;
}

Specify a title

Use the {% title="button.tsx" %} prop to render a title.

button.tsx
function Button(props) {
let { children } = props;
return <button>{children}</button>;
}

Line highlight

To markup single lines, use the attribute {% highlight="{1,2,3,4,5}" %} or {% highlight="{1-5}" %} to highlight a range.

function Button(props) {
let { children } = props;
return <button>{children}</button>;
}