```js
// Javascript code with syntax highlighting.
var fun = function lang(l) {
dateformat.i18n = require('./lang/' + l)
return true;
}
```
{% highlight markdown %}
```js
// Javascript code with syntax highlighting.
var fun = function lang(l) {
dateformat.i18n = require('./lang/' + l)
return true;
}
```
{% endhighlight %}
---
## Code blocks with rendered examples
To demonstrate front end code, sometimes it's useful to show a rendered example of that code. After including the styles from your project that you'll need to show the rendering, you can use a `` with the `code-example` class, followed by the code block syntax. If you want to render your output with Markdown instead of HTML, use the `markdown="1"` attribute to tell Jekyll that the code you are rendering will be in Markdown format... This is about to get meta...
[Link button](http://example.com/){: .btn }
```markdown
[Link button](http://example.com/){: .btn }
```
{% highlight markdown %}
[Link button](http://example.com/){: .btn }
```markdown
[Link button](http://example.com/){: .btn }
```
{% endhighlight %}
---
## Mermaid diagram code blocks
[Mermaid](https://mermaid-js.github.io/mermaid/) allows you to add diagrams and visualizations using Markdown code blocks. You can turn on support for mermaid by adding `mermaid_enabled: true` to your \_config.yml.
The markdown for a simple flowchart example might look like the following:
{% highlight markdown %}
```mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```
{% endhighlight %}