Merge pull request #3237 from jekyll/enable_coderay
This commit is contained in:
commit
990a9e6e6d
|
@ -75,12 +75,12 @@ module Jekyll
|
||||||
},
|
},
|
||||||
|
|
||||||
'kramdown' => {
|
'kramdown' => {
|
||||||
'auto_ids' => true,
|
'auto_ids' => true,
|
||||||
'footnote_nr' => 1,
|
'footnote_nr' => 1,
|
||||||
'entity_output' => 'as_char',
|
'entity_output' => 'as_char',
|
||||||
'toc_levels' => '1..6',
|
'toc_levels' => '1..6',
|
||||||
'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo',
|
'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo',
|
||||||
'use_coderay' => false,
|
'enable_coderay' => false,
|
||||||
|
|
||||||
'coderay' => {
|
'coderay' => {
|
||||||
'coderay_wrap' => 'div',
|
'coderay_wrap' => 'div',
|
||||||
|
@ -254,6 +254,12 @@ module Jekyll
|
||||||
config[option].map!(&:to_s)
|
config[option].map!(&:to_s)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if (config['kramdown'] || {}).key?('use_coderay')
|
||||||
|
Jekyll::Deprecator.deprecation_message "Please change 'use_coderay'" +
|
||||||
|
" to 'enable_coderay' in your configuration file."
|
||||||
|
config['kramdown']['use_coderay'] = config['kramdown'].delete('enable_coderay')
|
||||||
|
end
|
||||||
|
|
||||||
if config.fetch('markdown', 'kramdown').to_s.downcase.eql?("maruku")
|
if config.fetch('markdown', 'kramdown').to_s.downcase.eql?("maruku")
|
||||||
Jekyll::Deprecator.deprecation_message "You're using the 'maruku' " +
|
Jekyll::Deprecator.deprecation_message "You're using the 'maruku' " +
|
||||||
"Markdown processor. Maruku support has been deprecated and will " +
|
"Markdown processor. Maruku support has been deprecated and will " +
|
||||||
|
|
|
@ -13,14 +13,14 @@ module Jekyll
|
||||||
|
|
||||||
def convert(content)
|
def convert(content)
|
||||||
# Check for use of coderay
|
# Check for use of coderay
|
||||||
if @config['kramdown']['use_coderay']
|
if @config['kramdown']['enable_coderay']
|
||||||
%w[wrap line_numbers line_numbers_start tab_width bold_every css default_lang].each do |opt|
|
%w[wrap line_numbers line_numbers_start tab_width bold_every css default_lang].each do |opt|
|
||||||
key = "coderay_#{opt}"
|
key = "coderay_#{opt}"
|
||||||
@config['kramdown'][key] = @config['kramdown']['coderay'][key] unless @config['kramdown'].key?(key)
|
@config['kramdown'][key] = @config['kramdown']['coderay'][key] unless @config['kramdown'].key?(key)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Kramdown::Document.new(content, Utils.symbolize_hash_keys(@config["kramdown"])).to_html
|
Kramdown::Document.new(content, Utils.symbolize_hash_keys(@config['kramdown'])).to_html
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -527,12 +527,12 @@ redcarpet:
|
||||||
extensions: []
|
extensions: []
|
||||||
|
|
||||||
kramdown:
|
kramdown:
|
||||||
auto_ids: true
|
auto_ids: true
|
||||||
footnote_nr: 1
|
footnote_nr: 1
|
||||||
entity_output: as_char
|
entity_output: as_char
|
||||||
toc_levels: 1..6
|
toc_levels: 1..6
|
||||||
smart_quotes: lsquo,rsquo,ldquo,rdquo
|
smart_quotes: lsquo,rsquo,ldquo,rdquo
|
||||||
use_coderay: false
|
enable_coderay: false
|
||||||
|
|
||||||
coderay:
|
coderay:
|
||||||
coderay_wrap: div
|
coderay_wrap: div
|
||||||
|
|
|
@ -14,7 +14,7 @@ class TestKramdown < Test::Unit::TestCase
|
||||||
'toc_levels' => '1..6',
|
'toc_levels' => '1..6',
|
||||||
'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo',
|
'smart_quotes' => 'lsquo,rsquo,ldquo,rdquo',
|
||||||
|
|
||||||
'use_coderay' => true,
|
'enable_coderay' => true,
|
||||||
'coderay_bold_every'=> 12,
|
'coderay_bold_every'=> 12,
|
||||||
'coderay' => {
|
'coderay' => {
|
||||||
'coderay_css' => :style,
|
'coderay_css' => :style,
|
||||||
|
|
Loading…
Reference in New Issue