Sha256: 1430d17a6bb3fbf314ad1bb409afa9c0a0001b7e30292e1eae58c95fae1694a7

Contents?: true

Size: 997 Bytes

Versions: 1

Compression:

Stored size: 997 Bytes

Contents

# encoding: UTF-8


module Spontaneous
  module Render
    class Renderer

      attr_reader :template_root

      def initialize(template_root)
        @template_root = template_root
      end

      def render_content(content, format=:html, params = {})
        # overwrite in subclasses
      end

      def template_file(filename, format)
        Render.template_file(template_root, filename, format)
      end

      def extension
        Spontaneous.template_engine.extension
      end

      protected

      def preview_renderer
        Spontaneous.template_engine.preview_renderer.new(template_root, cache?)
      end

      def publishing_renderer
        Spontaneous.template_engine.publishing_renderer.new(template_root, cache?)
      end

      def request_renderer
        Spontaneous.template_engine.request_renderer.new(template_root, cache?)
      end

      def cache?
        Spontaneous::Render.cache_templates?
      end
    end # Renderer
  end  # Render
end  # Spontaneous

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spontaneous-0.1.0.alpha1 lib/spontaneous/render/renderer.rb