Method: Juli::Visitor::Html#initialize

Defined in:
lib/juli/visitor/html.rb

#initialize(opts = {}) ⇒ Html

Html sepecific initialization does:

  1. create output_top.

  2. copy *.js, *.css files to output_top/

NOTE: this is executed every juli(1) run with -g html option (usually 99% is so), so be careful to avoid multiple initialization.



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/juli/visitor/html.rb', line 110

def initialize(opts={})
  super

  # files here will not be deleted even if corresponding *.txt file
  # doesn't exist.
  @exception = {
    'sitemap' + conf['ext']       => 1,
    'recent_update' + conf['ext'] => 1,
  }

  register_helper
  register_macro
  @html_line_visitor  = HtmlLine.new(self)

  if !File.directory?(conf['output_top'])
    FileUtils.mkdir_p(conf['output_top'])
  end
  copy_to_output_top('prototype.js')
  copy_to_output_top('juli.js')
  copy_to_output_top('juli.css')
end