Sha256: a9e88b0c28040cb23fa671619580e66b6dc418187b3558ebcbf21255799c82c0

Contents?: true

Size: 561 Bytes

Versions: 11

Compression:

Stored size: 561 Bytes

Contents

require 'jsduck/util/null_object'
require 'jsduck/util/io'

module JsDuck

  class Welcome
    # Creates Welcome object from filename.
    def self.create(filename)
      if filename
        Welcome.new(filename)
      else
        Util::NullObject.new(:to_html => "")
      end
    end

    # Parses welcome HTML file with content for welcome page.
    def initialize(filename)
      @html = Util::IO.read(filename)
    end

    # Returns the HTML
    def to_html(style="")
      "<div id='welcome-content' style='#{style}'>#{@html}</div>"
    end

  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
jsduck-4.6.0 lib/jsduck/welcome.rb
jsduck-4.5.1 lib/jsduck/welcome.rb
jsduck-4.5.0 lib/jsduck/welcome.rb
jsduck-4.4.1 lib/jsduck/welcome.rb
jsduck-4.4.0 lib/jsduck/welcome.rb
jsduck-4.3.2 lib/jsduck/welcome.rb
jsduck-4.3.1 lib/jsduck/welcome.rb
jsduck-4.3.0 lib/jsduck/welcome.rb
jsduck-4.2.1 lib/jsduck/welcome.rb
jsduck-4.2.0 lib/jsduck/welcome.rb
jsduck-4.1.1 lib/jsduck/welcome.rb