Class: JsDuck::IndexHtml

Inherits:
Object
  • Object
show all
Defined in:
lib/jsduck/index_html.rb

Overview

Deals with creation of main HTML or PHP files.

Instance Method Summary collapse

Constructor Details

#initialize(assets, opts) ⇒ IndexHtml

Returns a new instance of IndexHtml.



9
10
11
12
# File 'lib/jsduck/index_html.rb', line 9

def initialize(assets, opts)
  @assets = assets
  @opts = opts
end

Instance Method Details

#writeObject

In normal mode creates index.html.

When –seo enabled, creates index.php, template.html and print-template.html.



17
18
19
20
21
22
23
24
25
26
# File 'lib/jsduck/index_html.rb', line 17

def write
  if @opts.seo
    FileUtils.cp(@opts.template_dir+"/index.php", @opts.output_dir+"/index.php")
    create_template_html(@opts.template_dir+"/template.html", @opts.output_dir+"/template.html")
    create_print_template_html(@opts.template_dir+"/print-template.html", @opts.output_dir+"/print-template.html")
    create_index_template_html(@opts.template_dir+"/index-template.html", @opts.output_dir+"/index-template.html")
  else
    create_template_html(@opts.template_dir+"/template.html", @opts.output_dir+"/index.html")
  end
end