# HTML writer
# html head
# History:
# Stan Smith 2017-03-22 refactored for mdTranslator 2.0
# Stan Smith 2015-07-20 moved mdTranslator logo to html_inlineCss.css
# Stan Smith 2015-07-17 added support for user supplied css
# Stan Smith 2015-04-07 added metadata tag to head
# Stan Smith 2015-03-23 original script
module ADIWG
module Mdtranslator
module Writers
module Html
class Html_Head
def initialize(html)
@html = html
end
def writeHtml(version, cssLink)
@html.head do
@html.meta({'http-equiv' => 'Content-Type', 'content' => 'text/html; charset=utf-8'})
@html.title('HTML Metadata report')
@html.meta('name' => 'generator', 'content' => 'HTML output generated by ADIwg mdTranslator ToolKit ' + version + ' available at https://github.com/adiwg ')
@html.meta('name' => 'description', 'content' => 'mdTranslator software is an open-source project of the Alaska Data Integration working group (ADIwg). Alaska Data Integration working group is not responsible for the content of this metadata record')
@html.meta('name' => 'keywords', 'content' => 'metadata, ADIwg, mdTranslator, ISO19115')
@html.comment!('metadata record generated ' + Time.now.to_s)
# add inline css
# read css from file
path = File.join(File.dirname(__FILE__), 'html_inlineCss.css')
file = File.open(path, 'r')
css = file.read
file.close
@html.style do
@html.text!(css)
end
# append user supplied css
if cssLink
@html.link('rel' => 'stylesheet', 'href' => cssLink)
end
end
end # writeHtml
end # Html_Head
end
end
end
end