Sha256: 12dc31efe2e8dec4b6d3396009de84d0a5d3f105a62b8436bc80757c0b38f5e9

Contents?: true

Size: 543 Bytes

Versions: 2

Compression:

Stored size: 543 Bytes

Contents

# The ActionView template handler that parses Markdown files into HTML
# using our custom Markdown handler. Also checks for YAML front matter
# and parses it out before rendering the Markdown source into HTML.
module ActiveCopy
  module Template
    def self.call template
      source = if template.respond_to? :split
        template.split("---\n")[2]
      else
        template.source.split("---\n")[2]
      end

      <<-RUBY
        markdown = ActiveCopy::Markdown.new
        markdown.render %(#{source})
      RUBY
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_copy-1.0.0 lib/active_copy/template.rb
active_copy-1.0.0.pre lib/active_copy/template.rb