jekyll 0.2.0 → 0.2.1

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,3 +1,10 @@
1
+ == 0.2.1 / 2008-12-15
2
+ * Major Changes
3
+ * Use Maruku (pure Ruby) for Markdown by default [github.com/mreid]
4
+ * Allow use of RDiscount with --rdiscount flag
5
+ * Minor Enhancements
6
+ * Don't load directory_watcher unless it's needed [github.com/pjhyett]
7
+
1
8
  == 0.2.0 / 2008-12-14
2
9
  * Major Changes
3
10
  * related_posts is now found in site.related_posts
@@ -17,12 +17,12 @@ lib/jekyll/site.rb
17
17
  lib/jekyll/tags/highlight.rb
18
18
  lib/jekyll/tags/include.rb
19
19
  test/helper.rb
20
- test/source/_includes/sig.textile
20
+ test/source/_includes/sig.markdown
21
21
  test/source/_layouts/default.html
22
22
  test/source/_layouts/simple.html
23
23
  test/source/_posts/2008-10-18-foo-bar.textile
24
24
  test/source/_posts/2008-11-21-complex.textile
25
- test/source/_posts/2008-12-13-include.textile
25
+ test/source/_posts/2008-12-13-include.markdown
26
26
  test/source/css/screen.css
27
27
  test/source/index.html
28
28
  test/source/posts/2008-12-03-permalinked-post.textile
@@ -79,6 +79,17 @@ The best way to install Jekyll is via RubyGems:
79
79
 
80
80
  $ sudo gem install mojombo-jekyll -s http://gems.github.com/
81
81
 
82
+ Jekyll requires the gems `directory_watcher`, `liquid`, `open4`,
83
+ and `maruku` (for markdown support). These are automatically
84
+ installed by the gem install command.
85
+
86
+ Maruku comes with optional support for LaTeX to PNG rendering via
87
+ "blahtex":http://gva.noekeon.org/blahtexml/ (Version 0.6) which must be in
88
+ your $PATH along with `dvips`.
89
+
90
+ (NOTE: the version of maruku I am using is `remi-maruku` on GitHub as it
91
+ does not assume a fixed location for `dvips`.)
92
+
82
93
  h2. Run
83
94
 
84
95
  $ cd /path/to/proto/site
@@ -112,6 +123,13 @@ during the conversion:
112
123
 
113
124
  $ jekyll --pygments
114
125
 
126
+ By default, Jekyll uses "Maruku":http://maruku.rubyforge.org (pure Ruby) for
127
+ Markdown support. If you'd like to use RDiscount (faster, but requires
128
+ compilation), you must install it (gem install rdiscount) and then you can
129
+ have it used instead:
130
+
131
+ $ jekyll --rdiscount
132
+
115
133
  h2. Data
116
134
 
117
135
  Jekyll traverses your site looking for files to process. Any files with YAML
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ require 'lib/jekyll'
5
5
  Hoe.new('jekyll', Jekyll::VERSION) do |p|
6
6
  p.developer('Tom Preston-Werner', 'tom@mojombo.com')
7
7
  p.summary = "Jekyll is a simple, blog aware, static site generator."
8
- p.extra_deps = ['RedCloth', 'liquid', 'classifier', 'rdiscount', 'directory_watcher', 'open4']
8
+ p.extra_deps = ['RedCloth', 'liquid', 'classifier', 'maruku', 'directory_watcher', 'open4']
9
9
  end
10
10
 
11
11
  desc "Open an irb session preloaded with this library"
data/bin/jekyll CHANGED
@@ -32,6 +32,16 @@ opts = OptionParser.new do |opts|
32
32
  opts.on("--pygments", "Use pygments to highlight code") do
33
33
  Jekyll.pygments = true
34
34
  end
35
+
36
+ opts.on("--rdiscount", "Use rdiscount gem for Markdown") do
37
+ begin
38
+ require 'rdiscount'
39
+ Jekyll.markdown_proc = Proc.new { |x| RDiscount.new(x).to_html }
40
+ puts 'Using rdiscount for Markdown'
41
+ rescue LoadError
42
+ puts 'You must have the rdiscount gem installed first'
43
+ end
44
+ end
35
45
  end
36
46
 
37
47
  opts.parse!
@@ -69,6 +79,8 @@ case ARGV.size
69
79
  end
70
80
 
71
81
  if options[:auto]
82
+ require 'directory_watcher'
83
+
72
84
  puts "Auto-regenerating enabled: #{source} -> #{destination}"
73
85
 
74
86
  dw = DirectoryWatcher.new(source)
@@ -1,15 +1,15 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{jekyll}
3
- s.version = "0.2.0"
3
+ s.version = "0.2.1"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Tom Preston-Werner"]
7
- s.date = %q{2008-12-14}
7
+ s.date = %q{2008-12-15}
8
8
  s.default_executable = %q{jekyll}
9
9
  s.email = ["tom@mojombo.com"]
10
10
  s.executables = ["jekyll"]
11
11
  s.extra_rdoc_files = ["History.txt", "Manifest.txt"]
12
- s.files = ["History.txt", "Manifest.txt", "README.textile", "Rakefile", "bin/jekyll", "jekyll.gemspec", "lib/jekyll.rb", "lib/jekyll/albino.rb", "lib/jekyll/converters/csv.rb", "lib/jekyll/converters/mephisto.rb", "lib/jekyll/convertible.rb", "lib/jekyll/filters.rb", "lib/jekyll/layout.rb", "lib/jekyll/page.rb", "lib/jekyll/post.rb", "lib/jekyll/site.rb", "lib/jekyll/tags/highlight.rb", "lib/jekyll/tags/include.rb", "test/helper.rb", "test/source/_includes/sig.textile", "test/source/_layouts/default.html", "test/source/_layouts/simple.html", "test/source/_posts/2008-10-18-foo-bar.textile", "test/source/_posts/2008-11-21-complex.textile", "test/source/_posts/2008-12-13-include.textile", "test/source/css/screen.css", "test/source/index.html", "test/source/posts/2008-12-03-permalinked-post.textile", "test/suite.rb", "test/test_jekyll.rb", "test/test_post.rb", "test/test_site.rb"]
12
+ s.files = ["History.txt", "Manifest.txt", "README.textile", "Rakefile", "bin/jekyll", "jekyll.gemspec", "lib/jekyll.rb", "lib/jekyll/albino.rb", "lib/jekyll/converters/csv.rb", "lib/jekyll/converters/mephisto.rb", "lib/jekyll/convertible.rb", "lib/jekyll/filters.rb", "lib/jekyll/layout.rb", "lib/jekyll/page.rb", "lib/jekyll/post.rb", "lib/jekyll/site.rb", "lib/jekyll/tags/highlight.rb", "lib/jekyll/tags/include.rb", "test/helper.rb", "test/source/_includes/sig.markdown", "test/source/_layouts/default.html", "test/source/_layouts/simple.html", "test/source/_posts/2008-10-18-foo-bar.textile", "test/source/_posts/2008-11-21-complex.textile", "test/source/_posts/2008-12-13-include.markdown", "test/source/css/screen.css", "test/source/index.html", "test/source/posts/2008-12-03-permalinked-post.textile", "test/suite.rb", "test/test_jekyll.rb", "test/test_post.rb", "test/test_site.rb"]
13
13
  s.has_rdoc = true
14
14
  s.rdoc_options = ["--main", "README.txt"]
15
15
  s.require_paths = ["lib"]
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
26
26
  s.add_runtime_dependency(%q<RedCloth>, [">= 0"])
27
27
  s.add_runtime_dependency(%q<liquid>, [">= 0"])
28
28
  s.add_runtime_dependency(%q<classifier>, [">= 0"])
29
- s.add_runtime_dependency(%q<rdiscount>, [">= 0"])
29
+ s.add_runtime_dependency(%q<maruku>, [">= 0"])
30
30
  s.add_runtime_dependency(%q<directory_watcher>, [">= 0"])
31
31
  s.add_runtime_dependency(%q<open4>, [">= 0"])
32
32
  s.add_development_dependency(%q<hoe>, [">= 1.8.0"])
@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
34
34
  s.add_dependency(%q<RedCloth>, [">= 0"])
35
35
  s.add_dependency(%q<liquid>, [">= 0"])
36
36
  s.add_dependency(%q<classifier>, [">= 0"])
37
- s.add_dependency(%q<rdiscount>, [">= 0"])
37
+ s.add_dependency(%q<maruku>, [">= 0"])
38
38
  s.add_dependency(%q<directory_watcher>, [">= 0"])
39
39
  s.add_dependency(%q<open4>, [">= 0"])
40
40
  s.add_dependency(%q<hoe>, [">= 1.8.0"])
@@ -43,7 +43,7 @@ Gem::Specification.new do |s|
43
43
  s.add_dependency(%q<RedCloth>, [">= 0"])
44
44
  s.add_dependency(%q<liquid>, [">= 0"])
45
45
  s.add_dependency(%q<classifier>, [">= 0"])
46
- s.add_dependency(%q<rdiscount>, [">= 0"])
46
+ s.add_dependency(%q<maruku>, [">= 0"])
47
47
  s.add_dependency(%q<directory_watcher>, [">= 0"])
48
48
  s.add_dependency(%q<open4>, [">= 0"])
49
49
  s.add_dependency(%q<hoe>, [">= 1.8.0"])
@@ -13,11 +13,21 @@ require 'time'
13
13
  require 'liquid'
14
14
  require 'redcloth'
15
15
  begin
16
- require 'rdiscount'
16
+ require 'maruku'
17
+ require 'maruku/ext/math'
18
+ # Switch off MathML output
19
+ MaRuKu::Globals[:html_math_output_mathml] = false
20
+ MaRuKu::Globals[:html_math_engine] = 'none'
21
+
22
+ # Turn on math to PNG support with blahtex
23
+ # Resulting PNGs stored in `images/latex`
24
+ MaRuKu::Globals[:html_math_output_png] = true
25
+ MaRuKu::Globals[:html_png_engine] = 'blahtex'
26
+ MaRuKu::Globals[:html_png_dir] = 'images/latex'
27
+ MaRuKu::Globals[:html_png_url] = '/images/latex/'
17
28
  rescue LoadError
18
- puts "The rdiscount gem is required for markdown support!"
29
+ puts "The maruku gem is required for markdown support!"
19
30
  end
20
- require 'directory_watcher'
21
31
 
22
32
  # internal requires
23
33
  require 'jekyll/site'
@@ -31,14 +41,15 @@ require 'jekyll/tags/include'
31
41
  require 'jekyll/albino'
32
42
 
33
43
  module Jekyll
34
- VERSION = '0.2.0'
44
+ VERSION = '0.2.1'
35
45
 
36
46
  class << self
37
- attr_accessor :source, :dest, :lsi, :pygments
47
+ attr_accessor :source, :dest, :lsi, :pygments, :markdown_proc
38
48
  end
39
49
 
40
50
  Jekyll.lsi = false
41
51
  Jekyll.pygments = false
52
+ Jekyll.markdown_proc = Proc.new { |x| Maruku.new(x).to_html }
42
53
 
43
54
  def self.process(source, dest)
44
55
  require 'classifier' if Jekyll.lsi
@@ -30,7 +30,7 @@ module Jekyll
30
30
  self.content = RedCloth.new(self.content).to_html
31
31
  when ".markdown":
32
32
  self.ext = ".html"
33
- self.content = RDiscount.new(self.content).to_html
33
+ self.content = Jekyll.markdown_proc.call(self.content)
34
34
  end
35
35
  end
36
36
 
@@ -0,0 +1,8 @@
1
+ ---
2
+ layout: default
3
+ title: Include
4
+ ---
5
+
6
+ {% include sig.markdown %}
7
+
8
+ This _is_ cool
@@ -86,10 +86,10 @@ class TestPost < Test::Unit::TestCase
86
86
 
87
87
  def test_include
88
88
  Jekyll.source = File.join(File.dirname(__FILE__), *%w[source])
89
- p = Post.new(File.join(File.dirname(__FILE__), *%w[source _posts]), "2008-12-13-include.textile")
89
+ p = Post.new(File.join(File.dirname(__FILE__), *%w[source _posts]), "2008-12-13-include.markdown")
90
90
  layouts = {"default" => Layout.new(File.join(File.dirname(__FILE__), *%w[source _layouts]), "simple.html")}
91
91
  p.add_layout(layouts, {"site" => {"posts" => []}})
92
92
 
93
- assert_equal "<<< <p>&#8212;<br />\nTom Preston-Werner<br />\ngithub.com/mojombo</p> >>>", p.output
93
+ assert_equal "<<< <hr />\n<p>Tom Preston-Werner github.com/mojombo</p>\n\n<p>This <em>is</em> cool</p> >>>", p.output
94
94
  end
95
95
  end
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.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-12-14 00:00:00 -08:00
12
+ date: 2008-12-15 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: "0"
44
44
  version:
45
45
  - !ruby/object:Gem::Dependency
46
- name: rdiscount
46
+ name: maruku
47
47
  type: :runtime
48
48
  version_requirement:
49
49
  version_requirements: !ruby/object:Gem::Requirement
@@ -112,12 +112,12 @@ files:
112
112
  - lib/jekyll/tags/highlight.rb
113
113
  - lib/jekyll/tags/include.rb
114
114
  - test/helper.rb
115
- - test/source/_includes/sig.textile
115
+ - test/source/_includes/sig.markdown
116
116
  - test/source/_layouts/default.html
117
117
  - test/source/_layouts/simple.html
118
118
  - test/source/_posts/2008-10-18-foo-bar.textile
119
119
  - test/source/_posts/2008-11-21-complex.textile
120
- - test/source/_posts/2008-12-13-include.textile
120
+ - test/source/_posts/2008-12-13-include.markdown
121
121
  - test/source/css/screen.css
122
122
  - test/source/index.html
123
123
  - test/source/posts/2008-12-03-permalinked-post.textile
@@ -1,6 +0,0 @@
1
- ---
2
- layout: default
3
- title: Include
4
- ---
5
-
6
- {% include sig.textile %}