Sha256: 97787bcc0c737f1a55b43edd3b727e7f7c65edd0404ac974893f7d8cf0d43308

Contents?: true

Size: 662 Bytes

Versions: 2

Compression:

Stored size: 662 Bytes

Contents

require 'awestruct/handlers/base_handler'
require 'rdiscount'

module Awestruct
  module Handlers
    class MarkdownHandler < BaseHandler

      def initialize(site, delegate)
        super( site, delegate )
      end

      def simple_name
        File.basename( relative_source_path, '.md' ) 
      end

      def output_filename
        File.basename( relative_source_path, '.md' ) + '.html'
      end

      def output_extension
        '.html'
      end

      def content_syntax
        :markdown
      end

      def rendered_content(context, with_layouts=true)
        doc = RDiscount.new( raw_content )
        doc.to_html
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
awestructx-0.4.1 lib/awestruct/handlers/markdown_handler.rb
awestructx-0.4.0 lib/awestruct/handlers/markdown_handler.rb