Created
March 20, 2013 16:05
-
-
Save didlix/5205910 to your computer and use it in GitHub Desktop.
Jekyll patched to have multimarkdown support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/jekyll.rb b/lib/jekyll.rb | |
index b0401b9..26936e6 100644 | |
--- a/lib/jekyll.rb | |
+++ b/lib/jekyll.rb | |
@@ -66,7 +66,7 @@ module Jekyll | |
'future' => true, # remove and make true just default | |
'pygments' => true, # remove and make true just default | |
- 'markdown' => 'maruku', | |
+ 'markdown' => 'multimarkdown', | |
'permalink' => 'date', | |
'baseurl' => '', | |
'include' => ['.htaccess'], | |
@@ -93,6 +93,10 @@ module Jekyll | |
'extensions' => [] | |
}, | |
+ 'multimarkdown' => { | |
+ 'extensions' => [] | |
+ }, | |
+ | |
'kramdown' => { | |
'auto_ids' => true, | |
'footnote_nr' => 1, | |
diff --git a/lib/jekyll/converters/markdown.rb b/lib/jekyll/converters/markdown.rb | |
index b345b88..9177ec9 100644 | |
--- a/lib/jekyll/converters/markdown.rb | |
+++ b/lib/jekyll/converters/markdown.rb | |
@@ -81,6 +81,15 @@ module Jekyll | |
STDERR.puts ' $ [sudo] gem install maruku' | |
raise FatalException.new("Missing dependency: maruku") | |
end | |
+ when 'multimarkdown' | |
+ begin | |
+ require 'multimarkdown' | |
+ @multimarkdown_extensions = @config['multimarkdown']['extensions'].map { |e| e.to_sym } | |
+ rescue LoadError | |
+ STDERR.puts 'You are missing a library required for Markdown. Please run:' | |
+ STDERR.puts ' $ [sudo] gem install multimarkdown' | |
+ raise FatalException.new("Missing dependency: multimarkdown") | |
+ end | |
else | |
STDERR.puts "Invalid Markdown processor: #{@config['markdown']}" | |
STDERR.puts " Valid options are [ maruku | rdiscount | kramdown ]" | |
@@ -142,6 +151,8 @@ module Jekyll | |
html | |
when 'maruku' | |
Maruku.new(content).to_html | |
+ when 'multimarkdown' | |
+ MultiMarkdown.new(content).to_html | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment