diff options
author | Brandon Mathis <brandon@imathis.com> | 2011-07-26 23:36:42 -0400 |
---|---|---|
committer | Brandon Mathis <brandon@imathis.com> | 2011-07-26 23:36:42 -0400 |
commit | 7b81aab5ac225fb12a100d9eb463340f322704fd (patch) | |
tree | f46adc303a4f5b4510d8880c8d5820173c931414 /plugins/code_block.rb | |
parent | 727a1492278c5e22aa68019f14d4e60319476f74 (diff) | |
download | my_new_personal_website-7b81aab5ac225fb12a100d9eb463340f322704fd.tar.xz my_new_personal_website-7b81aab5ac225fb12a100d9eb463340f322704fd.zip |
added support for pygments.rb removing dependency on pygments, added support for caching highlighted code from pygments.rb and added default line numbering. Javascript auto line numbering now only occurs for embedded gists
Diffstat (limited to 'plugins/code_block.rb')
-rw-r--r-- | plugins/code_block.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/code_block.rb b/plugins/code_block.rb index 4cf2817b..af64e031 100644 --- a/plugins/code_block.rb +++ b/plugins/code_block.rb @@ -41,9 +41,12 @@ # <pre><code><sarcasm> Ooooh, sarcasm... How original!</sarcasm></code></pre> # </figure> # +require './plugins/pygments_code' + module Jekyll class CodeBlock < Liquid::Block + include HighlightCode CaptionUrlTitle = /(\S[\S\s]*)\s+(https?:\/\/)(\S+)\s+(.+)/i CaptionUrl = /(\S[\S\s]*)\s+(https?:\/\/)(\S+)/i Caption = /(\S[\S\s]*)/ @@ -75,7 +78,7 @@ module Jekyll if @filetype @filetype = 'objc' if @filetype == 'm' @filetype = 'perl' if @filetype == 'pl' - source += "{% highlight #{@filetype} %}\n" + code + "\n{% endhighlight %}</figure></div>" + source += " #{highlight(code, @filetype)}</figure></div>" else source += "<pre><code>" + code.lstrip.rstrip.gsub(/</,'<') + "</code></pre></figure></div>" end |