From 17c59fb1d1bf3e0c05137af4b4bd09ae271a2d31 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Tue, 19 Jul 2011 09:06:54 -0400 Subject: Moved plugins to root directory. I'm ditching the idea of shipping plugins with themes until it's more obviously necessary. This way it's easier to merge and update plugins. --- .themes/classic/plugins/code_block.rb | 80 ----------------------------------- 1 file changed, 80 deletions(-) delete mode 100644 .themes/classic/plugins/code_block.rb (limited to '.themes/classic/plugins/code_block.rb') diff --git a/.themes/classic/plugins/code_block.rb b/.themes/classic/plugins/code_block.rb deleted file mode 100644 index 00762d8a..00000000 --- a/.themes/classic/plugins/code_block.rb +++ /dev/null @@ -1,80 +0,0 @@ -# Title: Simple Code Blocks for Jekyll -# Author: Brandon Mathis http://brandonmathis.com -# Description: Write codeblocks with semantic HTML5
and
elements and optional syntax highlighting — all with a simple, intuitive interface. -# -# Syntax: {% codeblock [title] [url] [link text] %} -# -# For syntax highlighting, put a file extension somewhere in the title. examples: -# {% codeblock file.sh %} -# {% codeblock Time to be Awesome! (awesome.rb) %} -# -# Example: -# -# {% codeblock Got pain? painreleif.sh http://site.com/painreleief.sh Download it! %} -# $ rm -rf ~/PAIN -# {% endcodeblock %} -# -# Output: -# -#
-#
Got pain? painrelief.sh Download it! -#

-# -- nicely escaped highlighted code --
-# 
-#
-# -# Example 2 (no syntax highlighting): -# -# {% codeblock %} -# Ooooh, sarcasm... How original! -# {% endcodeblock %} -# -#
-#
<sarcasm> Ooooh, sarcasm... How original!</sarcasm>
-#
-# -module Jekyll - - class CodeBlock < Liquid::Block - CaptionUrlTitle = /(\S[\S\s]*)\s+(https?:\/\/)(\S+)\s+(.+)/i - CaptionUrl = /(\S[\S\s]*)\s+(https?:\/\/)(\S+)/i - Caption = /(\S[\S\s]*)/ - def initialize(tag_name, markup, tokens) - @title = nil - @caption = nil - @highlight = true - if markup =~ CaptionUrlTitle - @file = $1 - @caption = "
#{$1}#{$4}" - elsif markup =~ CaptionUrl - @file = $1 - @caption = "
#{$1}link" - elsif markup =~ Caption - @file = $1 - @caption = "
#{$1}
\n" - end - if @file =~ /\S[\S\s]*\.(\w+)/ - @filetype = $1 - end - super - end - - def render(context) - output = super - code = super.join - source = "
\n" - source += @caption if @caption - if @filetype - source += "{% highlight #{@filetype} %}\n" + code + "\n{% endhighlight %}\n
" - else - source += "
" + code.gsub!(/
\n
" - end - partial = Liquid::Template.parse(source) - context.stack do - partial.render(context) - end - end - end -end - -Liquid::Template.register_tag('codeblock', Jekyll::CodeBlock) -- cgit v1.2.1