Sha256: c9141a47a44c7142de992a2012868db05af6b1ad8437ff9950444300157f8c0a

Contents?: true

Size: 945 Bytes

Versions: 11

Compression:

Stored size: 945 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] = @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

11 entries across 11 versions & 2 rubygems

Version Path
jekyll-1.5.1 lib/jekyll/converters/markdown/kramdown_parser.rb
jekyll-1.5.0 lib/jekyll/converters/markdown/kramdown_parser.rb
jekyll-2.0.0.alpha.1 lib/jekyll/converters/markdown/kramdown_parser.rb
jekyll-1.4.3 lib/jekyll/converters/markdown/kramdown_parser.rb
jekyll-1.4.2 lib/jekyll/converters/markdown/kramdown_parser.rb
jekyll-1.4.1 lib/jekyll/converters/markdown/kramdown_parser.rb
jekyll-1.4.0 lib/jekyll/converters/markdown/kramdown_parser.rb
jekyll-1.3.1 lib/jekyll/converters/markdown/kramdown_parser.rb
jekyll-1.3.0 lib/jekyll/converters/markdown/kramdown_parser.rb
jekyll-1.3.0.rc lib/jekyll/converters/markdown/kramdown_parser.rb
monad-0.0.3 lib/jekyll/converters/markdown/kramdown_parser.rb