Class: HtmlBuilder

Inherits:
Object
  • Object
show all
Extended by:
Logging
Includes:
File_Checking
Defined in:
lib/htmlbuilder.rb

Overview

This class writes the final slide-show

pages.

Constant Summary collapse

@@log =
init_logger
@@count_tag =
"<span id=\"lastImage\" style=\"display:none\">"
@@span_close =
"</span>"

Instance Method Summary collapse

Methods included from Logging

init_logger, log_level=, log_target=

Methods included from File_Checking

file_check, #file_check, last_mime_type, magic_check, mime_check

Constructor Details

#initialize(sourcefile, options) ⇒ HtmlBuilder

Returns a new instance of HtmlBuilder.



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/htmlbuilder.rb', line 51

def initialize(sourcefile, options)
  @log = @@log
  @log.debug(format("source: %s", sourcefile.to_s)) 
  @log.debug(format("options: %s", options.to_s)) 
  @configurator = Configurator.new(options)
  @source = sourcefile
  @target_dir = nil
  @substitutions = { 
    'title'         => @source.title,
    'javaScript'     => 'slideshow.js',
    'css'           => 'slideshow.css',
    'NoJsUrl'       => 'index.html',
    'NoJsTitle'     => trl('Back to the welcome page'), 
    'NoJsName'      => trl('welcome page'),
    'heading1'      => @source.title,
    'nullImageUrl'  => 'images/olive.png',
    'pxMedium'      => format("%spx", @configurator.scale_medium || '500'),
    'pxSmall'       => format("%spx", @configurator.scale_small || '300'), 
    'ImgReferences' => format_references
  } 
 
  @log.debug(format("substitutions are %s", @substitutions)) 
  msg = create_slideshow if @substitutions['ImgReferences']
  @log.debug(msg) if msg
end