Merge pull request #1201 from zachgersh/all_kramdown
Supporting more kramdown options.
This commit is contained in:
commit
4ce89ac96d
|
@ -13,7 +13,7 @@ module Jekyll
|
||||||
|
|
||||||
def convert(content)
|
def convert(content)
|
||||||
# Check for use of coderay
|
# Check for use of coderay
|
||||||
kramdown_configs = if @config['kramdown']['use_coderay']
|
if @config['kramdown']['use_coderay']
|
||||||
base_kramdown_configs.merge({
|
base_kramdown_configs.merge({
|
||||||
:coderay_wrap => @config['kramdown']['coderay']['coderay_wrap'],
|
:coderay_wrap => @config['kramdown']['coderay']['coderay_wrap'],
|
||||||
:coderay_line_numbers => @config['kramdown']['coderay']['coderay_line_numbers'],
|
:coderay_line_numbers => @config['kramdown']['coderay']['coderay_line_numbers'],
|
||||||
|
@ -22,22 +22,11 @@ module Jekyll
|
||||||
:coderay_bold_every => @config['kramdown']['coderay']['coderay_bold_every'],
|
:coderay_bold_every => @config['kramdown']['coderay']['coderay_bold_every'],
|
||||||
:coderay_css => @config['kramdown']['coderay']['coderay_css']
|
:coderay_css => @config['kramdown']['coderay']['coderay_css']
|
||||||
})
|
})
|
||||||
else
|
|
||||||
# not using coderay
|
|
||||||
base_kramdown_configs
|
|
||||||
end
|
|
||||||
Kramdown::Document.new(content, kramdown_configs).to_html
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def base_kramdown_configs
|
Kramdown::Document.new(content, @config["kramdown"].symbolize_keys).to_html
|
||||||
{
|
|
||||||
:auto_ids => @config['kramdown']['auto_ids'],
|
|
||||||
:footnote_nr => @config['kramdown']['footnote_nr'],
|
|
||||||
:entity_output => @config['kramdown']['entity_output'],
|
|
||||||
:toc_levels => @config['kramdown']['toc_levels'],
|
|
||||||
:smart_quotes => @config['kramdown']['smart_quotes']
|
|
||||||
}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -41,6 +41,17 @@ class Hash
|
||||||
end
|
end
|
||||||
array || []
|
array || []
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def symbolize_keys!
|
||||||
|
keys.each do |key|
|
||||||
|
self[(key.to_sym rescue key) || key] = delete(key)
|
||||||
|
end
|
||||||
|
self
|
||||||
|
end
|
||||||
|
|
||||||
|
def symbolize_keys
|
||||||
|
dup.symbolize_keys!
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Thanks, ActiveSupport!
|
# Thanks, ActiveSupport!
|
||||||
|
|
|
@ -236,7 +236,16 @@ before your site is served.
|
||||||
|
|
||||||
Jekyll runs with the following configuration options by default. Unless
|
Jekyll runs with the following configuration options by default. Unless
|
||||||
alternative settings for these options are explicitly specified in the
|
alternative settings for these options are explicitly specified in the
|
||||||
configuration file or on the command-line, Jekyll will run using these options.
|
[[configuration]] file or on the command-line, Jekyll will run using these options.
|
||||||
|
|
||||||
|
<div class="note warning">
|
||||||
|
<h5>There are two unsupported kramdown options</h5>
|
||||||
|
<p>
|
||||||
|
Please note that both remove_block_html_tags and
|
||||||
|
remove_span_html_tags are currently unsupported in jekyll due to the
|
||||||
|
fact that they are not included within the kramdown HTML converter.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% highlight yaml %}
|
{% highlight yaml %}
|
||||||
source: .
|
source: .
|
||||||
|
|
Loading…
Reference in New Issue