Sha256: 1e1cc86c5802553ce3ad91e8ecd5c9ead459c0b9862dc3fa614096b6454d2d2c

Contents?: true

Size: 776 Bytes

Versions: 3

Compression:

Stored size: 776 Bytes

Contents

require_relative 'html_output'

module Parade
  module Commands

    #
    # Saves an html representation of the presentation to a single HTML file.
    #
    # @see HtmlOutput
    #
    class StaticHtml
      include RenderFromTemplate

      def description
        "Output into a single HTML file"
      end

      def generate(options)
        options.merge!('template' => 'print')

        html_generator = HtmlOutput.new
        html_content = html_generator.generate(options)

        output_file = options[:output] || default_html_output

        if create_file_with_contents output_file, html_content, options
          puts "Saved HTML to #{output_file}"
        end
      end

      def default_html_output
        "presentation.html"
      end

    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
parade-0.10.2 lib/parade/commands/static_html.rb
parade-0.10.1 lib/parade/commands/static_html.rb
parade-0.10.0 lib/parade/commands/static_html.rb