", markdown.convert('# Some Header #').strip
+ end
+
+ should "convert quotes to smart quotes" do
+ markdown = MarkdownConverter.new(@config)
+ assert_equal "
", @markdown.convert("# Header 1\n\n## Header 2\n\n{:toc}").strip
+ end
end
end
From 6471ebf0ef9244ea6944b2d88e5fd0ed36576e32 Mon Sep 17 00:00:00 2001
From: Michishige Kaito
Date: Tue, 1 Nov 2011 15:08:29 +0000
Subject: [PATCH 13/23] Fixed helper inclusion in redcarpet test
---
test/test_redcarpet.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/test_redcarpet.rb b/test/test_redcarpet.rb
index 1359c449..05596a92 100644
--- a/test/test_redcarpet.rb
+++ b/test/test_redcarpet.rb
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/helper'
+require 'helper'
class TestRedcarpet < Test::Unit::TestCase
context "redcarpet" do
From 8a0fbf02f5430a0ca53cf6399b6b9bfbf2e8fbc0 Mon Sep 17 00:00:00 2001
From: Tom Preston-Werner
Date: Mon, 23 Apr 2012 16:15:44 -0700
Subject: [PATCH 14/23] Cleanup for RDiscount TOC support. Closes #333.
---
History.txt | 1 +
lib/jekyll/converters/markdown.rb | 4 ++--
test/test_rdiscount.rb | 4 ++--
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/History.txt b/History.txt
index 9f6307a0..3fbe4da1 100644
--- a/History.txt
+++ b/History.txt
@@ -5,6 +5,7 @@
* Allow setting of RedCloth options (#284)
* Add post_url Liquid tag for internal post linking (#369)
* Allow multiple plugin dirs to be specified (#438)
+ * Inline TOC token support for RDiscount (#333)
* Bug Fixes
* Allow some special characters in highlight names
* URL escape category names in URL generation (#360)
diff --git a/lib/jekyll/converters/markdown.rb b/lib/jekyll/converters/markdown.rb
index 32820ef4..cb94c8d0 100644
--- a/lib/jekyll/converters/markdown.rb
+++ b/lib/jekyll/converters/markdown.rb
@@ -119,8 +119,8 @@ module Jekyll
when 'rdiscount'
rd = RDiscount.new(content, *@rdiscount_extensions)
html = rd.to_html
- if rd.generate_toc and html.include? @config['rdiscount']['toc_token']
- html.gsub! @config['rdiscount']['toc_token'], rd.toc_content
+ if rd.generate_toc and html.include?(@config['rdiscount']['toc_token'])
+ html.gsub!(@config['rdiscount']['toc_token'], rd.toc_content)
end
html
when 'maruku'
diff --git a/test/test_rdiscount.rb b/test/test_rdiscount.rb
index 2669b446..01f18eb3 100644
--- a/test/test_rdiscount.rb
+++ b/test/test_rdiscount.rb
@@ -5,8 +5,8 @@ class TestRdiscount < Test::Unit::TestCase
context "rdiscount" do
setup do
config = {
- 'rdiscount' => { 'extensions' => ['smart', 'generate_toc'], 'toc_token' => '{:toc}' },
- 'markdown' => 'rdiscount'
+ 'markdown' => 'rdiscount',
+ 'rdiscount' => { 'extensions' => ['smart', 'generate_toc'], 'toc_token' => '{:toc}' }
}
@markdown = MarkdownConverter.new config
end
From 305695398c8dae02145e76267ebb9e14ace8871a Mon Sep 17 00:00:00 2001
From: Tom Preston-Werner
Date: Mon, 23 Apr 2012 17:23:11 -0700
Subject: [PATCH 15/23] Update History.
---
History.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/History.txt b/History.txt
index 3fbe4da1..e7e832b1 100644
--- a/History.txt
+++ b/History.txt
@@ -6,6 +6,7 @@
* Add post_url Liquid tag for internal post linking (#369)
* Allow multiple plugin dirs to be specified (#438)
* Inline TOC token support for RDiscount (#333)
+ * Add the option to specify the paginated url format (#342)
* Bug Fixes
* Allow some special characters in highlight names
* URL escape category names in URL generation (#360)
From 7d88f72409dfe5d8d11f336c85e6dbea7861f416 Mon Sep 17 00:00:00 2001
From: Luca Grulla
Date: Sat, 3 Mar 2012 17:15:08 +0000
Subject: [PATCH 16/23] avoiding to call site_payload one time per each post
and page. Speed site creation up of a 20%.
---
lib/jekyll/site.rb | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb
index 9bdafa16..8d989b21 100644
--- a/lib/jekyll/site.rb
+++ b/lib/jekyll/site.rb
@@ -195,12 +195,13 @@ module Jekyll
#
# Returns nothing.
def render
+ payload = site_payload
self.posts.each do |post|
- post.render(self.layouts, site_payload)
+ post.render(self.layouts, payload)
end
self.pages.each do |page|
- page.render(self.layouts, site_payload)
+ page.render(self.layouts, payload)
end
self.categories.values.map { |ps| ps.sort! { |a, b| b <=> a } }
From df2ad2ac595d3ed5d998108cc3b55fb0eef97bf0 Mon Sep 17 00:00:00 2001
From: Tom Bell
Date: Wed, 30 May 2012 21:39:43 -0400
Subject: [PATCH 17/23] Allow a custom 'layouts' directory
* Add 'layouts' option to change the dir from '_layouts' to anything relative
to the source directory
* Add cucumber scenario for testing an alternative directory '_theme'
* Closes #563
---
features/site_configuration.feature | 21 +++++++++++++++++++++
features/step_definitions/jekyll_steps.rb | 7 +++++++
lib/jekyll.rb | 1 +
lib/jekyll/site.rb | 2 +-
4 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/features/site_configuration.feature b/features/site_configuration.feature
index 6935af3d..5a83ee80 100644
--- a/features/site_configuration.feature
+++ b/features/site_configuration.feature
@@ -143,3 +143,24 @@ Feature: Site configuration
Then the _site directory should exist
And I should see ".DS_Store" in "_site/.gitignore"
And the "_site/.htaccess" file should not exist
+
+ Scenario: Using a different layouts directory
+ Given I have a _theme directory
+ And I have a page theme that contains "Page Layout: {{ site.posts.size }} on {{ site.time | date: "%Y-%m-%d" }}"
+ And I have a post theme that contains "Post Layout: {{ content }}"
+ And I have an "index.html" page with layout "page" that contains "site index page"
+ And I have a configuration file with:
+ | key | value |
+ | time | 2010-01-01 |
+ | future | true |
+ | layouts | _theme |
+ And I have a _posts directory
+ And I have the following posts:
+ | title | date | layout | content |
+ | entry1 | 12/31/2007 | post | content for entry1. |
+ | entry2 | 01/31/2020 | post | content for entry2. |
+ When I run jekyll
+ Then the _site directory should exist
+ And I should see "Page Layout: 2 on 2010-01-01" in "_site/index.html"
+ And I should see "Post Layout:
content for entry1.
" in "_site/2007/12/31/entry1.html"
+ And I should see "Post Layout:
content for entry2.
" in "_site/2020/01/31/entry2.html"
diff --git a/features/step_definitions/jekyll_steps.rb b/features/step_definitions/jekyll_steps.rb
index 29abccec..20128964 100644
--- a/features/step_definitions/jekyll_steps.rb
+++ b/features/step_definitions/jekyll_steps.rb
@@ -39,6 +39,13 @@ Given /^I have a (.*) layout that contains "(.*)"$/ do |layout, text|
end
end
+Given /^I have a (.*) theme that contains "(.*)"$/ do |layout, text|
+ File.open(File.join('_theme', layout + '.html'), 'w') do |f|
+ f.write(text)
+ f.close
+ end
+end
+
Given /^I have an? (.*) directory$/ do |dir|
FileUtils.mkdir_p(dir)
end
diff --git a/lib/jekyll.rb b/lib/jekyll.rb
index fd455fb5..30fcdfd6 100644
--- a/lib/jekyll.rb
+++ b/lib/jekyll.rb
@@ -59,6 +59,7 @@ module Jekyll
'source' => Dir.pwd,
'destination' => File.join(Dir.pwd, '_site'),
'plugins' => File.join(Dir.pwd, '_plugins'),
+ 'layouts' => '_layouts',
'future' => true,
'lsi' => false,
diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb
index 8d989b21..19480119 100644
--- a/lib/jekyll/site.rb
+++ b/lib/jekyll/site.rb
@@ -106,7 +106,7 @@ module Jekyll
#
# Returns nothing.
def read_layouts(dir = '')
- base = File.join(self.source, dir, "_layouts")
+ base = File.join(self.source, dir, self.config['layouts'])
return unless File.exists?(base)
entries = []
Dir.chdir(base) { entries = filter_entries(Dir['*.*']) }
From c71d7d529006920450ac3c6869925278bddcd353 Mon Sep 17 00:00:00 2001
From: Tom Bell
Date: Thu, 31 May 2012 14:48:44 -0400
Subject: [PATCH 18/23] Add travis-ci configuration file
* Tests against: 1.9.3, 1.9.2, 1.8.7, rbx-18mode
* Fixes #387
---
.travis.yml | 8 ++++++++
1 file changed, 8 insertions(+)
create mode 100644 .travis.yml
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000..39412f0e
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,8 @@
+before_script:
+ - "sudo pip install pygments"
+rvm:
+ - 1.9.3
+ - 1.9.2
+ - 1.8.7
+ - rbx-18mode
+ # - rbx-19mode # liquid seems to fail on 1.9 mode
From b2a1d61c0407d6612450fe7d90a9a1a397aaa28e Mon Sep 17 00:00:00 2001
From: Tom Bell
Date: Thu, 31 May 2012 15:51:34 -0400
Subject: [PATCH 19/23] Swap out albino for pygments.rb
---
jekyll.gemspec | 2 +-
lib/jekyll.rb | 2 +-
lib/jekyll/tags/highlight.rb | 8 +++++++-
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/jekyll.gemspec b/jekyll.gemspec
index 88655609..55201ae8 100644
--- a/jekyll.gemspec
+++ b/jekyll.gemspec
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency('directory_watcher', "~> 1.1")
s.add_runtime_dependency('maruku', "~> 0.5")
s.add_runtime_dependency('kramdown', "~> 0.13.4")
- s.add_runtime_dependency('albino', "~> 1.3")
+ s.add_runtime_dependency('pygments.rb', "~> 0.2.12")
s.add_development_dependency('rake', "~> 0.9")
s.add_development_dependency('rdoc', "~> 3.11")
diff --git a/lib/jekyll.rb b/lib/jekyll.rb
index fd455fb5..30da18a7 100644
--- a/lib/jekyll.rb
+++ b/lib/jekyll.rb
@@ -24,7 +24,7 @@ require 'English'
# 3rd party
require 'liquid'
require 'maruku'
-require 'albino'
+require 'pygments'
# internal requires
require 'jekyll/core_ext'
diff --git a/lib/jekyll/tags/highlight.rb b/lib/jekyll/tags/highlight.rb
index ed3a0f70..9ad69b3e 100644
--- a/lib/jekyll/tags/highlight.rb
+++ b/lib/jekyll/tags/highlight.rb
@@ -48,7 +48,13 @@ module Jekyll
end
def render_pygments(context, code)
- output = add_code_tags(Albino.new(code, @lang).to_s(@options), @lang)
+ @options[:encoding] = 'utf-8'
+
+ output = add_code_tags(
+ Pygments.highlight(code, :lexer => @lang, :options => @options),
+ @lang
+ )
+
output = context["pygments_prefix"] + output if context["pygments_prefix"]
output = output + context["pygments_suffix"] if context["pygments_suffix"]
output
From 58654176de6e1dfaa845cf08d1a096442338a9d7 Mon Sep 17 00:00:00 2001
From: Tom Bell
Date: Thu, 31 May 2012 16:06:49 -0400
Subject: [PATCH 20/23] No longer need pygments locally
---
Rakefile | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/Rakefile b/Rakefile
index a1f4b161..8eb1360d 100644
--- a/Rakefile
+++ b/Rakefile
@@ -50,10 +50,6 @@ task :default => [:test, :features]
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
- if `which pygmentize` == ''
- puts "You must have Pygments installed to run the tests."
- exit 1
- end
test.libs << 'lib' << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
@@ -163,4 +159,4 @@ task :gemspec do
spec = [head, manifest, tail].join(" # = MANIFEST =\n")
File.open(gemspec_file, 'w') { |io| io.write(spec) }
puts "Updated #{gemspec_file}"
-end
\ No newline at end of file
+end
From 0e9e7fbc85d29ddc8e85960f177b3926de87f7e9 Mon Sep 17 00:00:00 2001
From: Tom Preston-Werner
Date: Mon, 23 Apr 2012 18:23:42 -0700
Subject: [PATCH 21/23] Simplify Site#read_layouts.
---
lib/jekyll/site.rb | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb
index 8d989b21..799dcc2e 100644
--- a/lib/jekyll/site.rb
+++ b/lib/jekyll/site.rb
@@ -101,12 +101,12 @@ module Jekyll
self.read_directories
end
- # Read all the files in //_layouts and create a new Layout
- # object with each one.
+ # Read all the files in /_layouts and create a new Layout object
+ # with each one.
#
# Returns nothing.
- def read_layouts(dir = '')
- base = File.join(self.source, dir, "_layouts")
+ def read_layouts
+ base = File.join(self.source, "_layouts")
return unless File.exists?(base)
entries = []
Dir.chdir(base) { entries = filter_entries(Dir['*.*']) }
From 47090ffd2a0a4e35c6e2294b6a7a4f4899beec18 Mon Sep 17 00:00:00 2001
From: Tom Preston-Werner
Date: Wed, 6 Jun 2012 11:59:37 -0700
Subject: [PATCH 22/23] Fix up a few TomDocs.
---
lib/jekyll/site.rb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb
index 799dcc2e..bd16a257 100644
--- a/lib/jekyll/site.rb
+++ b/lib/jekyll/site.rb
@@ -121,7 +121,7 @@ module Jekyll
# that will become part of the site according to the rules in
# filter_entries.
#
- # dir - The String relative path of the directory to read.
+ # dir - The String relative path of the directory to read. Default: ''.
#
# Returns nothing.
def read_directories(dir = '')
@@ -257,7 +257,7 @@ module Jekyll
end
end
- # Constructs a Hash of Posts indexed by the specified Post attribute.
+ # Construct a Hash of Posts indexed by the specified Post attribute.
#
# post_attr - The String name of the Post attribute.
#
@@ -307,7 +307,7 @@ module Jekyll
# or are excluded in the site configuration, unless they are web server
# files such as '.htaccess'.
#
- # entries - The Array of file/directory entries to filter.
+ # entries - The Array of String file/directory entries to filter.
#
# Returns the Array of filtered entries.
def filter_entries(entries)
From 49a4be44cd117eff99a78047c6d4bdf379d3463d Mon Sep 17 00:00:00 2001
From: Tom Bell
Date: Tue, 12 Jun 2012 00:35:21 +0100
Subject: [PATCH 23/23] Update travis-ci configuration file
---
.travis.yml | 4 ----
1 file changed, 4 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 39412f0e..416e8f3a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,8 +1,4 @@
-before_script:
- - "sudo pip install pygments"
rvm:
- 1.9.3
- 1.9.2
- 1.8.7
- - rbx-18mode
- # - rbx-19mode # liquid seems to fail on 1.9 mode