Sha256: 5aee98278d4845477cb3762d9650500c64c78ada6d07e422f12a3d83f51b4e8b
Contents?: true
Size: 952 Bytes
Versions: 2
Compression:
Stored size: 952 Bytes
Contents
module Jekyll module Converters class Markdown class KramdownParser def initialize(config) require 'kramdown' @config = config rescue LoadError STDERR.puts 'You are missing a library required for Markdown. Please run:' STDERR.puts ' $ [sudo] gem install kramdown' raise FatalException.new("Missing dependency: kramdown") end def convert(content) # Check for use of coderay if @config['kramdown']['use_coderay'] %w[wrap line_numbers line_numbers_start tab_width bold_every css default_lang].each do |opt| key = "coderay_#{opt}" @config['kramdown'][key.to_sym] = @config['kramdown']['coderay'][key] unless @config['kramdown'].has_key?(key) end end Kramdown::Document.new(content, @config["kramdown"].symbolize_keys).to_html end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
jekyll-1.2.1 | lib/jekyll/converters/markdown/kramdown_parser.rb |
jekyll-1.2.0 | lib/jekyll/converters/markdown/kramdown_parser.rb |