Class: Verku::Exporter::HTML

Inherits:
Base
  • Object
show all
Defined in:
lib/verku/exporter/html.rb

Constant Summary

Constants inherited from Base

Base::EXTENSIONS

Instance Attribute Summary

Attributes inherited from Base

#root_dir, #source

Instance Method Summary collapse

Methods inherited from Base

#base_name, #build_data, #config, #epub_file, export!, #git_branch, #handle_error, #html_file, #initialize, #name, #output_name, #read_content, #render_template, #source_list, #spawn_command, #tex_file, #ui

Constructor Details

This class inherits a constructor from Verku::Exporter::Base

Instance Method Details

#export!Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/verku/exporter/html.rb', line 5

def export!
  locals = config.merge({ "contents" => content })
  locals['copyright'].gsub!("(C)", "©")
  output = render_template(root_dir.join("_templates/html/layout.erb"), locals)
  File.open(root_dir.join(html_file), 'w').write(output)
  true

rescue Exception => error
  handle_error(error)
  false
end