Sha256: 7230520215b18b33e4ec68c0b8df8fe222fead8539a041e7f2a556510d2bea5a

Contents?: true

Size: 1.8 KB

Versions: 7

Compression:

Stored size: 1.8 KB

Contents

module IsoDoc
  module NIST
    module BaseConvert
      def abstract(isoxml, out)
        f = isoxml.at(ns("//preface/abstract")) || return
        #page_break(out)
        out.div **attr_code(id: f["id"]) do |s|
          clause_name(nil, @abstract_lbl, s, class: "AbstractTitle")
          f.elements.each { |e| parse(e, s) unless e.name == "title" }
        end
      end

       # All "[preface]" sections should have class "IntroTitle" to prevent
      # page breaks, but for the Exec Summary
      def preface(isoxml, out)
        isoxml.xpath(ns(FRONT_CLAUSE)).each do |c|
          next if skip_render(c, isoxml)
          title = c&.at(ns("./title"))
          patent = ["Call for Patent Claims",
                    "Patent Disclosure Notice"].include? title&.text
          preface1(c, title, patent, out)
        end
      end

      def preface1(c, title, patent, out)
        out.div **attr_code(id: c["id"]) do |s|
          page_break(s) if patent
          clause_name(@xrefs.anchor(c['id'], :label), title, s,
                      class: (c.name == "executivesummary") ? "NormalTitle" :
                      "IntroTitle")
          c.elements.reject { |c1| c1.name == "title" }.each do |c1|
            parse(c1, s)
          end
        end
      end

       def middle(isoxml, out)
        clause isoxml, out
        require "byebug"; byebug
        bibliography isoxml, out
        annex isoxml, out
      end

       def foreword(isoxml, out)
        f = isoxml.at(ns("//foreword")) || return
        out.div **attr_code(id: f["id"]) do |s|
          title = f.at(ns("./title"))
          s.h1(**{ class: "ForewordTitle" }) do |h1|
            title and title.children.each { |e| parse(e, h1) }
          end
          f.elements.each { |e| parse(e, s) unless e.name == "title" }
        end
      end
    end
  end
end

Version data entries

7 entries across 5 versions & 2 rubygems

Version Path
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/metanorma-nist-1.1.3/lib/isodoc/nist/section.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/metanorma-nist-1.1.2/lib/isodoc/nist/section.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/metanorma-nist-1.1.2/lib/isodoc/nist/section.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/metanorma-nist-1.1.3/lib/isodoc/nist/section.rb
metanorma-nist-1.1.3 lib/isodoc/nist/section.rb
metanorma-nist-1.1.2 lib/isodoc/nist/section.rb
metanorma-nist-1.1.1 lib/isodoc/nist/section.rb