@@ -14,29 +14,50 @@ Syntax highlighting is a feature that displays source code, in different colors
1414
1515[ ^ 1 ] :< http://en.wikipedia.org/wiki/Syntax_highlighting >
1616
17- ###Highlighted Code Blocks
17+ ###GFM Code Blocks
1818
19- To modify styling and highlight colors edit` /_sass/_syntax .scss ` .
19+ GitHub Flavored Markdown [ fenced code blocks ] ( https://help.github.com/articles/creating-and-highlighting-code-blocks/ ) are supported. To modify styling and highlight colors edit` /_sass/syntax .scss ` .
2020
2121``` css
2222#container {
23- float :left ;
24- margin :0 -240px 0 0 ;
25- width :100% ;
23+ float :left ;
24+ margin :0 -240px 0 0 ;
25+ width :100% ;
2626}
2727```
2828
29+ {% highlight scss %}
30+ .highlight {
31+ margin: 0;
32+ padding: 1em;
33+ font-family: $monospace;
34+ font-size: $type-size-7;
35+ line-height: 1.8;
36+ }
37+ {% endhighlight %}
38+
2939``` html
3040{% raw %}<nav class =" pagination" role =" navigation" >
31- {% if page.previous %}
32- <a href =" {{ site.url }}{{ page.previous.url }}" class =" btn" title =" {{ page.previous.title }}" >Previous article</a >
33- {% endif %}
34- {% if page.next %}
35- <a href =" {{ site.url }}{{ page.next.url }}" class =" btn" title =" {{ page.next.title }}" >Next article</a >
36- {% endif %}
41+ {% if page.previous %}
42+ <a href =" {{ site.url }}{{ page.previous.url }}" class =" btn" title =" {{ page.previous.title }}" >Previous article</a >
43+ {% endif %}
44+ {% if page.next %}
45+ <a href =" {{ site.url }}{{ page.next.url }}" class =" btn" title =" {{ page.next.title }}" >Next article</a >
46+ {% endif %}
3747</nav ><!-- /.pagination--> {% endraw %}
3848```
3949
50+ {% highlight html linenos %}
51+ {% raw %}<nav class =" pagination " role =" navigation " >
52+ {% if page.previous %}
53+ <a href =" {{ site.url }}{{ page.previous.url }} " class =" btn " title =" {{ page.previous.title }} " >Previous article</a >
54+ {% endif %}
55+ {% if page.next %}
56+ <a href =" {{ site.url }}{{ page.next.url }} " class =" btn " title =" {{ page.next.title }} " >Next article</a >
57+ {% endif %}
58+ </nav ><!-- /.pagination--> {% endraw %}
59+ {% endhighlight %}
60+
4061``` ruby
4162module Jekyll
4263class TagIndex <Page
@@ -57,64 +78,25 @@ module Jekyll
5778end
5879```
5980
81+ ###Code Blocks in Lists
6082
61- ###Standard Code Block
62-
63- {% raw %}<nav class="pagination" role="navigation">
64- {% if page.previous %}
65- <a href="{{ site.url }}{{ page.previous.url }}" class="btn" title="{{ page.previous.title }}">Previous article</a>
66- {% endif %}
67- {% if page.next %}
68- <a href="{{ site.url }}{{ page.next.url }}" class="btn" title="{{ page.next.title }}">Next article</a>
69- {% endif %}
70- </nav><!-- /.pagination -->{% endraw %}
71-
72-
73- ###Fenced Code Blocks
83+ Indentation matters. Be sure the indent of the code block aligns with the first non-space character after the list item marker (e.g.,` 1. ` ). Usually this will mean indenting 3 spaces instead of 4.
7484
75- To modify styling and highlight colors edit` /_sass/_coderay.scss ` . Line numbers and a few other things can be modified in` _config.yml ` . Consult[ Jekyll's documentation] ( http://jekyllrb.com/docs/configuration/ ) for more information.
76-
77- ~~~ css
78- #container {
79- float :left ;
80- margin :0 -240px 0 0 ;
81- width :100% ;
82- }
83- ~~~
84-
85- ~~~ html
86- {% raw %}<nav class =" pagination" role =" navigation" >
87- {% if page.previous %}
88- <a href =" {{ site.url }}{{ page.previous.url }}" class =" btn" title =" {{ page.previous.title }}" >Previous article</a >
89- {% endif %}
90- {% if page.next %}
91- <a href =" {{ site.url }}{{ page.next.url }}" class =" btn" title =" {{ page.next.title }}" >Next article</a >
92- {% endif %}
93- </nav ><!-- /.pagination--> {% endraw %}
94- ~~~
95-
96- ~~~ ruby
97- module Jekyll
98- class TagIndex <Page
99- def initialize (site ,base ,dir ,tag )
100- @site = site
101- @base = base
102- @dir = dir
103- @name = ' index.html'
104- self .process(@name )
105- self .read_yaml(File .join(base,' _layouts' ),' tag_index.html' )
106- self .data[' tag' ]= tag
107- tag_title_prefix= site.config[' tag_title_prefix' ]|| ' Tagged:'
108- tag_title_suffix= site.config[' tag_title_suffix' ]|| ' –'
109- self .data[' title' ]= " #{ tag_title_prefix } #{ tag } "
110- self .data[' description' ]= " An archive of posts tagged#{ tag } ."
111- end
112- end
113- end
114- ~~~
85+ 1 . Do step 1.
86+ 2 . Now do this:
87+
88+ ``` ruby
89+ def print_hi (name )
90+ puts " Hi,#{ name } "
91+ end
92+ print_hi(' Tom' )
93+ # => prints 'Hi, Tom' to STDOUT.
94+ ```
95+
96+ 3 . Now you can do this.
11597
11698###GitHub Gist Embed
11799
118100An example of a Gist embed below.
119101
120- < script src = " https:// gist.github.com/ mmistakes/43a355923921d22cd993.js " ></ script >
102+ {% gist mmistakes/6589546 %}