Class: JsDuck::IndexHtml
- Inherits:
-
Object
- Object
- JsDuck::IndexHtml
- Defined in:
- lib/jsduck/index_html.rb
Overview
Deals with creation of main HTML or PHP files.
Instance Method Summary collapse
-
#initialize(assets, opts) ⇒ IndexHtml
constructor
A new instance of IndexHtml.
-
#write ⇒ Object
In normal mode creates index.html.
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
#write ⇒ Object
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 |