metanorma-bipm 2.6.1 → 2.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -120,7 +120,8 @@ module IsoDoc
120
120
  docxml.root.replace(Nokogiri::XML(docxml.root.to_xml).root)
121
121
  docxml.xpath(ns(xpath)).each do |x| # rubocop: disable Style/CombinableLoops
122
122
  if x.parent.next&.text? && /^\],\s+\[$/.match?(x.parent.next.text) &&
123
- %w(eref origin fmt-eref fmt-origin).include?(x.parent.next.next&.name)
123
+ %w(eref origin fmt-eref
124
+ fmt-origin).include?(x.parent.next.next&.name)
124
125
  x.parent.next.replace(", ")
125
126
  end
126
127
  end
@@ -155,8 +156,8 @@ module IsoDoc
155
156
  end
156
157
 
157
158
  def termsource_label(elem, sources)
158
- elem.replace(l10n("[#{termsource_adapt(elem['status'])} #{sources}]"))
159
- end
159
+ elem.replace(l10n("[#{termsource_adapt(elem['status'])} #{sources}]"))
160
+ end
160
161
 
161
162
  def termsource_adapt(status)
162
163
  case status
@@ -204,6 +205,35 @@ module IsoDoc
204
205
  @xrefs.bookmark_anchor_names(docxml)
205
206
  end
206
207
 
208
+ def fn_label_brackets(fnote)
209
+ "<sup><span class='fmt-label-delim'>(</span>" \
210
+ "#{fn_label(fnote)}" \
211
+ "<span class='fmt-label-delim'>)</span></sup>"
212
+ end
213
+
214
+ def fn_ref_label(fnote)
215
+ if @jcgm then iso_fn_ref_label(fnote)
216
+ else fn_label_brackets(fnote)
217
+ end
218
+ end
219
+
220
+ # copied from ISO
221
+ def iso_fn_ref_label(fnote)
222
+ if fnote.ancestors("table, figure").empty? ||
223
+ !fnote.ancestors("name, fmt-name").empty?
224
+ "<sup>#{fn_label(fnote)}" \
225
+ "<span class='fmt-label-delim'>)</span></sup>"
226
+ else
227
+ "<sup>#{fn_label(fnote)}</sup>"
228
+ end
229
+ end
230
+
231
+ def fn_body_label(fnote)
232
+ if @jcgm then super
233
+ else fn_label_brackets(fnote)
234
+ end
235
+ end
236
+
207
237
  include Init
208
238
  end
209
239
  end
@@ -33,6 +33,15 @@
33
33
  </zeroOrMore>
34
34
  </element>
35
35
  </define>
36
+ <define name="fn" combine="interleave">
37
+ <optional>
38
+ <attribute name="hiddenref">
39
+ <a:documentation>If true, number the footnote as normal, but suppress display of the footnote reference in the document body.
40
+ This is done if the footnote reference is already presented in some other form, e.g. within a figure image.</a:documentation>
41
+ <data type="boolean"/>
42
+ </attribute>
43
+ </optional>
44
+ </define>
36
45
  <define name="index-primary">
37
46
  <element name="primary">
38
47
  <oneOrMore>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Bipm
3
- VERSION = "2.6.1".freeze
3
+ VERSION = "2.6.2".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-bipm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.1
4
+ version: 2.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-03-04 00:00:00.000000000 Z
11
+ date: 2025-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic