Link Search Menu Expand Document

Creating and Highlighting code

Fenced code blocks

You can create fenced code blocks by placing triple backticks \`\`\` before and after the code block. We recommend placing a blank line before and after code blocks to make the raw formatting easier to read.

```
function test() {
  console.log("notice the blank line before this function?");
}
```

Markdown Fenced Code

Syntax highlighting

You can add an optional language identifier to enable syntax highlighting in your fenced code block.

For example, to syntax highlight Ruby code:

``` js
var foo = function (bar) {
  return bar++;
};

console.log(foo(5));
```

JS Code