Sha256: 7021ff95d53f2c781d72f4bc1730cae0765aeab862cfc7705c70c3b6d693dc04

Contents?: true

Size: 1.11 KB

Versions: 10

Compression:

Stored size: 1.11 KB

Contents

require "metanorma-generic"

module IsoDoc
  module Ribose
    class Counter < IsoDoc::XrefGen::Counter
    end

    class Xref < IsoDoc::Generic::Xref
      def annex_name_lbl(clause, num)
        obl = l10n("(#{@labels['inform_annex']})")
        obl = l10n("(#{@labels['norm_annex']})") if clause["obligation"] == "normative"
        l10n("#{@labels['annex']} #{num}<br/>#{obl}")
      end

      def initial_anchor_names(d)
        preface_names(d.at(ns("//executivesummary")))
        super
        sequential_asset_names(
          d.xpath(ns("//preface/abstract | //foreword | //introduction | "\
                     "//preface/clause | //acknowledgements | //executivesummary")))
      end

      def section_names1(clause, num, level)
        @anchors[clause["id"]] =
          { label: num, level: level, xref: num }
        # subclauses are not prefixed with "Clause"
        i = Counter.new
        clause.xpath(ns("./clause | ./terms | ./term | ./definitions | ./references")).
          each do |c|
          i.increment(c)
          section_names1(c, "#{num}.#{i.print}", level + 1)
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
metanorma-ribose-1.7.3 lib/isodoc/ribose/xref.rb
metanorma-ribose-1.7.2 lib/isodoc/ribose/xref.rb
metanorma-ribose-1.7.1 lib/isodoc/ribose/xref.rb
metanorma-ribose-1.7.0 lib/isodoc/ribose/xref.rb
metanorma-ribose-1.6.16 lib/isodoc/ribose/xref.rb
metanorma-ribose-1.6.15 lib/isodoc/ribose/xref.rb
metanorma-ribose-1.6.14 lib/isodoc/ribose/xref.rb
metanorma-ribose-1.6.13 lib/isodoc/ribose/xref.rb
metanorma-ribose-1.6.12 lib/isodoc/ribose/xref.rb
metanorma-ribose-1.6.11 lib/isodoc/ribose/xref.rb