lib/taskjuggler/HTMLDocument.rb in taskjuggler-0.1.0 vs lib/taskjuggler/HTMLDocument.rb in taskjuggler-0.1.1

- old
+ new

@@ -21,10 +21,12 @@ # upon object creation. class HTMLDocument < XMLDocument include HTMLElements + attr_reader :html + # When creating a HTMLDocument the caller can specify the type of HTML that # will be used. The constructor then generates the proper XML declaration # for it. :strict, :transitional and :frameset are supported for _docType_. def initialize(docType = :strict, &block) super(&block) @@ -45,16 +47,17 @@ end @elements << XMLBlob.new('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 ' + "#{dtdRef}//EN\" \"#{url}\">") @elements << XMLComment.new('This file has been generated by ' + "#{AppConfig.appName} v#{AppConfig.version}") - @elements << HTML.new({ 'xml:lang' => 'en', 'lang' => 'en', - 'xmlns' => 'http://www.w3.org/1999/xhtml' }) + @elements << (@html = + HTML.new({ 'xml:lang' => 'en', 'lang' => 'en', + 'xmlns' => 'http://www.w3.org/1999/xhtml' })) end # Generate the 'head' section of an HTML page. def generateHead(title, metaTags = {}) - self << HEAD.new { + @html << HEAD.new { e = [ TITLE.new { title }, META.new({ 'http-equiv' => 'Content-Type', 'content' => 'text/html; charset=utf-8' }), ]