Sha256: de97273bd9a7de986cee593cb4deeccc028eca4798beabfe3d6037b402f6feeb

Contents?: true

Size: 1.74 KB

Versions: 16

Compression:

Stored size: 1.74 KB

Contents

# HTML writer

# History:
# 	Stan Smith 2015-03-23 original script
#   Stan Smith 2015-04-07 replaced instruct! with declare! and html to
#      ... conform with w3 html encoding declarations
#   Stan Smith 2015-06-23 replace global ($response) with passed in object (responseObj)
#   Stan Smith 2015-07-16 refactored to remove global namespace $HtmlNS

require_relative 'sections/html_head'
require_relative 'sections/html_body'

module ADIWG
    module Mdtranslator
        module Writers
            module Html

                class MdHtmlWriter
                    def initialize(html,intObj, paramsObj)
                        @html = html
                        @@intObj = intObj
                        @paramsObj = paramsObj
                    end

                    def writeHtml()

                        # classes used
                        htmlHead = MdHtmlHead.new(@html, @paramsObj)
                        htmlBody = MdHtmlBody.new(@html)

                        # page
                        metadata = @html.declare! :DOCTYPE, :html
                        @html.html(:lang=>'en') do
                            # head
                            htmlHead.writeHtml()

                            # body
                            htmlBody.writeHtml(@@intObj)
                        end

                        return metadata

                    end

                    def self.getContact(contactId)
                        @@intObj[:contacts].each do |hCont|
                            if hCont[:contactId] == contactId
                                return hCont
                            end
                        end
                        return nil
                    end

                end

            end
        end
    end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
adiwg-mdtranslator-1.4.0 lib/adiwg/mdtranslator/writers/html/md_html_writer.rb
adiwg-mdtranslator-1.4.0.beta14 lib/adiwg/mdtranslator/writers/html/md_html_writer.rb
adiwg-mdtranslator-1.4.0.beta13 lib/adiwg/mdtranslator/writers/html/md_html_writer.rb
adiwg-mdtranslator-1.4.0.beta12 lib/adiwg/mdtranslator/writers/html/md_html_writer.rb
adiwg-mdtranslator-1.4.0.beta11 lib/adiwg/mdtranslator/writers/html/md_html_writer.rb
adiwg-mdtranslator-1.4.0.beta10 lib/adiwg/mdtranslator/writers/html/md_html_writer.rb
adiwg-mdtranslator-1.4.0.beta9 lib/adiwg/mdtranslator/writers/html/md_html_writer.rb
adiwg-mdtranslator-1.4.0.beta8 lib/adiwg/mdtranslator/writers/html/md_html_writer.rb
adiwg-mdtranslator-1.4.0.beta7 lib/adiwg/mdtranslator/writers/html/md_html_writer.rb
adiwg-mdtranslator-1.4.0.beta6 lib/adiwg/mdtranslator/writers/html/md_html_writer.rb
adiwg-mdtranslator-1.4.0.beta5 lib/adiwg/mdtranslator/writers/html/md_html_writer.rb
adiwg-mdtranslator-1.4.0.beta4 lib/adiwg/mdtranslator/writers/html/md_html_writer.rb
adiwg-mdtranslator-1.4.0.beta3 lib/adiwg/mdtranslator/writers/html/md_html_writer.rb
adiwg-mdtranslator-1.4.0.beta2 lib/adiwg/mdtranslator/writers/html/md_html_writer.rb
adiwg-mdtranslator-1.4.0.beta1 lib/adiwg/mdtranslator/writers/html/md_html_writer.rb
adiwg-mdtranslator-1.3.0 lib/adiwg/mdtranslator/writers/html/md_html_writer.rb