allow use of rdiscount if --rdiscount is set and gem is installed
This commit is contained in:
parent
b0004e803a
commit
59080271ed
|
@ -1,6 +1,7 @@
|
|||
==
|
||||
* Major Changes
|
||||
* Use Maruku (pure Ruby) for Markdown by default [github.com/mreid]
|
||||
* Allow use of RDiscount with --rdiscount flag
|
||||
* Minor Enhancements
|
||||
* Don't load directory_watcher unless it's needed [github.com/pjhyett]
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ The best way to install Jekyll is via RubyGems:
|
|||
$ sudo gem install mojombo-jekyll -s http://gems.github.com/
|
||||
|
||||
Jekyll requires the gems `directory_watcher`, `liquid`, `open4`,
|
||||
and `maruku` for markdown support. These are automatically
|
||||
and `maruku` (for markdown support). These are automatically
|
||||
installed by the gem install command.
|
||||
|
||||
Maruku comes with optional support for LaTeX to PNG rendering via
|
||||
|
@ -123,6 +123,13 @@ during the conversion:
|
|||
|
||||
$ jekyll --pygments
|
||||
|
||||
By default, Jekyll uses "Maruku":http://maruku.rubyforge.org (pure Ruby) for
|
||||
Markdown support. If you'd like to use RDiscount (faster, but requires
|
||||
compilation), you must install it (gem install rdiscount) and then you can
|
||||
have it used instead:
|
||||
|
||||
$ jekyll --rdiscount
|
||||
|
||||
h2. Data
|
||||
|
||||
Jekyll traverses your site looking for files to process. Any files with YAML
|
||||
|
|
10
bin/jekyll
10
bin/jekyll
|
@ -32,6 +32,16 @@ opts = OptionParser.new do |opts|
|
|||
opts.on("--pygments", "Use pygments to highlight code") do
|
||||
Jekyll.pygments = true
|
||||
end
|
||||
|
||||
opts.on("--rdiscount", "Use rdiscount gem for Markdown") do
|
||||
begin
|
||||
require 'rdiscount'
|
||||
Jekyll.markdown_proc = Proc.new { |x| RDiscount.new(x).to_html }
|
||||
puts 'Using rdiscount for Markdown'
|
||||
rescue LoadError
|
||||
puts 'You must have the rdiscount gem installed first'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
opts.parse!
|
||||
|
|
|
@ -44,11 +44,12 @@ module Jekyll
|
|||
VERSION = '0.2.0'
|
||||
|
||||
class << self
|
||||
attr_accessor :source, :dest, :lsi, :pygments
|
||||
attr_accessor :source, :dest, :lsi, :pygments, :markdown_proc
|
||||
end
|
||||
|
||||
Jekyll.lsi = false
|
||||
Jekyll.pygments = false
|
||||
Jekyll.markdown_proc = Proc.new { |x| Maruku.new(x).to_html }
|
||||
|
||||
def self.process(source, dest)
|
||||
require 'classifier' if Jekyll.lsi
|
||||
|
|
|
@ -30,7 +30,7 @@ module Jekyll
|
|||
self.content = RedCloth.new(self.content).to_html
|
||||
when ".markdown":
|
||||
self.ext = ".html"
|
||||
self.content = Maruku.new(self.content).to_html
|
||||
self.content = Jekyll.markdown_proc.call(self.content)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue