Skip to content

Commit

Permalink
added yml alias for yaml code highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
imathis committed Aug 1, 2011
1 parent 08dc63a commit 7b52fb4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/code_block.rb
Expand Up @@ -79,6 +79,7 @@ def render(context)
if @filetype
@filetype = 'objc' if @filetype == 'm'
@filetype = 'perl' if @filetype == 'pl'
@filetype = 'yaml' if @filetype == 'yml'
source += " #{highlight(code, @filetype)}</figure></div>"
else
source += "<pre><code>" + code.lstrip.rstrip.gsub(/</,'&lt;') + "</code></pre></figure></div>"
Expand Down
1 change: 1 addition & 0 deletions plugins/include_code.rb
Expand Up @@ -55,6 +55,7 @@ def render(context)
@filetype = file.extname.sub('.','')
@filetype = 'objc' if @filetype == 'm'
@filetype = 'perl' if @filetype == 'pl'
@filetype = 'yaml' if @filetype == 'yml'
title = @title ? "#{@title} (#{file.basename})" : file.basename
url = "#{context.registers[:site].config['url']}/#{code_dir}/#{@file}"
source = "<div><figure role=code><figcaption><span>#{title}</span> <a href='#{url}'>download</a></figcaption>\n"
Expand Down

0 comments on commit 7b52fb4

Please sign in to comment.