Sha256: 95cf2f4e6cbcd313a500d1ef15e7014190363c8c996a6a5105d1a1f94fc78415

Contents?: true

Size: 1.23 KB

Versions: 11

Compression:

Stored size: 1.23 KB

Contents

module IsoDoc
  class PresentationXMLConvert < ::IsoDoc::Convert
    def clause(docxml)
      docxml.xpath(ns("//clause | "\
                      "//terms | //definitions | //references")).
                     each do |f|
        clause1(f)
      end
    end

    def clause1(f)
      level = @xrefs.anchor(f['id'], :level, false) || "1"
      t = f.at(ns("./title")) and t["depth"] = level
      return if !f.ancestors("boilerplate").empty?
      return if @suppressheadingnumbers || f["unnumbered"]
      lbl = @xrefs.anchor(f['id'], :label,
                          f.parent.name != "sections") or return
      prefix_name(f, "<tab/>", "#{lbl}#{clausedelim}", "title")
    end

    def annex(docxml)
      docxml.xpath(ns("//annex")).each do |f|
        annex1(f)
      end
    end

    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/><br/>", lbl, "title")
    end

    def term(docxml)
      docxml.xpath(ns("//term")).each do |f|
        term1(f)
      end
    end

    def term1(f)
      lbl = @xrefs.get[f["id"]][:label] or return
      prefix_name(f, "", "#{lbl}#{clausedelim}", "name")
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
isodoc-1.3.0 lib/isodoc/presentation_function/section.rb
isodoc-1.2.8 lib/isodoc/presentation_function/section.rb
isodoc-1.2.7 lib/isodoc/presentation_function/section.rb
isodoc-1.2.6 lib/isodoc/presentation_function/section.rb
isodoc-1.2.5 lib/isodoc/presentation_function/section.rb
isodoc-1.2.4 lib/isodoc/presentation_function/section.rb
isodoc-1.2.3 lib/isodoc/presentation_function/section.rb
isodoc-1.2.2 lib/isodoc/presentation_function/section.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/isodoc-1.2.1/lib/isodoc/presentation_function/section.rb
isodoc-1.2.1 lib/isodoc/presentation_function/section.rb
isodoc-1.2.0 lib/isodoc/presentation_function/section.rb