Sha256: f53ee94c8ecd13c1e3609a038a4a57e9298dbf449bd070542a980b9a051107aa

Contents?: true

Size: 1.82 KB

Versions: 22

Compression:

Stored size: 1.82 KB

Contents

module IsoDoc::Function
  module Terms

    def definition_parse(node, out)
      node.children.each { |n| parse(n, out) }
    end

    def modification_parse(node, out)
      out << "[MODIFICATION]"
      para = node.at(ns("./p"))
      para.children.each { |n| parse(n, out) }
    end

    def deprecated_term_parse(node, out)
      out.p **{ class: "DeprecatedTerms", style:"text-align:left;" } do |p|
        p << l10n("#{@deprecated_lbl}: ")
        node.children.each { |c| parse(c, p) }
      end
    end

    def admitted_term_parse(node, out)
      out.p **{ class: "AltTerms", style:"text-align:left;" } do |p|
        node.children.each { |c| parse(c, p) }
      end
    end

    def term_parse(node, out)
      out.p **{ class: "Terms", style:"text-align:left;" } do |p|
        node.children.each { |c| parse(c, p) }
      end
    end

    def para_then_remainder(first, node, p, div)
      if first.name == "p"
        first.children.each { |n| parse(n, p) }
        node.elements.drop(1).each { |n| parse(n, div) }
      else
        node.elements.each { |n| parse(n, div) }
      end
    end

    def termnote_parse(node, out)
      out.div **{ class: "Note" } do |div|
        first = node.first_element_child
        div.p do |p|
          p << "#{anchor(node['id'], :label) || '???'}: "
          para_then_remainder(first, node, p, div)
        end
      end
    end

    def termref_parse(node, out)
      out.p do |p|
        p << "[TERMREF]"
        node.children.each { |n| parse(n, p) }
        p << "[/TERMREF]"
      end
    end

    def termdef_parse(node, out)
      out.p **{ class: "TermNum", id: node["id"] } do |p|
        p << "#{get_anchors[node["id"]][:label]}#{clausedelim}"
      end
      set_termdomain("")
      node.children.each { |n| parse(n, out) }
    end

    def termdocsource_parse(_node, _out)
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
isodoc-1.0.28 lib/isodoc/function/terms.rb
isodoc-1.0.27 lib/isodoc/function/terms.rb
isodoc-1.0.26 lib/isodoc/function/terms.rb
isodoc-1.0.25 lib/isodoc/function/terms.rb
isodoc-1.0.24 lib/isodoc/function/terms.rb
isodoc-1.0.23 lib/isodoc/function/terms.rb
isodoc-1.0.22 lib/isodoc/function/terms.rb
isodoc-1.0.21 lib/isodoc/function/terms.rb
isodoc-1.0.20 lib/isodoc/function/terms.rb
isodoc-1.0.19 lib/isodoc/function/terms.rb
isodoc-1.0.18 lib/isodoc/function/terms.rb
isodoc-1.0.17 lib/isodoc/function/terms.rb
isodoc-1.0.16 lib/isodoc/function/terms.rb
isodoc-1.0.15 lib/isodoc/function/terms.rb
isodoc-1.0.14 lib/isodoc/function/terms.rb
isodoc-1.0.13 lib/isodoc/function/terms.rb
isodoc-1.0.12 lib/isodoc/function/terms.rb
isodoc-1.0.11 lib/isodoc/function/terms.rb
isodoc-1.0.10 lib/isodoc/function/terms.rb
isodoc-1.0.9 lib/isodoc/function/terms.rb