jekyll 0.5.5 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of jekyll might be problematic. Click here for more details.
- data/History.txt +8 -2
- data/README.textile +15 -8
- data/VERSION.yml +2 -2
- data/bin/jekyll +5 -1
- data/jekyll.gemspec +2 -1
- data/lib/jekyll.rb +3 -3
- data/lib/jekyll/convertible.rb +2 -2
- data/lib/jekyll/tags/highlight.rb +10 -4
- data/test/source/_posts/2010-01-08-triple-dash.markdown +5 -0
- data/test/test_configuration.rb +5 -5
- data/test/test_generated_site.rb +1 -1
- data/test/test_post.rb +14 -2
- data/test/test_tags.rb +2 -2
- metadata +2 -1
data/History.txt
CHANGED
@@ -1,8 +1,14 @@
|
|
1
|
-
==
|
1
|
+
== 0.5.6 / 2010-01-08
|
2
2
|
* Bug Fixes
|
3
3
|
* Require redcloth >= 4.2.1 in tests (#92)
|
4
|
+
* Don't break on triple dashes in yaml frontmatter (#93)
|
5
|
+
* Minor Enhancements
|
6
|
+
* Allow .mkd as markdown extension
|
7
|
+
* Use $stdout/err instead of constants (#99)
|
8
|
+
* Properly wrap code blocks (#91)
|
9
|
+
* Add javascript mime type for webrick (#98)
|
4
10
|
|
5
|
-
== 0.5.5
|
11
|
+
== 0.5.5 / 2010-01-08
|
6
12
|
* Bug Fixes
|
7
13
|
* Fix pagination % 0 bug (#78)
|
8
14
|
* Ensure all posts are processed first (#71)
|
data/README.textile
CHANGED
@@ -20,14 +20,21 @@ h2. Diving In
|
|
20
20
|
* Customize the "Permalinks":http://wiki.github.com/mojombo/jekyll/permalinks your posts are generated with
|
21
21
|
* Use the built-in "Liquid Extensions":http://wiki.github.com/mojombo/jekyll/liquid-extensions to make your life easier
|
22
22
|
|
23
|
-
h2. Dependencies
|
24
|
-
|
25
|
-
* RedCloth: Textile support
|
26
|
-
* Liquid: Templating system
|
27
|
-
* Classifier: Generating related posts
|
28
|
-
* Maruku: Default markdown engine
|
29
|
-
* Directory Watcher: Auto-regeneration of sites
|
30
|
-
* Open4: Talking to pygments for syntax highlighting
|
23
|
+
h2. Runtime Dependencies
|
24
|
+
|
25
|
+
* RedCloth: Textile support (Ruby)
|
26
|
+
* Liquid: Templating system (Ruby)
|
27
|
+
* Classifier: Generating related posts (Ruby)
|
28
|
+
* Maruku: Default markdown engine (Ruby)
|
29
|
+
* Directory Watcher: Auto-regeneration of sites (Ruby)
|
30
|
+
* Open4: Talking to pygments for syntax highlighting (Ruby)
|
31
|
+
* Pygments: Syntax highlighting (Python)
|
32
|
+
|
33
|
+
h2. Developer Dependencies
|
34
|
+
|
35
|
+
* Shoulda: Test framework (Ruby)
|
36
|
+
* RR: Mocking (Ruby)
|
37
|
+
* RedGreen: Nicer test output (Ruby)
|
31
38
|
|
32
39
|
h2. License
|
33
40
|
|
data/VERSION.yml
CHANGED
data/bin/jekyll
CHANGED
@@ -137,9 +137,13 @@ if options['server']
|
|
137
137
|
|
138
138
|
FileUtils.mkdir_p(destination)
|
139
139
|
|
140
|
+
mime_types = WEBrick::HTTPUtils::DefaultMimeTypes
|
141
|
+
mime_types.store 'js', 'application/javascript'
|
142
|
+
|
140
143
|
s = HTTPServer.new(
|
141
144
|
:Port => options['server_port'],
|
142
|
-
:DocumentRoot => destination
|
145
|
+
:DocumentRoot => destination,
|
146
|
+
:MimeTypes => mime_types
|
143
147
|
)
|
144
148
|
t = Thread.new {
|
145
149
|
s.start
|
data/jekyll.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{jekyll}
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Tom Preston-Werner"]
|
@@ -71,6 +71,7 @@ Gem::Specification.new do |s|
|
|
71
71
|
"test/source/_posts/2009-05-18-tags.textile",
|
72
72
|
"test/source/_posts/2009-06-22-empty-yaml.textile",
|
73
73
|
"test/source/_posts/2009-06-22-no-yaml.textile",
|
74
|
+
"test/source/_posts/2010-01-08-triple-dash.markdown",
|
74
75
|
"test/source/about.html",
|
75
76
|
"test/source/category/_posts/2008-9-23-categories.textile",
|
76
77
|
"test/source/contacts.html",
|
data/lib/jekyll.rb
CHANGED
@@ -68,10 +68,10 @@ module Jekyll
|
|
68
68
|
begin
|
69
69
|
config = YAML.load_file(config_file)
|
70
70
|
raise "Invalid configuration - #{config_file}" if !config.is_a?(Hash)
|
71
|
-
|
71
|
+
$stdout.puts "Configuration from #{config_file}"
|
72
72
|
rescue => err
|
73
|
-
|
74
|
-
|
73
|
+
$stderr.puts "WARNING: Could not read configuration. Using defaults (and options)."
|
74
|
+
$stderr.puts "\t" + err.to_s
|
75
75
|
config = {}
|
76
76
|
end
|
77
77
|
|
data/lib/jekyll/convertible.rb
CHANGED
@@ -18,7 +18,7 @@ module Jekyll
|
|
18
18
|
def read_yaml(base, name)
|
19
19
|
self.content = File.read(File.join(base, name))
|
20
20
|
|
21
|
-
if self.content =~ /^(---\s*\n.*?\n?)(
|
21
|
+
if self.content =~ /^(---\s*\n.*?\n?)^(---\s*$\n?)/m
|
22
22
|
self.content = self.content[($1.size + $2.size)..-1]
|
23
23
|
|
24
24
|
self.data = YAML.load($1)
|
@@ -49,7 +49,7 @@ module Jekyll
|
|
49
49
|
case self.ext[1..-1]
|
50
50
|
when /textile/i
|
51
51
|
return 'textile'
|
52
|
-
when /markdown/i, /mkdn/i, /md/i
|
52
|
+
when /markdown/i, /mkdn/i, /md/i, /mkd/i
|
53
53
|
return 'markdown'
|
54
54
|
end
|
55
55
|
return 'unknown'
|
@@ -30,12 +30,11 @@ module Jekyll
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def render_pygments(context, code)
|
33
|
+
output = add_code_tags(Albino.new(code, @lang).to_s(@options), @lang)
|
33
34
|
if context["content_type"] == "markdown"
|
34
|
-
return "\n" +
|
35
|
+
return "\n" + output + "\n"
|
35
36
|
elsif context["content_type"] == "textile"
|
36
|
-
return "<notextile>" +
|
37
|
-
else
|
38
|
-
return Albino.new(code, @lang).to_s(@options)
|
37
|
+
return "<notextile>" + output + "</notextile>"
|
39
38
|
end
|
40
39
|
end
|
41
40
|
|
@@ -49,6 +48,13 @@ module Jekyll
|
|
49
48
|
</div>
|
50
49
|
HTML
|
51
50
|
end
|
51
|
+
|
52
|
+
def add_code_tags(code, lang)
|
53
|
+
# Add nested <code> tags to code blocks
|
54
|
+
code = code.sub(/<pre>/,'<pre><code class="' + lang + '">')
|
55
|
+
code = code.sub(/<\/pre>/,"</code></pre>")
|
56
|
+
end
|
57
|
+
|
52
58
|
end
|
53
59
|
|
54
60
|
end
|
data/test/test_configuration.rb
CHANGED
@@ -8,21 +8,21 @@ class TestConfiguration < Test::Unit::TestCase
|
|
8
8
|
|
9
9
|
should "fire warning with no _config.yml" do
|
10
10
|
mock(YAML).load_file(@path) { raise "No such file or directory - #{@path}" }
|
11
|
-
mock(
|
12
|
-
mock(
|
11
|
+
mock($stderr).puts("WARNING: Could not read configuration. Using defaults (and options).")
|
12
|
+
mock($stderr).puts("\tNo such file or directory - #{@path}")
|
13
13
|
assert_equal Jekyll::DEFAULTS, Jekyll.configuration({})
|
14
14
|
end
|
15
15
|
|
16
16
|
should "load configuration as hash" do
|
17
17
|
mock(YAML).load_file(@path) { Hash.new }
|
18
|
-
mock(
|
18
|
+
mock($stdout).puts("Configuration from #{@path}")
|
19
19
|
assert_equal Jekyll::DEFAULTS, Jekyll.configuration({})
|
20
20
|
end
|
21
21
|
|
22
22
|
should "fire warning with bad config" do
|
23
23
|
mock(YAML).load_file(@path) { Array.new }
|
24
|
-
mock(
|
25
|
-
mock(
|
24
|
+
mock($stderr).puts("WARNING: Could not read configuration. Using defaults (and options).")
|
25
|
+
mock($stderr).puts("\tInvalid configuration - #{@path}")
|
26
26
|
assert_equal Jekyll::DEFAULTS, Jekyll.configuration({})
|
27
27
|
end
|
28
28
|
end
|
data/test/test_generated_site.rb
CHANGED
data/test/test_post.rb
CHANGED
@@ -77,7 +77,19 @@ class TestPost < Test::Unit::TestCase
|
|
77
77
|
@post.read_yaml(@source, @real_file)
|
78
78
|
|
79
79
|
assert_equal({"title" => "Test title", "layout" => "post", "tag" => "Ruby"}, @post.data)
|
80
|
-
assert_equal "
|
80
|
+
assert_equal "This is the content", @post.content
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
context "with embedded triple dash" do
|
85
|
+
setup do
|
86
|
+
@real_file = "2010-01-08-triple-dash.markdown"
|
87
|
+
end
|
88
|
+
should "consume the embedded dashes" do
|
89
|
+
@post.read_yaml(@source, @real_file)
|
90
|
+
|
91
|
+
assert_equal({"title" => "Foo --- Bar"}, @post.data)
|
92
|
+
assert_equal "Triple the fun!", @post.content
|
81
93
|
end
|
82
94
|
end
|
83
95
|
|
@@ -163,7 +175,7 @@ class TestPost < Test::Unit::TestCase
|
|
163
175
|
@post.read_yaml(@source, @real_file)
|
164
176
|
|
165
177
|
assert_equal({"title" => "Foo Bar", "layout" => "default"}, @post.data)
|
166
|
-
assert_equal "
|
178
|
+
assert_equal "h1. {{ page.title }}\n\nBest *post* ever", @post.content
|
167
179
|
end
|
168
180
|
|
169
181
|
should "transform textile" do
|
data/test/test_tags.rb
CHANGED
@@ -49,7 +49,7 @@ CONTENT
|
|
49
49
|
end
|
50
50
|
|
51
51
|
should "render markdown with pygments line handling" do
|
52
|
-
assert_match %{<pre>test\n</pre>}, @result
|
52
|
+
assert_match %{<pre><code class='text'>test\n</code></pre>}, @result
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
@@ -59,7 +59,7 @@ CONTENT
|
|
59
59
|
end
|
60
60
|
|
61
61
|
should "render markdown with pygments line handling" do
|
62
|
-
assert_match %{<pre>Æ\n</pre>}, @result
|
62
|
+
assert_match %{<pre><code class='text'>Æ\n</code></pre>}, @result
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Preston-Werner
|
@@ -134,6 +134,7 @@ files:
|
|
134
134
|
- test/source/_posts/2009-05-18-tags.textile
|
135
135
|
- test/source/_posts/2009-06-22-empty-yaml.textile
|
136
136
|
- test/source/_posts/2009-06-22-no-yaml.textile
|
137
|
+
- test/source/_posts/2010-01-08-triple-dash.markdown
|
137
138
|
- test/source/about.html
|
138
139
|
- test/source/category/_posts/2008-9-23-categories.textile
|
139
140
|
- test/source/contacts.html
|