From d1cd52c7bed098a620e8a70f3b03ee50b7d3740a Mon Sep 17 00:00:00 2001 From: Barry Clark Date: Tue, 18 Feb 2014 20:26:49 -0500 Subject: Syntax highlighting. --- _posts/2014-2-2-Markdown-Cheatsheet.md | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to '_posts/2014-2-2-Markdown-Cheatsheet.md') diff --git a/_posts/2014-2-2-Markdown-Cheatsheet.md b/_posts/2014-2-2-Markdown-Cheatsheet.md index 59c70ef..cf23b79 100644 --- a/_posts/2014-2-2-Markdown-Cheatsheet.md +++ b/_posts/2014-2-2-Markdown-Cheatsheet.md @@ -22,7 +22,7 @@ An image, located within /images - alternative syntax 1 + alternative syntax 2 - an indented list item - + 1. An 2. ordered 3. list @@ -36,20 +36,21 @@ Inline markup styles: > Blockquote >> Nested Blockquote -Code: - - // Code is just text indented a bit - which(is_easy) to_remember(); - -~~~ - -// Markdown extra adds un-indented code blocks too - -if (this_is_more_code == true && !indented) { - // tild wrapped code blocks, also not indented -} +Syntax highlighting can be used by wrapping your code in a liquid tag like so: + +{{ "{% highlight javascript " }}%} +/* Some pointless Javascript */ +var rawr = ["r", "a", "w", "r"]; +{{ "{% endhighlight " }}%} + +creates... + +{% highlight javascript %} -~~~ +/* Some pointless Javascript */ +var rawr = ["r", "a", "w", "r"]; + +{% endhighlight %} Use two trailing spaces on the right -- cgit v1.2.3