Sha256: 1566869965933d60da998b59392e7d13c07162f7469ad4ada20285fb3602b340

Contents?: true

Size: 1.96 KB

Versions: 46

Compression:

Stored size: 1.96 KB

Contents

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

      def modification_parse(node, out)
        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|
          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, para, div)
        if first.name == "p"
          first.children.each { |n| parse(n, para) }
          node.elements.drop(1).each { |n| parse(n, div) }
        else
          node.elements.each { |n| parse(n, div) }
        end
      end

      def termnote_delim
        l10n(": ")
      end

      def termnote_parse(node, out)
        name = node&.at(ns("./name"))&.remove
        out.div **note_attrs(node) do |div|
          div.p do |p|
            if name
              name.children.each { |n| parse(n, p) }
              p << termnote_delim
            end
            para_then_remainder(node.first_element_child, node, p, div)
          end
        end
      end

      def termref_parse(node, out)
        out.p do |p|
          node.children.each { |n| parse(n, p) }
        end
      end

      def termdef_parse(node, out)
        name = node&.at(ns("./name"))&.remove
        out.p class: "TermNum", id: node["id"] do |p|
          name&.children&.each { |n| parse(n, p) }
        end
        set_termdomain("")
        node.children.each { |n| parse(n, out) }
      end

      def termdocsource_parse(_node, _out); end
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
isodoc-2.8.4 lib/isodoc/function/terms.rb
isodoc-2.8.3 lib/isodoc/function/terms.rb
isodoc-2.8.2 lib/isodoc/function/terms.rb
isodoc-2.8.1 lib/isodoc/function/terms.rb
isodoc-2.8.0 lib/isodoc/function/terms.rb
isodoc-2.7.4 lib/isodoc/function/terms.rb
isodoc-2.7.3 lib/isodoc/function/terms.rb
isodoc-2.7.2 lib/isodoc/function/terms.rb
isodoc-2.7.1 lib/isodoc/function/terms.rb
isodoc-2.7.0 lib/isodoc/function/terms.rb
isodoc-2.6.6 lib/isodoc/function/terms.rb
isodoc-2.6.5 lib/isodoc/function/terms.rb
isodoc-2.6.4 lib/isodoc/function/terms.rb
isodoc-2.6.3 lib/isodoc/function/terms.rb
isodoc-2.6.2 lib/isodoc/function/terms.rb
isodoc-2.6.1 lib/isodoc/function/terms.rb
isodoc-2.6.0 lib/isodoc/function/terms.rb
isodoc-2.5.10 lib/isodoc/function/terms.rb
isodoc-2.5.9 lib/isodoc/function/terms.rb
isodoc-2.5.8 lib/isodoc/function/terms.rb