gem "middleman-syntax" gem "kramdown"
“middleman-syntax” works with all major markdown parsers. I personally use kramdown. But feel free to use which ever parser you like.
Add these lines to your config.rb.
active :syntax set :markdown_enginge, kramdown set :markdown, :fenced_code_blocks => true, smartypants => true
“fenced code blocks” adds a pretty background to your code blocks so that it differs from plain text on your site.
Add this line to highlighting.css.erb.
<%= Rouge::Themes::Github.render(:scope => '.highlight') %>
“Middleman-syntax” uses the ruby library Rouge by default. Rouge can hightlight 100 different languages and supports several themes like Github, colorful, molokai, monokai and thankful_eyes. I use the theme “Github”.
#comment $i = 0 $num = 5 while $i < $num do puts("Inside the loop i = #$i" ) $i +=1 end
Put your code inside this wrapper:
~~~ruby #Your code ~~~