Skip to content

Commit

Permalink
clause counter method: metanorma/metanorma-jis#228
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Oct 22, 2024
1 parent c28d58a commit c33d81e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/isodoc/xref/xref_counter_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module IsoDoc
class Xref
def class_counter(num = 0, opts = { numerals: :arabic })
def clause_counter(num = 0, opts = { numerals: :arabic })
::IsoDoc::XrefGen::Counter.new(num, opts)
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/isodoc/xref/xref_sect_gen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def preface_anchor_names(xml)
end

def main_anchor_names(xml)
n = class_counter
n = clause_counter
clause_order_main(xml).each do |a|
xml.xpath(ns(a[:path])).each do |c|
section_names(c, n, 1)
Expand Down Expand Up @@ -144,7 +144,7 @@ def section_names(clause, num, lvl)
num.increment(clause)
section_name_anchors(clause, num.print, lvl)
clause.xpath(ns(SUBCLAUSES))
.each_with_object(class_counter(0, prefix: "#{num.print}.")) do |c, i|
.each_with_object(clause_counter(0, prefix: "#{num.print}.")) do |c, i|
section_names1(c, i.increment(c).print, lvl + 1)
end
num
Expand Down

0 comments on commit c33d81e

Please sign in to comment.