Add {% highlight %} code block examples including ones with line numbering

This commit is contained in:
Michael Rose 2016-09-09 09:55:39 -04:00
parent acaf991a31
commit 40e6c933f7

View File

@ -1,6 +1,7 @@
--- ---
title: "Markup: Syntax Highlighting" title: "Markup: Syntax Highlighting"
excerpt: "Post displaying the various ways of highlighting code in Markdown." excerpt: "Post displaying the various ways of highlighting code in Markdown."
modified: 2016-09-09T09:55:10-04:00
header: header:
teaser: "markup-syntax-highlighting-teaser.jpg" teaser: "markup-syntax-highlighting-teaser.jpg"
tags: tags:
@ -24,6 +25,16 @@ GitHub Flavored Markdown [fenced code blocks](https://help.github.com/articles/c
} }
``` ```
{% highlight scss %}
.highlight {
margin: 0;
padding: 1em;
font-family: $monospace;
font-size: $type-size-7;
line-height: 1.8;
}
{% endhighlight %}
```html ```html
{% raw %}<nav class="pagination" role="navigation"> {% raw %}<nav class="pagination" role="navigation">
{% if page.previous %} {% if page.previous %}
@ -35,6 +46,17 @@ GitHub Flavored Markdown [fenced code blocks](https://help.github.com/articles/c
</nav><!-- /.pagination -->{% endraw %} </nav><!-- /.pagination -->{% endraw %}
``` ```
{% highlight html linenos %}
{% raw %}<nav class="pagination" role="navigation">
{% if page.previous %}
<a href="{{ site.url }}{{ page.previous.url }}" class="btn" title="{{ page.previous.title }}">Previous article</a>
{% endif %}
{% if page.next %}
<a href="{{ site.url }}{{ page.next.url }}" class="btn" title="{{ page.next.title }}">Next article</a>
{% endif %}
</nav><!-- /.pagination -->{% endraw %}
{% endhighlight %}
```ruby ```ruby
module Jekyll module Jekyll
class TagIndex < Page class TagIndex < Page