Sha256: 7f183e9b36db2b0662f01afb3804dda8d7dfa5e57a8046968ac8b24fd3a4581e

Contents?: true

Size: 1.14 KB

Versions: 12

Compression:

Stored size: 1.14 KB

Contents

require "date"
require "nokogiri"
require "htmlentities"
require "json"
require "pathname"
require "open-uri"
require "pp"

module Asciidoctor
  module ISO
    class Converter < Standoc::Converter
      PRE_NORMREF_FOOTNOTES = "//foreword//fn | //introduction//fn |"\
        "//clause[title = 'Scope']//fn" .freeze

      NORMREF_FOOTNOTES =
        "//references[title = 'Normative References']//fn |"\
        "//references[title = 'Normative References']//bibitem/note".freeze

      POST_NORMREF_FOOTNOTES =
        "//clause[not(title = 'Scope')]//fn | "\
        "//references[title = 'Bibliography']//fn | "\
        "//references[title = 'Bibliography']//bibitem/note".freeze

      def other_footnote_renumber(xmldoc)
        seen = {}
        i = 0
        xmldoc.xpath(PRE_NORMREF_FOOTNOTES).each do |fn|
          i, seen = other_footnote_renumber1(fn, i, seen)
        end
        xmldoc.xpath(NORMREF_FOOTNOTES).each do |fn|
          i, seen = other_footnote_renumber1(fn, i, seen)
        end
        xmldoc.xpath(POST_NORMREF_FOOTNOTES).each do |fn|
          i, seen = other_footnote_renumber1(fn, i, seen)
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
metanorma-iso-1.0.8 lib/asciidoctor/iso/cleanup.rb
metanorma-iso-1.0.7 lib/asciidoctor/iso/cleanup.rb
metanorma-iso-1.0.6 lib/asciidoctor/iso/cleanup.rb
metanorma-iso-1.0.5 lib/asciidoctor/iso/cleanup.rb
metanorma-iso-1.0.4 lib/asciidoctor/iso/cleanup.rb
metanorma-iso-1.0.3 lib/asciidoctor/iso/cleanup.rb
metanorma-iso-1.0.2 lib/asciidoctor/iso/cleanup.rb
metanorma-iso-1.0.1 lib/asciidoctor/iso/cleanup.rb
metanorma-iso-1.0.0 lib/asciidoctor/iso/cleanup.rb
asciidoctor-iso-0.10.4 lib/asciidoctor/iso/cleanup.rb
asciidoctor-iso-0.10.3 lib/asciidoctor/iso/cleanup.rb
asciidoctor-iso-0.10.2 lib/asciidoctor/iso/cleanup.rb