Sha256: de4b6797b345753cb023b87b8efc2cd9dbef59b4e426b64bb85c5c0f1617075a

Contents?: true

Size: 565 Bytes

Versions: 2

Compression:

Stored size: 565 Bytes

Contents

module Klipbook
  module Commands
    module Exporters
      class HTMLExporter < Exporter
        def initialize(pretty_printer=Html::Printer.new, logger=Logger.new)
          super(logger)
          @pretty_printer = pretty_printer
        end

        def render_contents(book)
          ERB.new(template, 0, '%<>').result(book.get_binding)
        end

        def extension
          "html"
        end

        def template
          @template ||= File.read(File.join(File.dirname(__FILE__), 'html_book_summary.erb'))
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
klipbook-4.0.0 lib/klipbook/commands/exporters/html_exporter.rb
klipbook-3.0.0 lib/klipbook/commands/exporters/html_exporter.rb