Syntax Highlighting
For general markdown support, checkout our markdown overview
Here's a list of supported languages that will be transformed by highlight.js
Bonus!
Head over to the settings page to set a custom theme
Languages #
JavaScript #
var pet = {
name: "Frida",
age: 13
}
HTML #
<!doctype html>
<html lang="en">
<head>
<title>doc GOV</title>
</head>
<body class="page">
</body>
</html>
CSS #
@media (max-width: 865px) {
/* only show nav toggles on small screens only show nav toggles on small screens */
.hamburger {
display:flex
}
}
SQL #
-- Setup CTE
WITH ActiveEmployee AS (
SELECT *
FROM Employee e
WHERE e.IsActive = TRUE
)
SELECT * FROM Employees
INI (TOML) #
CONSUMER_KEY=EFf98235jjsef
CONSUMER_SECRET=OeiL835Lu8325
YAML #
title_word: 'Careers'
title: 'Full Stack .NET Software Developer'
tags: ['post', 'workforce']
Advanced #
Diff #
You can visualize diffs by beginning each line with a minus (-
) or plus (+
) to indicate deletions or additions
- var sayHello = function(name) {
- return 'Hi, ' + name
- }
+ let sayHello = name => `Hi, ${name}`
Markup in Code Block #
If you pre-escape any HTML characters, you can pass in raw
into the fenced code block header and any markup will be preserved.
So call like this:
```html raw <a href="<mark>url</mark>"> Link </a> ```
Which will be displayed like this:
<a href="url"> Link </a>
Title in Code Block #
If you'd like to include the filename or title at the top of the codeblock, you can add it after the fenced code block header with either file=<value>
or title=<value>
like this:
Filename #
```ini file=.env TOKEN=Value ```
Which will be displayed like this:
file: .envTOKEN=Value
Title #
```js title=javascript let pet = { name: "frida", type: "cat" } let { name } = pet // destructure ```
Which will be displayed like this:
javascriptlet pet = { name: "frida", type: "cat" }
let { name } = pet // destructure