diff options
author | Brandon Mathis <brandon@imathis.com> | 2011-09-07 18:32:57 -0500 |
---|---|---|
committer | Brandon Mathis <brandon@imathis.com> | 2011-09-07 18:34:21 -0500 |
commit | 3d2d1a8be49f3d2db16618014d38d5b93ef0c58f (patch) | |
tree | 7fd6c0d6ccdbdd0504a8ac494d39f3f91afc048a /plugins/include_code.rb | |
parent | b25db54f938899b99d360a91e228d8b43838804c (diff) | |
download | my_new_personal_website-3d2d1a8be49f3d2db16618014d38d5b93ef0c58f.tar.xz my_new_personal_website-3d2d1a8be49f3d2db16618014d38d5b93ef0c58f.zip |
1. Vastly improved backtick code blocks and added support for Textile
2. Refactored Octopress filters into Liquid filters and pre/post render filters (using post_filters plugin)
3. Added methods to raw plugin to prevent Markdown and Textile from parsing blocks
4. Updated render partial to invoke the pre_render method of post_filters
5. Moved Rubypants filter out of default.html into Octopress post_render filters
6. Added raw's safe_wrapper method to codeblock and include_code filters
Diffstat (limited to 'plugins/include_code.rb')
-rw-r--r-- | plugins/include_code.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/include_code.rb b/plugins/include_code.rb index 70d5f138..80951cb5 100644 --- a/plugins/include_code.rb +++ b/plugins/include_code.rb @@ -21,12 +21,14 @@ # require './plugins/pygments_code' +require './plugins/raw' require 'pathname' module Jekyll class IncludeCodeTag < Liquid::Tag include HighlightCode + include TemplateWrapper def initialize(tag_name, markup, tokens) @title = nil @file = nil @@ -59,8 +61,9 @@ module Jekyll @filetype = file.extname.sub('.','') if @filetype.nil? title = @title ? "#{@title} (#{file.basename})" : file.basename url = "/#{code_dir}/#{@file}" - source = "<div><figure role=code><figcaption><span>#{title}</span> <a href='#{url}'>download</a></figcaption>\n" - source += " #{highlight(code, @filetype)}</figure></div>" + source = "<figure role=code><figcaption><span>#{title}</span> <a href='#{url}'>download</a></figcaption>\n" + source += " #{highlight(code, @filetype)}</figure>" + safe_wrap(source) end end end |