Sha256: fb6ba484e6dae815955d2bbb60fb1201597b159a44ea5189cddeea0a5aee970a

Contents?: true

Size: 882 Bytes

Versions: 11

Compression:

Stored size: 882 Bytes

Contents

require 'tilt/template'
require 'kramdown'

module RevealCK
  module Markdown
    #
    # Public: This class allows Kramdown to hook into Tilt 2.0. See
    # https://github.com/rtomayko/tilt.
    #
    class SlideMarkdownTemplate < ::Tilt::Template
      # Must be implemented by all subclasses of Tilt::Template
      def prepare; end

      def pre_process(input)
        PreProcessor.new(input).process
      end

      def post_process(input)
        PostProcessor.new(input).process
      end

      def kramdown_options
        {
          auto_ids: false,
          input: 'GFM',
          syntax_highlighter: nil
        }
      end

      def evaluate(*)
        pre_process_result = pre_process(data)
        kramdown_result =
          Kramdown::Document.new(pre_process_result, kramdown_options).to_html
        post_process(kramdown_result)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
reveal-ck-4.0.0 lib/reveal-ck/markdown/slide_markdown_template.rb
reveal-ck-3.9.2 lib/reveal-ck/markdown/slide_markdown_template.rb
reveal-ck-3.9.1 lib/reveal-ck/markdown/slide_markdown_template.rb
reveal-ck-3.9.0 lib/reveal-ck/markdown/slide_markdown_template.rb
reveal-ck-3.8.1 lib/reveal-ck/markdown/slide_markdown_template.rb
reveal-ck-3.8.0 lib/reveal-ck/markdown/slide_markdown_template.rb
reveal-ck-3.7.0 lib/reveal-ck/markdown/slide_markdown_template.rb
reveal-ck-3.6.0 lib/reveal-ck/markdown/slide_markdown_template.rb
reveal-ck-3.5.1 lib/reveal-ck/markdown/slide_markdown_template.rb
reveal-ck-3.5.0 lib/reveal-ck/markdown/slide_markdown_template.rb
reveal-ck-3.4.0 lib/reveal-ck/markdown/slide_markdown_template.rb