Sha256: 901a82804fb122d072a392c7e9ec44081423a1e720c2749c9812a2929f06901c

Contents?: true

Size: 496 Bytes

Versions: 7

Compression:

Stored size: 496 Bytes

Contents

require 'kramdown'

module Mdoc
  class Document
    class Kramdown < Document
      def kramdown
        # TODO: toc and other preprocessors
        @kramdown = ::Kramdown::Document.new(@body) unless @kramdown
        @kramdown
      end

      def body_html
        kramdown.to_html
      end

      def body_latex
        kramdown.to_latex
      end

      alias_method :body_tex, :body_latex
      alias_method :to_latex, :body_latex
      alias_method :to_html, :body_html
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mdoc-0.0.11 lib/mdoc/document/kramdown.rb
mdoc-0.0.10 lib/mdoc/document/kramdown.rb
mdoc-0.0.9 lib/mdoc/document/kramdown.rb
mdoc-0.0.8 lib/mdoc/document/kramdown.rb
mdoc-0.0.7 lib/mdoc/document/kramdown.rb
mdoc-0.0.6 lib/mdoc/document/kramdown.rb
mdoc-0.0.5 lib/mdoc/document/kramdown.rb