Method: IsoDoc::Function::XrefGen#example_anchor_names

Defined in:
lib/isodoc/function/xref_gen.rb

#example_anchor_names(sections) ⇒ Object



69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/isodoc/function/xref_gen.rb', line 69

def example_anchor_names(sections)
  sections.each do |s|
    notes = s.xpath(CHILD_EXAMPLES_XPATH)
    notes.each_with_index do |n, i|
      next if @anchors[n["id"]]
      next if n["id"].nil? || n["id"].empty?
      idx = notes.size == 1 ? "" : " #{i + 1}"
      @anchors[n["id"]] = anchor_struct(idx, n, @example_xref_lbl, "example")
    end
    example_anchor_names(s.xpath(ns("./clause | ./appendix")))
  end
end