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.

@@ -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)
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- :patch: 5
3
- :major: 0
4
2
  :minor: 5
3
+ :patch: 6
5
4
  :build:
5
+ :major: 0
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{jekyll}
8
- s.version = "0.5.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",
@@ -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
- STDOUT.puts "Configuration from #{config_file}"
71
+ $stdout.puts "Configuration from #{config_file}"
72
72
  rescue => err
73
- STDERR.puts "WARNING: Could not read configuration. Using defaults (and options)."
74
- STDERR.puts "\t" + err.to_s
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
 
@@ -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?)(---.*?\n)/m
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" + Albino.new(code, @lang).to_s(@options) + "\n"
35
+ return "\n" + output + "\n"
35
36
  elsif context["content_type"] == "textile"
36
- return "<notextile>" + Albino.new(code, @lang).to_s(@options) + "</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
@@ -0,0 +1,5 @@
1
+ ---
2
+ title: Foo --- Bar
3
+ ---
4
+
5
+ Triple the fun!
@@ -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(STDERR).puts("WARNING: Could not read configuration. Using defaults (and options).")
12
- mock(STDERR).puts("\tNo such file or directory - #{@path}")
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(STDOUT).puts("Configuration from #{@path}")
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(STDERR).puts("WARNING: Could not read configuration. Using defaults (and options).")
25
- mock(STDERR).puts("\tInvalid configuration - #{@path}")
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
@@ -14,7 +14,7 @@ class TestGeneratedSite < Test::Unit::TestCase
14
14
  end
15
15
 
16
16
  should "ensure post count is as expected" do
17
- assert_equal 17, @site.posts.size
17
+ assert_equal 18, @site.posts.size
18
18
  end
19
19
 
20
20
  should "insert site.posts into the index" do
@@ -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 "\r\nThis is the content", @post.content
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 "\nh1. {{ page.title }}\n\nBest *post* ever", @post.content
178
+ assert_equal "h1. {{ page.title }}\n\nBest *post* ever", @post.content
167
179
  end
168
180
 
169
181
  should "transform textile" do
@@ -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.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