class Asciidoctor::IHO::Converter

A {Converter} implementation that generates RSD output, and a document schema encapsulation of the document for validation

Constants

SERIESNAME
XML_NAMESPACE
XML_ROOT_TAG

Public Instance Methods

appendix_parse(attrs, xml, node) click to toggle source
# File lib/asciidoctor/iho/converter.rb, line 21
def appendix_parse(attrs, xml, node)
  attrs["inline-header".to_sym] = node.option? "inline-header"
  set_obligation(attrs, node)
  xml.appendix **attr_code(attrs) do |xml_section|
    xml_section.title { |name| name << node.title }
    xml_section << node.content
  end
end
clause_parse(attrs, xml, node) click to toggle source
Calls superclass method
# File lib/asciidoctor/iho/converter.rb, line 15
def clause_parse(attrs, xml, node)
  node.option? "appendix" and
    return appendix_parse(attrs, xml, node)
  super
end
configuration() click to toggle source
# File lib/asciidoctor/iho/converter.rb, line 92
def configuration
  Metanorma::IHO.configuration
end
doc_converter(node) click to toggle source
# File lib/asciidoctor/iho/converter.rb, line 110
def doc_converter(node)
  IsoDoc::IHO::WordConvert.new(doc_extract_attributes(node))
end
html_converter(node) click to toggle source
# File lib/asciidoctor/iho/converter.rb, line 100
def html_converter(node)
  IsoDoc::IHO::HtmlConvert.new(html_extract_attributes(node))
end
metadata_commentperiod(node, xml) click to toggle source
# File lib/asciidoctor/iho/converter.rb, line 51
def metadata_commentperiod(node, xml)
  from = node.attr("comment-from") or return
  to = node.attr("comment-to")
  xml.commentperiod do |c|
    c.from from
    c.to to if to
  end
end
metadata_committee(node, xml) click to toggle source
# File lib/asciidoctor/iho/converter.rb, line 60
def metadata_committee(node, xml)
  unless node.attr("workgroup")
    @log.add("AsciiDoc Input", nil,
             "Missing workgroup attribute for document")
    return
  end
  metadata_committee1(node, xml)
end
metadata_committee1(node, xml) click to toggle source
# File lib/asciidoctor/iho/converter.rb, line 69
def metadata_committee1(node, xml)
  xml.editorialgroup do |a|
    a.committee do |n|
      n.abbreviation node.attr("committee").upcase
    end
    a.workgroup do |n|
      n.abbreviation node.attr("workgroup").upcase
    end
  end
  i = 2
  while node.attr("workgroup_#{i}")
    xml.editorialgroup do |a|
      a.committee do |n|
        n.abbreviation node.attr("committee_#{i}").upcase
      end
      a.workgroup do |n|
        n.abbreviation node.attr("workgroup_#{i}").upcase
      end
    end
    i += 1
  end
end
metadata_ext(node, ext) click to toggle source
Calls superclass method
# File lib/asciidoctor/iho/converter.rb, line 46
def metadata_ext(node, ext)
  super
  metadata_commentperiod(node, ext)
end
metadata_series(node, xml) click to toggle source
# File lib/asciidoctor/iho/converter.rb, line 38
def metadata_series(node, xml)
  series = node.attr("series") or return
  xml.series **{ type: "main" } do |s|
    s.title SERIESNAME[series.to_sym] || "N/A"
    s.abbreviation series
  end
end
pdf_converter(node) click to toggle source
# File lib/asciidoctor/iho/converter.rb, line 104
def pdf_converter(node)
  return nil if node.attr("no-pdf")

  IsoDoc::IHO::PdfConvert.new(html_extract_attributes(node))
end
presentation_xml_converter(node) click to toggle source
# File lib/asciidoctor/iho/converter.rb, line 96
def presentation_xml_converter(node)
  IsoDoc::IHO::PresentationXMLConvert.new(html_extract_attributes(node))
end