metanorma-bipm 2.2.10 → 2.2.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -25,8 +25,7 @@ module IsoDoc
25
25
  end
26
26
 
27
27
  def table1(elem)
28
- return if labelled_ancestor(elem) || elem["unnumbered"]
29
-
28
+ labelled_ancestor(elem) || elem["unnumbered"] and return
30
29
  n = @xrefs.anchor(elem["id"], :label, false)
31
30
  prefix_name(elem, ".<tab/>",
32
31
  l10n("#{@i18n.table.capitalize} #{n}"), "name")
@@ -41,9 +40,8 @@ module IsoDoc
41
40
  end
42
41
 
43
42
  def annex1(elem)
44
- return super if @jcgm
45
- return if elem["unnumbered"] == "true"
46
-
43
+ @jcgm and return super
44
+ elem["unnumbered"] == "true" and return
47
45
  lbl = @xrefs.anchor(elem["id"], :label)
48
46
  t = elem.at(ns("./title")) and
49
47
  t.children = "<strong>#{to_xml(t.children)}</strong>"
@@ -60,18 +58,15 @@ module IsoDoc
60
58
  end
61
59
 
62
60
  def clause1(elem)
63
- elem.at(("./ancestor::*[@unnumbered = 'true']")) and
61
+ elem.at("./ancestor::*[@unnumbered = 'true']") and
64
62
  elem["unnumbered"] = "true"
65
-
66
63
  super
67
64
  end
68
65
 
69
66
  def prefix_name(node, delim, number, elem)
70
- return if number.nil? || number.empty?
71
-
67
+ number.nil? || number.empty? and return
72
68
  unless name = node.at(ns("./#{elem}[not(@type = 'quoted')]"))
73
- return if node.at(ns("./#{elem}[@type = 'quoted']"))
74
-
69
+ node.at(ns("./#{elem}[@type = 'quoted']")) and return
75
70
  (node.children.empty? and node.add_child("<#{elem}></#{elem}>")) or
76
71
  node.children.first.previous = "<#{elem}></#{elem}>"
77
72
  name = node.children.first
@@ -118,14 +113,12 @@ module IsoDoc
118
113
  end
119
114
 
120
115
  def bibdata_titles(bibdata)
121
- return unless app = bibdata.at(ns("//bibdata/ext/" \
122
- "structuredidentifier/part"))
123
-
116
+ app = bibdata.at(ns("//bibdata/ext/" \
117
+ "structuredidentifier/part")) or return
124
118
  bibdata.xpath(ns("//bibdata/title[@type = 'part']")).each do |t|
125
119
  t.previous = t.dup
126
120
  t["type"] = "part-with-numbering"
127
- part = t["language"] == "en" ? "Part" : "Partie"
128
- # not looking up in YAML
121
+ part = t["language"] == "en" ? "Part" : "Partie" # not looking up in YAML
129
122
  t.children = l10n("#{part} #{app.text}: #{to_xml(t.children)}",
130
123
  t["language"])
131
124
  end
@@ -147,8 +140,7 @@ module IsoDoc
147
140
  end
148
141
 
149
142
  def jcgm_eref(docxml, xpath)
150
- return unless @jcgm
151
-
143
+ @jcgm or return
152
144
  docxml.xpath(ns(xpath)).each { |x| extract_brackets(x) }
153
145
  # merge adjacent text nodes
154
146
  docxml.root.replace(Nokogiri::XML(docxml.root.to_xml).root)
@@ -164,7 +156,6 @@ module IsoDoc
164
156
  start = node.at("./text()[1]")
165
157
  finish = node.at("./text()[last()]")
166
158
  (/^\[/.match?(start.text) && /\]$/.match?(finish.text)) or return
167
-
168
159
  start.replace(start.text[1..-1])
169
160
  node.previous = "["
170
161
  finish = node.at("./text()[last()]")
@@ -181,8 +172,7 @@ module IsoDoc
181
172
 
182
173
  # notes and remarques (list notes) are not numbered
183
174
  def note1(elem)
184
- return if elem.parent.name == "bibitem" || elem["notag"] == "true"
185
-
175
+ elem.parent.name == "bibitem" || elem["notag"] == "true" and return
186
176
  lbl = l10n(note_label(elem))
187
177
  prefix_name(elem, "", lbl, "name")
188
178
  end
@@ -191,29 +181,57 @@ module IsoDoc
191
181
  if elem.ancestors("preface").empty?
192
182
  if elem.ancestors("ul, ol, dl").empty?
193
183
  @i18n.note
194
- else
195
- @i18n.listnote
196
- end
197
- else
198
- @i18n.prefacenote
184
+ else @i18n.listnote end
185
+ else @i18n.prefacenote
199
186
  end
200
187
  end
201
188
 
202
189
  def termsource1(elem)
190
+ # elem["status"] == "modified" and return super
203
191
  while elem&.next_element&.name == "termsource"
204
192
  elem << "; #{to_xml(elem.next_element.remove.children)}"
205
193
  end
206
- elem.children = l10n("[#{@i18n.source} #{to_xml(elem.children).strip}]")
194
+ elem.children = l10n("[#{termsource_adapt(elem['status'])}" \
195
+ "#{to_xml(elem.children).strip}]")
196
+ end
197
+
198
+ def termsource_adapt(status)
199
+ case status
200
+ when "adapted" then @i18n.adapted_from
201
+ when "modified" then @i18n.modified_from
202
+ else ""
203
+ end
204
+ end
205
+
206
+ def termsource(docxml)
207
+ termsource_insert_empty_modification(docxml)
208
+ super
209
+ end
210
+
211
+ def termsource_insert_empty_modification(docxml)
212
+ docxml.xpath("//xmlns:termsource[@status = 'modified']" \
213
+ "[not(xmlns:modification)]").each do |f|
214
+ f << "<modification/>"
215
+ end
216
+ end
217
+
218
+ def termsource_modification(elem)
219
+ if elem["status"] == "modified"
220
+ origin = elem.at(ns("./origin"))
221
+ # s = termsource_status(elem["status"]) and origin.next = l10n(", #{s}")
222
+ end
223
+ termsource_add_modification_text(elem.at(ns("./modification")))
207
224
  end
208
225
 
209
- def norm_ref_entry_code(_ordinal, identifiers, _ids, _standard, datefn, _bib)
226
+ def norm_ref_entry_code(_ordinal, identifiers, _ids, _standard, datefn,
227
+ _bib)
210
228
  ret = (identifiers[0] || identifiers[1])
211
229
  ret += " #{identifiers[1]}" if identifiers[0] && identifiers[1]
212
230
  "#{ret}#{datefn} "
213
231
  end
214
232
 
215
- def biblio_ref_entry_code(ordinal, ids, _id, standard, datefn, _bib)
216
- #standard and id = nil
233
+ def biblio_ref_entry_code(ordinal, ids, _id, _standard, datefn, _bib)
234
+ # standard and id = nil
217
235
  ret = (ids[:ordinal] || ids[:metanorma] || "[#{ordinal}]")
218
236
  if ids[:sdo]
219
237
  ret = prefix_bracketed_ref(ret)
@@ -0,0 +1,15 @@
1
+ == copyright-statement
2
+ === {blank}
3
+
4
+ [align=center]
5
+ © Bureau International des Poids et Mesures {{ docyear }} all rights reserved
6
+
7
+ == license-statement
8
+ === Copyright statement
9
+ This document is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/:[]), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
10
+
11
+ == feedback-statement
12
+ BIPM +
13
+ Pavillon de Breteuil +
14
+ F-92312 Sèvres Cedex +
15
+ FRANCE
@@ -0,0 +1,14 @@
1
+ == copyright-statement
2
+ === {blank}
3
+ [align="center"]
4
+ © Bureau international des poids et mesures {{ docyear }} tous droits réservés
5
+
6
+ == license-statement
7
+ === Note concernant les droits d’auteur
8
+ Ce document est distribué selon les termes et conditions de la licence Creative Commons Attribution 4.0 International (http://creativecommons.org/licenses/by/4.0/:[]), qui permet l’utilisation sans restriction, la distribution et la reproduction sur quelque support que soit, sous réserve de mentionner dûment l’auteur ou les auteurs originaux ainsi que la source de l’œuvre, d’intégrer un lien vers la licence Creative Commons et d’indiquer si des modifications ont été effectuées.
9
+
10
+ == feedback-statement
11
+ BIPM +
12
+ Pavillon de Breteuil +
13
+ F-92312 Sèvres Cedex +
14
+ FRANCE
@@ -0,0 +1,32 @@
1
+ == copyright-statement
2
+ === {blank}
3
+ © JCGM {{ docyear }}
4
+
5
+ Copyright of this JCGM guidance document is shared jointly by the JCGM member organizations (BIPM, IEC,
6
+ IFCC, ILAC, ISO, IUPAC, IUPAP and OIML).
7
+
8
+ == license-statement
9
+ === Copyright
10
+ Even if electronic versions are available free of charge on the website of one or more of the JCGM member organizations, economic and moral copyrights related to all JCGM publications are internationally protected. The JCGM does not, without its written authorisation, permit third parties to rewrite or re-brand issues, to sell copies to the public, or to broadcast or use on-line its publications. Equally, the JCGM also objects to distortion, augmentation or mutilation of its publications, including its titles, slogans and logos, and those of its member organizations.
11
+
12
+ === Official versions and translations
13
+ The only official versions of documents are those published by the JCGM, in their original languages.
14
+
15
+ The JCGM’s publications may be translated into languages other than those in which the documents were originally published by the JCGM. Permission must be obtained from the JCGM before a translation can be made. All translations should respect the original and official format of the formulae and units (without any conversion to other formulae or units), and contain the following statement (to be translated into the chosen language):
16
+
17
+ ____
18
+ All JCGM’s products are internationally protected by copyright. This translation of the original JCGM document has been produced with the permission of the JCGM. The JCGM retains full internationally protected copyright on the design and content of this document and on the JCGM’s titles, slogan and logos. The member organizations of the JCGM also retain full internationally protected right on their titles, slogans and logos included in the JCGM’s publications. The only official version is the document published by the JCGM, in the original languages.
19
+ ____
20
+
21
+ The JCGM does not accept any liability for the relevance, accuracy, completeness or quality of the information and materials offered in any translation. A copy of the translation shall be provided to the JCGM at the time of publication.
22
+
23
+ === Reproduction
24
+ The JCGM’s publications may be reproduced, provided written permission has been granted by the JCGM. A sample of any reproduced document shall be provided to the JCGM at the time of reproduction and contain the following statement:A
25
+
26
+ ____
27
+ This document is reproduced with the permission of the JCGM, which retains full internationally protected copyright on the design and content of this document and on the JCGM’s titles, slogans and logos. The member organizations of the JCGM also retain full internationally protected right on their titles, slogans and logos included in the JCGM’s publications. The only official versions are the original versions of the documents published by the JCGM.
28
+ ____
29
+
30
+ == legal-statement
31
+ === Disclaimer
32
+ The JCGM and its member organizations have published this document to enhance access to information about metrology. They endeavor to update it on a regular basis, but cannot guarantee the accuracy at all times and shall not be responsible for any direct or indirect damage that may result from its use. Any reference to commercial products of any kind (including but not restricted to any software, data or hardware) or links to websites, over which the JCGM and its member organizations have no control and for which they assume no responsibility, does not imply any approval, endorsement or recommendation by the JCGM and its member organizations.
@@ -96,10 +96,12 @@ module Metanorma
96
96
  end
97
97
  end
98
98
 
99
- def boilerplate_file(xmldoc)
100
- return super unless @jcgm
101
-
102
- File.join(File.dirname(__FILE__), "boilerplate-jcgm-en.xml")
99
+ def boilerplate_file(_xmldoc)
100
+ if @jcgm
101
+ File.join(File.dirname(__FILE__), "boilerplate-jcgm-en.adoc")
102
+ else
103
+ File.join(File.dirname(__FILE__), "boilerplate-#{@lang}.adoc")
104
+ end
103
105
  end
104
106
 
105
107
  def sections_cleanup(xml)
@@ -1012,6 +1012,7 @@
1012
1012
  <ref name="del"/>
1013
1013
  <ref name="span"/>
1014
1014
  <ref name="erefstack"/>
1015
+ <ref name="date_inline"/>
1015
1016
  </choice>
1016
1017
  </define>
1017
1018
  <define name="add">
@@ -1053,6 +1054,23 @@
1053
1054
  </oneOrMore>
1054
1055
  </element>
1055
1056
  </define>
1057
+ <define name="date_inline">
1058
+ <element name="date">
1059
+ <attribute name="value"/>
1060
+ <optional>
1061
+ <attribute name="format"/>
1062
+ </optional>
1063
+ <optional>
1064
+ <attribute name="language"/>
1065
+ </optional>
1066
+ <optional>
1067
+ <attribute name="script"/>
1068
+ </optional>
1069
+ <optional>
1070
+ <attribute name="locale"/>
1071
+ </optional>
1072
+ </element>
1073
+ </define>
1056
1074
  <define name="concept">
1057
1075
  <element name="concept">
1058
1076
  <optional>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module BIPM
3
- VERSION = "2.2.10".freeze
3
+ VERSION = "2.2.12".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.2.10
4
+ version: 2.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-22 00:00:00.000000000 Z
11
+ date: 2023-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -266,9 +266,9 @@ files:
266
266
  - lib/metanorma/bipm/biblio-standoc.rng
267
267
  - lib/metanorma/bipm/biblio.rng
268
268
  - lib/metanorma/bipm/bipm.rng
269
- - lib/metanorma/bipm/boilerplate-en.xml
270
- - lib/metanorma/bipm/boilerplate-fr.xml
271
- - lib/metanorma/bipm/boilerplate-jcgm-en.xml
269
+ - lib/metanorma/bipm/boilerplate-en.adoc
270
+ - lib/metanorma/bipm/boilerplate-fr.adoc
271
+ - lib/metanorma/bipm/boilerplate-jcgm-en.adoc
272
272
  - lib/metanorma/bipm/converter.rb
273
273
  - lib/metanorma/bipm/front.rb
274
274
  - lib/metanorma/bipm/isodoc.rng
@@ -1,20 +0,0 @@
1
- <boilerplate>
2
- <copyright-statement>
3
- <clause>
4
- <p align="center"> © Bureau International des Poids et Mesures {{ docyear }} all rights reserved</p>
5
- </clause>
6
- </copyright-statement>
7
- <license-statement>
8
- <clause>
9
- <title>Copyright statement</title>
10
- <p>This document is distributed under the terms of the Creative Commons Attribution 4.0 International License (<link target="http://creativecommons.org/licenses/by/4.0/"/>), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.</p>
11
- </clause>
12
- </license-statement>
13
- <feedback-statement>
14
- <p>BIPM<br/>
15
- Pavillon de Breteuil<br/>
16
- F-92312 Sèvres Cedex<br/>
17
- FRANCE</p>
18
- </feedback-statement>
19
- </boilerplate>
20
-
@@ -1,20 +0,0 @@
1
- <boilerplate>
2
- <copyright-statement>
3
- <clause>
4
- <p align="center"> © Bureau international des poids et mesures {{ docyear }} tous droits réservés</p>
5
- </clause>
6
- </copyright-statement>
7
- <license-statement>
8
- <clause>
9
- <title>Note concernant les droits d’auteur</title>
10
- <p>Ce document est distribué selon les termes et conditions de la licence Creative Commons Attribution 4.0 International (<link target="http://creativecommons.org/licenses/by/4.0/"/>), qui permet l’utilisation sans restriction, la distribution et la reproduction sur quelque support que soit, sous réserve de mentionner dûment l’auteur ou les auteurs originaux ainsi que la source de l’œuvre, d’intégrer un lien vers la licence Creative Commons et d’indiquer si des modifications ont été effectuées.</p>
11
- </clause>
12
- </license-statement>
13
- <feedback-statement>
14
- <p>BIPM<br/>
15
- Pavillon de Breteuil<br/>
16
- F-92312 Sèvres Cedex<br/>
17
- FRANCE</p>
18
- </feedback-statement>
19
- </boilerplate>
20
-
@@ -1,37 +0,0 @@
1
- <boilerplate>
2
- <copyright-statement>
3
- <clause>
4
- <p> © JCGM {{ docyear }} </p>
5
- <p>Copyright of this JCGM guidance document is shared jointly by the JCGM member organizations (BIPM, IEC,
6
- IFCC, ILAC, ISO, IUPAC, IUPAP and OIML).</p>
7
- </clause>
8
- </copyright-statement>
9
- <license-statement>
10
- <clause>
11
- <title>Copyright</title>
12
- <p>Even if electronic versions are available free of charge on the website of one or more of the JCGM member organizations, economic and moral copyrights related to all JCGM publications are internationally protected. The JCGM does not, without its written authorisation, permit third parties to rewrite or re-brand issues, to sell copies to the public, or to broadcast or use on-line its publications. Equally, the JCGM also objects to distortion, augmentation or mutilation of its publications, including its titles, slogans and logos, and those of its member organizations.</p>
13
- </clause>
14
- <clause>
15
- <title>Official versions and translations</title>
16
- <p>The only official versions of documents are those published by the JCGM, in their original languages.</p>
17
-
18
- <p>The JCGM’s publications may be translated into languages other than those in which the documents were originally published by the JCGM. Permission must be obtained from the JCGM before a translation can be made. All translations should respect the original and official format of the formulae and units (without any conversion to other formulae or units), and contain the following statement (to be translated into the chosen language):</p>
19
-
20
- <quote>All JCGM’s products are internationally protected by copyright. This translation of the original JCGM document has been produced with the permission of the JCGM. The JCGM retains full internationally protected copyright on the design and content of this document and on the JCGM’s titles, slogan and logos. The member organizations of the JCGM also retain full internationally protected right on their titles, slogans and logos included in the JCGM’s publications. The only official version is the document published by the JCGM, in the original languages.</quote>
21
-
22
- <p>The JCGM does not accept any liability for the relevance, accuracy, completeness or quality of the information and materials offered in any translation. A copy of the translation shall be provided to the JCGM at the time of publication.</p>
23
- </clause>
24
- <clause>
25
- <title>Reproduction</title>
26
- <p>The JCGM’s publications may be reproduced, provided written permission has been granted by the JCGM. A sample of any reproduced document shall be provided to the JCGM at the time of reproduction and contain the following statement:</p>
27
- <quote>This document is reproduced with the permission of the JCGM, which retains full internationally protected copyright on the design and content of this document and on the JCGM’s titles, slogans and logos. The member organizations of the JCGM also retain full internationally protected right on their titles, slogans and logos included in the JCGM’s publications. The only official versions are the original versions of the documents published by the JCGM.</quote>
28
- </clause>
29
- </license-statement>
30
- <legal-statement>
31
- <clause>
32
- <title>Disclaimer</title>
33
- <p>The JCGM and its member organizations have published this document to enhance access to information about metrology. They endeavor to update it on a regular basis, but cannot guarantee the accuracy at all times and shall not be responsible for any direct or indirect damage that may result from its use. Any reference to commercial products of any kind (including but not restricted to any software, data or hardware) or links to websites, over which the JCGM and its member organizations have no control and for which they assume no responsibility, does not imply any approval, endorsement or recommendation by the JCGM and its member organizations.</p>
34
- </clause>
35
- </legal-statement>
36
- </boilerplate>
37
-