aboutsummaryrefslogtreecommitdiff
path: root/plugins/jsfiddle.rb
diff options
context:
space:
mode:
authorZhiming Wang <zmwangx@gmail.com>2015-05-04 14:55:10 -0700
committerZhiming Wang <zmwangx@gmail.com>2015-05-04 14:55:10 -0700
commit301679861a2440a10c9eac746cec86459f445ef9 (patch)
tree5aad22ead01cf0da226623f603f33867896c0fea /plugins/jsfiddle.rb
parentd0a07c64afba47bbe8bfb56ba9893296a73fc7db (diff)
downloadmy_new_personal_website-301679861a2440a10c9eac746cec86459f445ef9.tar.xz
my_new_personal_website-301679861a2440a10c9eac746cec86459f445ef9.zip
remove all Octopress stuff
Diffstat (limited to 'plugins/jsfiddle.rb')
-rw-r--r--plugins/jsfiddle.rb40
1 files changed, 0 insertions, 40 deletions
diff --git a/plugins/jsfiddle.rb b/plugins/jsfiddle.rb
deleted file mode 100644
index 815910e2..00000000
--- a/plugins/jsfiddle.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-# Title: jsFiddle tag for Jekyll
-# Author: Brian Arnold (@brianarn)
-# Description:
-# Given a jsFiddle shortcode, outputs the jsFiddle iframe code.
-# Using 'default' will preserve defaults as specified by jsFiddle.
-#
-# Syntax: {% jsfiddle shorttag [tabs] [skin] [height] [width] %}
-#
-# Examples:
-#
-# Input: {% jsfiddle ccWP7 %}
-# Output: <iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/ccWP7/embedded/js,resources,html,css,result/light/"></iframe>
-#
-# Input: {% jsfiddle ccWP7 js,html,result %}
-# Output: <iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/ccWP7/embedded/js,html,result/light/"></iframe>
-#
-
-module Jekyll
- class JsFiddle < Liquid::Tag
- def initialize(tag_name, markup, tokens)
- if /(?<fiddle>\w+\/?\d?)(?:\s+(?<sequence>[\w,]+))?(?:\s+(?<skin>\w+))?(?:\s+(?<height>\w+))?(?:\s+(?<width>\w+))?/ =~ markup
- @fiddle = fiddle
- @sequence = (sequence unless sequence == 'default') || 'js,resources,html,css,result'
- @skin = (skin unless skin == 'default') || 'light'
- @width = width || '100%'
- @height = height || '300px'
- end
- end
-
- def render(context)
- if @fiddle
- "<iframe style=\"width: #{@width}; height: #{@height}\" frameborder=\"0\" seamless=\"seamless\" src=\"http://jsfiddle.net/#{@fiddle}/embedded/#{@sequence}/#{@skin}/\"></iframe>"
- else
- "Error processing input, expected syntax: {% jsfiddle shorttag [tabs] [skin] [height] [width] %}"
- end
- end
- end
-end
-
-Liquid::Template.register_tag('jsfiddle', Jekyll::JsFiddle)