Sha256: 1468143cb5f78c90cd79581084f61a604a637ed313915170d68bf7087796de9c

Contents?: true

Size: 780 Bytes

Versions: 4

Compression:

Stored size: 780 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' => 'onepage')

        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

4 entries across 4 versions & 1 rubygems

Version Path
parade-0.9.0 lib/parade/commands/static_html.rb
parade-0.8.2 lib/parade/commands/static_html.rb
parade-0.8.1 lib/parade/commands/static_html.rb
parade-0.8.0 lib/parade/commands/static_html.rb