jekylltask 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/jekylltask.gemspec +1 -1
- data/lib/jekylltask.rb +0 -45
- metadata +3 -3
data/jekylltask.gemspec
CHANGED
data/lib/jekylltask.rb
CHANGED
@@ -71,48 +71,3 @@ class JekyllTask < Rake::TaskLib
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
-
|
75
|
-
module TocFilter
|
76
|
-
def toc(input)
|
77
|
-
input.scan(/<(h2)(?:>|\s+(.*?)>)([^<]*)<\/\1\s*>/mi).inject(%{<ol class="toc">}) { |toc, entry|
|
78
|
-
id = entry[1][/^id=(['"])(.*)\1$/, 2]
|
79
|
-
title = entry[2].gsub(/<(\w*).*?>(.*?)<\/\1\s*>/m, '\2').strip
|
80
|
-
toc << %{<li><a href="##{id}">#{title}</a></li>}
|
81
|
-
} << "</ol>"
|
82
|
-
end
|
83
|
-
end
|
84
|
-
Liquid::Template.register_filter(TocFilter)
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
# Under Ruby 1.9 [a,b,c].to_s doesn't join the array first. (Jekyll 0.5.2 requires this)
|
89
|
-
module Jekyll
|
90
|
-
class HighlightBlock < Liquid::Block
|
91
|
-
def render(context)
|
92
|
-
if context.registers[:site].pygments
|
93
|
-
render_pygments(context, super.join)
|
94
|
-
else
|
95
|
-
render_codehighlighter(context, super.join)
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
|
-
# Ruby 1.9 has sane closure scoping which manages to mess Liquid filters. (Liquid 2.0.0 requires this)
|
102
|
-
module Liquid
|
103
|
-
class Variable
|
104
|
-
def render(context)
|
105
|
-
return '' if @name.nil?
|
106
|
-
@filters.inject(context[@name]) do |output, filter|
|
107
|
-
filterargs = filter[1].to_a.collect do |a|
|
108
|
-
context[a]
|
109
|
-
end
|
110
|
-
begin
|
111
|
-
context.invoke(filter[0], output, *filterargs)
|
112
|
-
rescue FilterNotFound
|
113
|
-
raise FilterNotFound, "Error - filter '#{filter[0]}' in '#{@markup.strip}' could not be found."
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
117
|
-
end
|
118
|
-
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekylltask
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 2
|
10
|
+
version: 1.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jekyll Rake Task
|