Skip to content

Commit

Permalink
allow recursive container prefixes for cross-references: metanorma/me…
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Nov 28, 2023
1 parent c88f8e8 commit 291bdaa
Show file tree
Hide file tree
Showing 5 changed files with 205 additions and 48 deletions.
2 changes: 2 additions & 0 deletions Gemfile.devel
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gem "isodoc", git: "https://github.com/metanorma/isodoc", branch: "fix/recursive-prefix-container"
gem "metanorma-iso", git: "https://github.com/metanorma/metanorma-iso", branch: "fix/recursive-prefix-container"
8 changes: 4 additions & 4 deletions lib/isodoc/bipm/xref.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@ def annex_name_lbl(_clause, num)
l10n("<strong>#{@annexlbl} #{num}</strong>")
end

def sequential_formula_names(clause)
def sequential_formula_names(clause, container: false)
c = Counter.new
clause.xpath(ns(".//formula")).noblank.each do |t|
@anchors[t["id"]] = anchor_struct(
c.increment(t).print, nil,
c.increment(t).print, container ? t : nil,
t["inequality"] ? @labels["inequality"] : @labels["formula"],
"formula", t["unnumbered"]
)
Expand All @@ -232,9 +232,9 @@ def initial_anchor_names(doc)
end
end

def sequential_figure_names(clause)
def sequential_figure_names(clause, container: false)
@jcgm or return super
@iso.sequential_figure_names(clause)
@iso.sequential_figure_names(clause, container: container)
@anchors.merge!(@iso.get)
end

Expand Down
13 changes: 13 additions & 0 deletions lib/metanorma/bipm/biblio.rng
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,16 @@
<ref name="image"/>
</element>
</define>
<define name="depiction">
<element name="depiction">
<optional>
<attribute name="scope"/>
</optional>
<zeroOrMore>
<ref name="image"/>
</zeroOrMore>
</element>
</define>
<define name="NameWithVariants">
<element name="primary">
<ref name="LocalizedString"/>
Expand Down Expand Up @@ -760,6 +770,9 @@
<optional>
<ref name="validity"/>
</optional>
<optional>
<ref name="depiction"/>
</optional>
</define>
<define name="ReducedBibliographicItem">
<optional>
Expand Down
40 changes: 20 additions & 20 deletions spec/vcr_cassettes/bipm-fr.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

190 changes: 166 additions & 24 deletions spec/vcr_cassettes/bipm.yml

Large diffs are not rendered by default.

0 comments on commit 291bdaa

Please sign in to comment.