Add section about code syntax highlighting

This commit is contained in:
Maxime Vaillancourt 2021-01-25 22:13:48 -05:00
parent 73ba1d475a
commit 5d190b6a97

View File

@ -45,13 +45,6 @@ Lists work as expected:
2. List element
3. List element
So do code blocks, with full syntax highlighting:
```js
// Here's a bit of JavaScript:
console.log('hello!')
```
If you'd like to quote other people, consider using quote blocks:
> Lorem ipsum dolor sit amet
@ -60,6 +53,27 @@ And of course, images look great:
<img src="/assets/image.jpg"/>
### Code syntax highlighting
You can add code blocks with full syntax color highlighting by wrapping code snippet in triple backticks and specifying the type of the code (`js`, `rb`, `sh`, etc.):
```js
// Here's a bit of JavaScript:
console.log('hello!')
```
```rb
# And now some Ruby
def foo(bar)
"baz"
end
```
```sh
$ cat /dev/urandom | grep "the answer to life" # shell scripts look nice too
```
### Next steps
**If this template is useful to you in any way, consider [donating](https://ko-fi.com/maximevaillancourt) to support my work**. ☕