Sha256: 489fa49ef7293d339a0dd9bc05e66b55f5ceaa14ee80d65d7b6d789341c7189c

Contents?: true

Size: 1.51 KB

Versions: 4

Compression:

Stored size: 1.51 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


$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), './sections'))

require 'html_head'
require 'html_body'

module ADIWG
    module Mdtranslator
        module Writers
            module Html

                class MdHtmlWriter
                    def initialize(html)
                        @html = html
                    end

                    def writeHtml(intObj)

                        # set html section namespace
                        $HtmlNS = ADIWG::Mdtranslator::Writers::Html

                        # set contact array in a global
                        $aContacts = intObj[:contacts]

                        # classes used
                        htmlHead = $HtmlNS::MdHtmlHead.new(@html)
                        htmlBody = $HtmlNS::MdHtmlBody.new(@html)

                        # page
                        metadata = @html.declare! :DOCTYPE, :html
                        @html.html(:lang=>'en') do
                            @html.comment!('Report from mdTranslator HTML writer v1.0')

                            # head
                            htmlHead.writeHtml()

                            # body
                            htmlBody.writeHtml(intObj)
                        end

                        return metadata

                    end
                end

            end
        end
    end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
adiwg-mdtranslator-1.2.1 lib/adiwg/mdtranslator/writers/html/md_html_writer.rb
adiwg-mdtranslator-1.2.0 lib/adiwg/mdtranslator/writers/html/md_html_writer.rb
adiwg-mdtranslator-1.1.1 lib/adiwg/mdtranslator/writers/html/md_html_writer.rb
adiwg-mdtranslator-1.1.0 lib/adiwg/mdtranslator/writers/html/md_html_writer.rb