Skip to content

Commit

Permalink
Remove Annex but not Appendix before xrefs to assets within appendixe…
Browse files Browse the repository at this point in the history
…s, as disambiguation: metanorma/mn-native-pdf#770
  • Loading branch information
opoudjis committed Nov 30, 2024
1 parent 5abdc60 commit e0523c3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 28 deletions.
5 changes: 4 additions & 1 deletion lib/isodoc/iho/xref.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,14 @@ def annex_names_recurse(clause, num)
end
end

# avoid ambiguity of Table 1-1 being in Appendix 1 or Clause 1
def annex_asset_names(clause, num, lbl)
#@annex_prefix = lbl
#require "debug"; binding.b
#hierarchical_asset_names(clause, num)
hierarchical_asset_names(clause,labelled_autonum(lbl, num))
n = num
clause["obligation"] == "informative" and n = labelled_autonum(lbl, num)
hierarchical_asset_names(clause, n)
#@annex_prefix = nil
end

Expand Down
62 changes: 35 additions & 27 deletions spec/isodoc/xref_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@
</xref>
<xref target="AAN">
<span class="fmt-element-name">Figure</span>
<semx element="autonum" source="annex11">Annex A</semx>
<semx element="autonum" source="annex11">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAN">1</semx>
</xref>
Expand All @@ -657,13 +657,13 @@
</xref>
<xref target="AAnote2">
<span class="fmt-element-name">Figure</span>
<semx element="autonum" source="annex11">Annex A</semx>
<semx element="autonum" source="annex11">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAnote2">2</semx>
</xref>
<xref target="AAnote3">
<span class="fmt-element-name">Figure</span>
<semx element="autonum" source="annex11">Annex A</semx>
<semx element="autonum" source="annex11">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAnote3">3</semx>
</xref>
Expand Down Expand Up @@ -890,7 +890,7 @@
</xref>
<xref target="AAN">
<span class="fmt-element-name">Diagram</span>
<semx element="autonum" source="annex11">Annex A</semx>
<semx element="autonum" source="annex11">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAN">1</semx>
</xref>
Expand All @@ -900,13 +900,13 @@
</xref>
<xref target="AAnote2">
<span class="fmt-element-name">Figure</span>
<semx element="autonum" source="annex11">Annex A</semx>
<semx element="autonum" source="annex11">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAnote2">1</semx>
</xref>
<xref target="AAnote3">
<span class="fmt-element-name">Figure</span>
<semx element="autonum" source="annex11">Annex A</semx>
<semx element="autonum" source="annex11">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAnote3">2</semx>
</xref>
Expand Down Expand Up @@ -1068,41 +1068,49 @@
</xref>
<xref target="AAN">
<span class="fmt-element-name">Figure</span>
<semx element="autonum" source="annex11">Annex A</semx>
<semx element="autonum" source="annex11">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAN">1</semx>
</xref>
<xref target="AAnote1">
<span class="fmt-element-name">Figure</span>
<semx element="autonum" source="annex11">Annex A</semx>
<semx element="autonum" source="annex11">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAN">1</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAnote1">1</semx>
</xref>
<xref target="AAnote2">
<span class="fmt-element-name">Figure</span>
<semx element="autonum" source="annex11">Annex A</semx>
<semx element="autonum" source="annex11">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAN">1</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAnote2">2</semx>
</xref>
<xref target="AN1">
<span class="fmt-xref-container">
<semx element="references" source="biblio">Bibliographical Section</semx>
</span>
<span class="fmt-xref-container">
<semx element="references" source="biblio">Bibliographical Section</semx>
</span>
<span class="fmt-comma">,</span>
<span class="fmt-element-name">Figure</span>
<semx element="autonum" source="AN1">1</semx>
</xref>
<xref target="Anote11">
<span class="fmt-xref-container">
<semx element="references" source="biblio">Bibliographical Section</semx>
</span>
<span class="fmt-comma">,</span>
<span class="fmt-element-name">Figure</span>
<semx element="autonum" source="AN1">1</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="Anote11">1</semx>
</xref>
<xref target="Anote21">
<span class="fmt-xref-container">
<semx element="references" source="biblio">Bibliographical Section</semx>
</span>
<span class="fmt-comma">,</span>
<span class="fmt-element-name">Figure</span>
<semx element="autonum" source="AN1">1</semx>
<span class="fmt-autonum-delim">-</span>
Expand Down Expand Up @@ -1590,7 +1598,7 @@
<xref target="AAN">
<span class="fmt-element-name">Formula</span>
<span class="fmt-autonum-delim">(</span>
<semx element="autonum" source="annex11">Annex A</semx>
<semx element="autonum" source="annex11">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAN">1</semx>
<span class="fmt-autonum-delim">)</span>
Expand All @@ -1604,7 +1612,7 @@
<xref target="AAnote2">
<span class="fmt-element-name">Formula</span>
<span class="fmt-autonum-delim">(</span>
<semx element="autonum" source="annex11">Annex A</semx>
<semx element="autonum" source="annex11">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAnote2">2</semx>
<span class="fmt-autonum-delim">)</span>
Expand Down Expand Up @@ -1796,7 +1804,7 @@
</xref>
<xref target="AAN">
<span class="fmt-element-name">Requirement</span>
<semx element="autonum" source="annex11">Annex A</semx>
<semx element="autonum" source="annex11">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAN">1</semx>
</xref>
Expand All @@ -1806,7 +1814,7 @@
</xref>
<xref target="AAnote2">
<span class="fmt-element-name">Requirement</span>
<semx element="autonum" source="annex11">Annex A</semx>
<semx element="autonum" source="annex11">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAnote2">2</semx>
</xref>
Expand Down Expand Up @@ -1975,7 +1983,7 @@
</xref>
<xref target="AAN">
<span class="fmt-element-name">Recommendation</span>
<semx element="autonum" source="annex11">Annex A</semx>
<semx element="autonum" source="annex11">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAN">1</semx>
</xref>
Expand All @@ -1985,7 +1993,7 @@
</xref>
<xref target="AAnote2">
<span class="fmt-element-name">Recommendation</span>
<semx element="autonum" source="annex11">Annex A</semx>
<semx element="autonum" source="annex11">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAnote2">2</semx>
</xref>
Expand Down Expand Up @@ -2155,7 +2163,7 @@
</xref>
<xref target="AAN">
<span class="fmt-element-name">Permission</span>
<semx element="autonum" source="annex11">Annex A</semx>
<semx element="autonum" source="annex11">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAN">1</semx>
</xref>
Expand All @@ -2165,7 +2173,7 @@
</xref>
<xref target="AAnote2">
<span class="fmt-element-name">Permission</span>
<semx element="autonum" source="annex11">Annex A</semx>
<semx element="autonum" source="annex11">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAnote2">2</semx>
</xref>
Expand Down Expand Up @@ -2357,21 +2365,21 @@
</xref>
<xref target="AAN1">
<span class="fmt-element-name">Permission</span>
<semx element="autonum" source="Axyz">Annex A</semx>
<semx element="autonum" source="Axyz">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAN1">1</semx>
</xref>
<xref target="AAN2">
<span class="fmt-element-name">Permission</span>
<semx element="autonum" source="Axyz">Annex A</semx>
<semx element="autonum" source="Axyz">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAN1">1</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAN2">1</semx>
</xref>
<xref target="AAN">
<span class="fmt-element-name">Permission</span>
<semx element="autonum" source="Axyz">Annex A</semx>
<semx element="autonum" source="Axyz">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAN1">1</semx>
<span class="fmt-autonum-delim">-</span>
Expand All @@ -2381,15 +2389,15 @@
</xref>
<xref target="AAQ1">
<span class="fmt-element-name">Requirement</span>
<semx element="autonum" source="Axyz">Annex A</semx>
<semx element="autonum" source="Axyz">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAN1">1</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAQ1">1</semx>
</xref>
<xref target="AAR1">
<span class="fmt-element-name">Recommendation</span>
<semx element="autonum" source="Axyz">Annex A</semx>
<semx element="autonum" source="Axyz">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAN1">1</semx>
<span class="fmt-autonum-delim">-</span>
Expand Down Expand Up @@ -2687,7 +2695,7 @@
</xref>
<xref target="AAN">
<span class="fmt-element-name">Table</span>
<semx element="autonum" source="annex11">Annex A</semx>
<semx element="autonum" source="annex11">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAN">1</semx>
</xref>
Expand All @@ -2697,7 +2705,7 @@
</xref>
<xref target="AAnote2">
<span class="fmt-element-name">Table</span>
<semx element="autonum" source="annex11">Annex A</semx>
<semx element="autonum" source="annex11">A</semx>
<span class="fmt-autonum-delim">-</span>
<semx element="autonum" source="AAnote2">2</semx>
</xref>
Expand Down

0 comments on commit e0523c3

Please sign in to comment.