| title |
|---|
Syntax Highlighting |
This site is built on 11ty and uses @11ty/eleventy-plugin-syntaxhighlight to highlight code blocks.
Code blocks can be highlighted by passing a language to the section.
There are a lot of available languages for syntax highlighting.
Here's a link to the list on PrismJs.
Use ```js and the section will be highlighted like so.
function myFunction() {
console.log('Hello World');
console.log('Hello World');
return true;
}Use ```js/3/1-2 and the section will be highlighted.
So the first numbers in the two /, are the line adds.
The second number after the last /, are the line removes
function myFunction() {
console.log('Hello World');
console.log('Hello World');
return true;
}
Use {{% highlight js %}} and {{% endhighlight %}} and the section will be highlighted
Because this is a markdown file, I cannot show what this looks like here but on the home page is an example with highlighted a shell script.
Diff highlighting is possible with the ... bizarre / syntax but there is also a plugin that is not currently supported.