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.12.0 lib/isodoc/function/terms.rb
isodoc-2.11.4 lib/isodoc/function/terms.rb
isodoc-2.11.3 lib/isodoc/function/terms.rb
isodoc-2.11.2 lib/isodoc/function/terms.rb
isodoc-2.11.1 lib/isodoc/function/terms.rb
isodoc-2.11.0 lib/isodoc/function/terms.rb
isodoc-2.10.7 lib/isodoc/function/terms.rb
isodoc-2.10.6 lib/isodoc/function/terms.rb
isodoc-2.10.5 lib/isodoc/function/terms.rb
isodoc-2.10.4 lib/isodoc/function/terms.rb
isodoc-2.10.3 lib/isodoc/function/terms.rb
isodoc-2.10.2 lib/isodoc/function/terms.rb
isodoc-2.10.1 lib/isodoc/function/terms.rb
isodoc-2.10.0 lib/isodoc/function/terms.rb
isodoc-2.9.4 lib/isodoc/function/terms.rb
isodoc-2.9.3 lib/isodoc/function/terms.rb
isodoc-2.9.2 lib/isodoc/function/terms.rb
isodoc-2.9.1 lib/isodoc/function/terms.rb
isodoc-2.9.0 lib/isodoc/function/terms.rb
isodoc-2.8.5 lib/isodoc/function/terms.rb