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 5563fb5 commit 38b11b9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
1 change: 1 addition & 0 deletions Gemfile.devel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gem "isodoc", git: "https://github.com/metanorma/isodoc", branch: "fix/recursive-prefix-container"
9 changes: 5 additions & 4 deletions lib/isodoc/un/xref.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,12 @@ def clause_order_back(_docxml)
]
end

def sequential_admonition_names(clause)
def sequential_admonition_names(clause, container: false)
i = 0
clause.xpath(ns(".//admonition")).noblank.each do |t|
i += 1 unless t["unnumbered"] == "true"
@anchors[t["id"]] = anchor_struct(i.to_s, nil, @labels["admonition"],
@anchors[t["id"]] =
anchor_struct(i.to_s, container ? t : nil, @labels["admonition"],
"box", t["unnumbered"])
end
end
Expand All @@ -178,9 +179,9 @@ def hierarchical_admonition_names(clause, num)
end
end

def sequential_asset_names(clause)
def sequential_asset_names(clause, container: false)
super
sequential_admonition_names(clause)
sequential_admonition_names(clause, container: container)
end

def hierarchical_asset_names(clause, num)
Expand Down
13 changes: 13 additions & 0 deletions lib/metanorma/un/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

0 comments on commit 38b11b9

Please sign in to comment.