Sha256: 15197a49e7415b7a2b69537b9499e8c9dd8517da3d438b024aacf59af15e8a73

Contents?: true

Size: 558 Bytes

Versions: 5

Compression:

Stored size: 558 Bytes

Contents

# typed: false
# frozen_string_literal: true

require 'kramdown'
require 'frontman/renderers/renderer'

module Frontman
  class MarkdownRenderer < Frontman::Renderer
    def compile(layout)
      Kramdown::Document.new(
        layout,
        syntax_highlighter: 'rouge',
        parse_block_html: true,
        fenced_code_blocks: true,
        input: 'GFM',
        with_toc_data: true,
        smartypants: true,
        hard_wrap: false
      )
    end

    def render_content(compiled, _content, _scope, _data)
      compiled.to_html
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
frontman-ssg-0.1.1 lib/frontman/renderers/markdown_renderer.rb
frontman-ssg-0.1.0 lib/frontman/renderers/markdown_renderer.rb
frontman-ssg-0.0.4 lib/frontman/renderers/markdown_renderer.rb
frontman-ssg-0.0.3 lib/frontman/renderers/markdown_renderer.rb
frontman-ssg-0.0.2 lib/frontman/renderers/markdown_renderer.rb