Sha256: a145d4e0d7be80ddb42653631a13ee600eb4fcd8450de4a36105a394c3d596a7

Contents?: true

Size: 656 Bytes

Versions: 19

Compression:

Stored size: 656 Bytes

Contents

require 'kayessess/engine'
require 'kayessess/styleguide'
require 'to_slug'
require 'redcarpet'
require 'pygments'

module Kayessess

  # Helper class for adding Pygments syntax highlighting to Redcarpet
  class HTMLwithPygments < Redcarpet::Render::HTML
    def block_code(code, language)
      Pygments.highlight(code, :lexer => language)
    end
  end

  class << self
    def markdownerize(text)
      @redcarpet ||= Redcarpet::Markdown.new(Kayessess::HTMLwithPygments,
        :autolink => true,
        :fenced_code_blocks => true,
        :strikethrough => true,
        :footnotes => true)
      @redcarpet.render(text).html_safe
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
kayessess-0.3.0 lib/kayessess.rb
kayessess-0.2.11 lib/kayessess.rb
kayessess-0.2.10 lib/kayessess.rb
kayessess-0.2.9 lib/kayessess.rb
kayessess-0.2.8 lib/kayessess.rb
kayessess-0.2.7 lib/kayessess.rb
kayessess-0.2.5 lib/kayessess.rb
kayessess-0.2.4 lib/kayessess.rb
kayessess-0.2.3 lib/kayessess.rb
kayessess-0.2.2 lib/kayessess.rb
kayessess-0.2.1 lib/kayessess.rb
kayessess-0.2.0 lib/kayessess.rb
kayessess-0.1.6 lib/kayessess.rb
kayessess-0.1.5 lib/kayessess.rb
kayessess-0.1.4 lib/kayessess.rb
kayessess-0.1.3 lib/kayessess.rb
kayessess-0.1.2 lib/kayessess.rb
kayessess-0.1.1 lib/kayessess.rb
kayessess-0.1.0 lib/kayessess.rb