class ADIWG::Mdtranslator::Writers::Html::Html_Keyword

Public Class Methods

new(html) click to toggle source
# File lib/adiwg/mdtranslator/writers/html/sections/html_keyword.rb, line 18
def initialize(html)
   @html = html
end

Public Instance Methods

writeHtml(hKeyword) click to toggle source
# File lib/adiwg/mdtranslator/writers/html/sections/html_keyword.rb, line 22
def writeHtml(hKeyword)

   # classes used
   citationClass = Html_Citation.new(@html)

   # keywords - type
   @html.details do
      type = hKeyword[:keywordType]
      if type.nil?
         type = 'Unclassified'
      end
      @html.summary(type, {'class' => 'h5'})
      @html.section(:class => 'block') do

         # keywords
         @html.ul do
            hKeyword[:keywords].each do |hKeyword|
               unless hKeyword[:keyword].nil?
                  keyword = hKeyword[:keyword]
                  unless hKeyword[:keywordId].nil?
                     keyword += ' (ID: ' + hKeyword[:keywordId].to_s + ')'
                  end
                  @html.li(keyword)
               end
            end
         end

         # thesaurus
         unless hKeyword[:thesaurus].empty?
            @html.details do
               @html.summary('Thesaurus', {'class' => 'h5'})
               @html.section(:class => 'block') do
                  citationClass.writeHtml(hKeyword[:thesaurus])
               end
            end
         end

      end
   end

end