class IsoDoc::UN::PresentationXMLConvert

Public Class Methods

new(options) click to toggle source
Calls superclass method
# File lib/isodoc/un/presentation_xml_convert.rb, line 7
def initialize(options)
  super
  @toc = options[:toc]
end

Public Instance Methods

admonition(docxml) click to toggle source
# File lib/isodoc/un/presentation_xml_convert.rb, line 30
def admonition(docxml)
  docxml.xpath(ns("//admonition")).each do |f|
    admonition1(f)
  end
end
admonition1(f) click to toggle source
# File lib/isodoc/un/presentation_xml_convert.rb, line 36
def admonition1(f)
  n = @xrefs.anchor(f['id'], :label) or return
  lbl = l10n("#{@i18n.admonition} #{n}")
  prefix_name(f, " — ", lbl, "name")
end
annex1(f) click to toggle source
# File lib/isodoc/un/presentation_xml_convert.rb, line 42
def annex1(f)
  lbl = @xrefs.anchor(f['id'], :label)
  if t = f.at(ns("./title"))
    t.children = "<strong>#{t.children.to_xml}</strong>"
  end
  prefix_name(f, "<br/>", lbl, "title")
end
conversions(docxml) click to toggle source
Calls superclass method
# File lib/isodoc/un/presentation_xml_convert.rb, line 25
def conversions(docxml)
  super
  admonition docxml
end
note1(f) click to toggle source
# File lib/isodoc/un/presentation_xml_convert.rb, line 12
def note1(f)
  return if f.parent.name == "bibitem"
  return if f["type"] == "title-footnote"
  n = @xrefs.get[f["id"]]
  lbl = case f["type"]
        when "source" then "Source"
        when "abbreviation" then "Abbreviations"
        else
          @i18n.note
        end
  prefix_name(f, "", lbl, "name")
end