Skip to content

Commit

Permalink
Replaced rdiscount with Maruku for Markdown with equation support
Browse files Browse the repository at this point in the history
  • Loading branch information
mreid committed Dec 15, 2008
1 parent 0e81edd commit b094b93
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 9 deletions.
11 changes: 9 additions & 2 deletions README.textile
Expand Up @@ -80,8 +80,15 @@ 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 optionally `rdiscount` for markdown support. These are automatically
installed by the gem install.
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
"blahtex":http://gva.noekeon.org/blahtexml/ (Version 0.6) which must be in
your $PATH along with `dvips`.

(NOTE: the version of maruku I am using is `remi-maruku` on GitHub as it
does not assume a fixed location for `dvips`.)

h2. Run

Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -5,7 +5,7 @@ require 'lib/jekyll'
Hoe.new('jekyll', Jekyll::VERSION) do |p|
p.developer('Tom Preston-Werner', 'tom@mojombo.com')
p.summary = "Jekyll is a simple, blog aware, static site generator."
p.extra_deps = ['RedCloth', 'liquid', 'classifier', 'rdiscount', 'directory_watcher', 'open4']
p.extra_deps = ['RedCloth', 'liquid', 'classifier', 'maruku', 'directory_watcher', 'open4']
end

desc "Open an irb session preloaded with this library"
Expand Down
1 change: 1 addition & 0 deletions TODO
@@ -1,2 +1,3 @@
[ ] Easier configuration of Maruka and blahtex directories [mdreid]
[ ] Accurate "related posts" calculator
[ ] Autobuild
6 changes: 3 additions & 3 deletions jekyll.gemspec
Expand Up @@ -26,15 +26,15 @@ Gem::Specification.new do |s|
s.add_runtime_dependency(%q<RedCloth>, [">= 0"])
s.add_runtime_dependency(%q<liquid>, [">= 0"])
s.add_runtime_dependency(%q<classifier>, [">= 0"])
s.add_runtime_dependency(%q<rdiscount>, [">= 0"])
s.add_runtime_dependency(%q<maruku>, [">= 0"])
s.add_runtime_dependency(%q<directory_watcher>, [">= 0"])
s.add_runtime_dependency(%q<open4>, [">= 0"])
s.add_development_dependency(%q<hoe>, [">= 1.8.0"])
else
s.add_dependency(%q<RedCloth>, [">= 0"])
s.add_dependency(%q<liquid>, [">= 0"])
s.add_dependency(%q<classifier>, [">= 0"])
s.add_dependency(%q<rdiscount>, [">= 0"])
s.add_dependency(%q<maruku>, [">= 0"])
s.add_dependency(%q<directory_watcher>, [">= 0"])
s.add_dependency(%q<open4>, [">= 0"])
s.add_dependency(%q<hoe>, [">= 1.8.0"])
Expand All @@ -43,7 +43,7 @@ Gem::Specification.new do |s|
s.add_dependency(%q<RedCloth>, [">= 0"])
s.add_dependency(%q<liquid>, [">= 0"])
s.add_dependency(%q<classifier>, [">= 0"])
s.add_dependency(%q<rdiscount>, [">= 0"])
s.add_dependency(%q<maruku>, [">= 0"])
s.add_dependency(%q<directory_watcher>, [">= 0"])
s.add_dependency(%q<open4>, [">= 0"])
s.add_dependency(%q<hoe>, [">= 1.8.0"])
Expand Down
15 changes: 13 additions & 2 deletions lib/jekyll.rb
Expand Up @@ -13,9 +13,20 @@
require 'liquid'
require 'redcloth'
begin
require 'rdiscount'
require 'maruku'
require 'maruku/ext/math'
# Switch off MathML output
MaRuKu::Globals[:html_math_output_mathml] = false
MaRuKu::Globals[:html_math_engine] = 'none'

# Turn on math to PNG support with blahtex
# Resulting PNGs stored in `images/latex`
MaRuKu::Globals[:html_math_output_png] = true
MaRuKu::Globals[:html_png_engine] = 'blahtex'
MaRuKu::Globals[:html_png_dir] = 'images/latex'
MaRuKu::Globals[:html_png_url] = '/images/latex/'
rescue LoadError
puts "The rdiscount gem is required for markdown support!"
puts "The maruku gem is required for markdown support!"
end
require 'directory_watcher'

Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll/convertible.rb
Expand Up @@ -30,7 +30,7 @@ def transform
self.content = RedCloth.new(self.content).to_html
when ".markdown":
self.ext = ".html"
self.content = RDiscount.new(self.content).to_html
self.content = Maruku.new(self.content).to_html
end
end

Expand Down

0 comments on commit b094b93

Please sign in to comment.