metanorma-bipm 0.0.5 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +3 -0
- data/lib/asciidoctor/bipm/basicdoc.rng +52 -3
- data/lib/asciidoctor/bipm/bipm.rng +8 -1
- data/lib/asciidoctor/bipm/boilerplate-en.xml +1 -1
- data/lib/asciidoctor/bipm/boilerplate-fr.xml +1 -1
- data/lib/asciidoctor/bipm/boilerplate-jcgm-en.xml +37 -0
- data/lib/asciidoctor/bipm/converter.rb +28 -17
- data/lib/asciidoctor/bipm/isodoc.rng +114 -3
- data/lib/isodoc/bipm/base_convert.rb +20 -7
- data/lib/isodoc/bipm/bipm.brochure.xsl +1337 -511
- data/lib/isodoc/bipm/bipm.guide.xsl +1337 -511
- data/lib/isodoc/bipm/bipm.mise-en-pratique.xsl +1337 -511
- data/lib/isodoc/bipm/bipm.rapport.xsl +1337 -511
- data/lib/isodoc/bipm/html/html_bipm_intro.html +1 -1
- data/lib/isodoc/bipm/html/html_bipm_titlepage.html +3 -0
- data/lib/isodoc/bipm/i18n-en.yaml +2 -0
- data/lib/isodoc/bipm/i18n-fr.yaml +6 -4
- data/lib/isodoc/bipm/index.rb +136 -0
- data/lib/isodoc/bipm/jcgm.standard.xsl +5943 -0
- data/lib/isodoc/bipm/metadata.rb +5 -1
- data/lib/isodoc/bipm/pdf_convert.rb +10 -1
- data/lib/isodoc/bipm/presentation_xml_convert.rb +5 -0
- data/lib/isodoc/bipm/xref.rb +24 -13
- data/lib/metanorma/bipm/processor.rb +11 -0
- data/lib/metanorma/bipm/version.rb +1 -1
- data/metanorma-bipm.gemspec +1 -1
- data/metanorma.yml +7 -3
- metadata +8 -6
- data/lib/metanorma/bipm/fonts_manifest.yaml +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be68aaa802943c019afdfd6279a33269e9de8e9c2a9ece29a311e08e6c465355
|
4
|
+
data.tar.gz: 96b2dc9464927ae543c7a4ce10a705b14647ca79db313ff503e6856c1ce788b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de26de8eb2254291733038b0598e7dade4f27378ff1285a42d5957c95d14d02202df44ebfcb7a0072eb2760985a6d1c4c0d3feb860aa218f6eb34a0737a4dbf7
|
7
|
+
data.tar.gz: 447a238c927f5a14a655acbc0c52a4f33c3db5513eddf208ac6c564a6429786e62c53308e4adf0de5e15a0c26dfda28d29c9f855355dbe9bc1f6f7b98403787e
|
data/.github/workflows/rake.yml
CHANGED
@@ -596,6 +596,7 @@
|
|
596
596
|
<ref name="bookmark"/>
|
597
597
|
<ref name="image"/>
|
598
598
|
<ref name="index"/>
|
599
|
+
<ref name="index-xref"/>
|
599
600
|
</choice>
|
600
601
|
</define>
|
601
602
|
<define name="PureTextElement">
|
@@ -728,13 +729,61 @@
|
|
728
729
|
</define>
|
729
730
|
<define name="index">
|
730
731
|
<element name="index">
|
731
|
-
<attribute name="primary"/>
|
732
732
|
<optional>
|
733
|
-
<attribute name="
|
733
|
+
<attribute name="to">
|
734
|
+
<data type="IDREF"/>
|
735
|
+
</attribute>
|
736
|
+
</optional>
|
737
|
+
<element name="primary">
|
738
|
+
<oneOrMore>
|
739
|
+
<ref name="PureTextElement"/>
|
740
|
+
</oneOrMore>
|
741
|
+
</element>
|
742
|
+
<optional>
|
743
|
+
<element name="secondary">
|
744
|
+
<oneOrMore>
|
745
|
+
<ref name="PureTextElement"/>
|
746
|
+
</oneOrMore>
|
747
|
+
</element>
|
748
|
+
</optional>
|
749
|
+
<optional>
|
750
|
+
<element name="tertiary">
|
751
|
+
<oneOrMore>
|
752
|
+
<ref name="PureTextElement"/>
|
753
|
+
</oneOrMore>
|
754
|
+
</element>
|
755
|
+
</optional>
|
756
|
+
</element>
|
757
|
+
</define>
|
758
|
+
<define name="index-xref">
|
759
|
+
<element name="index-xref">
|
760
|
+
<attribute name="also">
|
761
|
+
<data type="boolean"/>
|
762
|
+
</attribute>
|
763
|
+
<element name="primary">
|
764
|
+
<oneOrMore>
|
765
|
+
<ref name="PureTextElement"/>
|
766
|
+
</oneOrMore>
|
767
|
+
</element>
|
768
|
+
<optional>
|
769
|
+
<element name="secondary">
|
770
|
+
<oneOrMore>
|
771
|
+
<ref name="PureTextElement"/>
|
772
|
+
</oneOrMore>
|
773
|
+
</element>
|
734
774
|
</optional>
|
735
775
|
<optional>
|
736
|
-
<
|
776
|
+
<element name="tertiary">
|
777
|
+
<oneOrMore>
|
778
|
+
<ref name="PureTextElement"/>
|
779
|
+
</oneOrMore>
|
780
|
+
</element>
|
737
781
|
</optional>
|
782
|
+
<element name="target">
|
783
|
+
<oneOrMore>
|
784
|
+
<ref name="PureTextElement"/>
|
785
|
+
</oneOrMore>
|
786
|
+
</element>
|
738
787
|
</element>
|
739
788
|
</define>
|
740
789
|
<!-- bare ID element, used for referencing arbitrary spans of text -->
|
@@ -47,6 +47,11 @@
|
|
47
47
|
<data type="boolean"/>
|
48
48
|
</attribute>
|
49
49
|
</optional>
|
50
|
+
<optional>
|
51
|
+
<attribute name="nopage">
|
52
|
+
<data type="boolean"/>
|
53
|
+
</attribute>
|
54
|
+
</optional>
|
50
55
|
<text/>
|
51
56
|
</element>
|
52
57
|
</define>
|
@@ -338,7 +343,9 @@
|
|
338
343
|
<optional>
|
339
344
|
<ref name="boilerplate"/>
|
340
345
|
</optional>
|
341
|
-
<
|
346
|
+
<optional>
|
347
|
+
<ref name="preface"/>
|
348
|
+
</optional>
|
342
349
|
<oneOrMore>
|
343
350
|
<ref name="sections"/>
|
344
351
|
</oneOrMore>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<boilerplate>
|
2
2
|
<copyright-statement>
|
3
3
|
<clause>
|
4
|
-
<p align="center"> © Bureau International des
|
4
|
+
<p align="center"> © Bureau International des Poids et Mesures {{ docyear }} all rights reserved</p>
|
5
5
|
</clause>
|
6
6
|
</copyright-statement>
|
7
7
|
<license-statement>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<boilerplate>
|
2
2
|
<copyright-statement>
|
3
3
|
<clause>
|
4
|
-
<p align="center"> © Bureau
|
4
|
+
<p align="center"> © Bureau international des poids et mesures {{ docyear }} tous droits réservés</p>
|
5
5
|
</clause>
|
6
6
|
</copyright-statement>
|
7
7
|
<license-statement>
|
@@ -0,0 +1,37 @@
|
|
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
|
+
|
@@ -10,6 +10,18 @@ module Asciidoctor
|
|
10
10
|
Metanorma::BIPM.configuration
|
11
11
|
end
|
12
12
|
|
13
|
+
def org_name_long
|
14
|
+
configuration.organization_name_long[@lang]
|
15
|
+
end
|
16
|
+
|
17
|
+
def default_publisher
|
18
|
+
org_name_long
|
19
|
+
end
|
20
|
+
|
21
|
+
def org_abbrev
|
22
|
+
{ org_name_long => configuration.organization_name_short }
|
23
|
+
end
|
24
|
+
|
13
25
|
def metadata_committee(node, xml)
|
14
26
|
return unless node.attr("committee-en") || node.attr("committee-fr")
|
15
27
|
xml.editorialgroup do |a|
|
@@ -30,14 +42,10 @@ module Asciidoctor
|
|
30
42
|
|
31
43
|
def metadata_committee2(node, a)
|
32
44
|
i = 2
|
33
|
-
while node.attr("committee-en_#{i}") ||
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
e = node.attr("committee-en_#{i}") and
|
38
|
-
c.variant e, language: "en", script: "Latn"
|
39
|
-
e = node.attr("committee-fr_#{i}") and
|
40
|
-
c.variant e, language: "fr", script: "Latn"
|
45
|
+
while node.attr("committee-en_#{i}") || node.attr("committee-fr_#{i}") do
|
46
|
+
a.committee **attr_code(acronym: node.attr("committee-acronym_#{i}")) do |c|
|
47
|
+
e = node.attr("committee-en_#{i}") and c.variant e, language: "en", script: "Latn"
|
48
|
+
e = node.attr("committee-fr_#{i}") and c.variant e, language: "fr", script: "Latn"
|
41
49
|
end
|
42
50
|
i += 1
|
43
51
|
end
|
@@ -96,13 +104,11 @@ module Asciidoctor
|
|
96
104
|
["en", "fr"].each do |lang|
|
97
105
|
at = { language: lang, format: "text/plain" }
|
98
106
|
xml.title **attr_code(at.merge(type: "main")) do |t1|
|
99
|
-
t1 <<
|
100
|
-
|
107
|
+
t1 << Metanorma::Utils::asciidoc_sub(node.attr("title-#{lang}"))
|
108
|
+
end
|
109
|
+
%w(cover appendix annex part subpart).each do |w|
|
110
|
+
typed_title(node, xml, lang, w)
|
101
111
|
end
|
102
|
-
typed_title(node, xml, lang, "cover")
|
103
|
-
typed_title(node, xml, lang, "appendix")
|
104
|
-
typed_title(node, xml, lang, "part")
|
105
|
-
typed_title(node, xml, lang, "subpart")
|
106
112
|
end
|
107
113
|
end
|
108
114
|
|
@@ -110,7 +116,7 @@ module Asciidoctor
|
|
110
116
|
at = { language: lang, format: "text/plain" }
|
111
117
|
return unless title = node.attr("title-#{type}-#{lang}")
|
112
118
|
xml.title **attr_code(at.merge(type: type)) do |t1|
|
113
|
-
t1 <<
|
119
|
+
t1 << Metanorma::Utils::asciidoc_sub(title)
|
114
120
|
end
|
115
121
|
end
|
116
122
|
|
@@ -123,7 +129,7 @@ module Asciidoctor
|
|
123
129
|
end
|
124
130
|
|
125
131
|
def inline_anchor_xref_attrs(node)
|
126
|
-
flags = %w(pagenumber nosee).each_with_object({}) do |w, m|
|
132
|
+
flags = %w(pagenumber nosee nopage).each_with_object({}) do |w, m|
|
127
133
|
if /#{w}%/.match(node.text)
|
128
134
|
node.text = node.text.sub(/#{w}%/, "")
|
129
135
|
m[w] = true
|
@@ -166,6 +172,11 @@ module Asciidoctor
|
|
166
172
|
end
|
167
173
|
end
|
168
174
|
|
175
|
+
def boilerplate_file(xmldoc)
|
176
|
+
return super unless xmldoc&.at("//bibdata/ext/editorialgroup/committee/@acronym")&.value == "JCGM"
|
177
|
+
baselocation("lib/asciidoctor/bipm/boilerplate-jcgm-en.xml")
|
178
|
+
end
|
179
|
+
|
169
180
|
def mathml_mi_italics
|
170
181
|
{ uppergreek: false, upperroman: false,
|
171
182
|
lowergreek: false, lowerroman: true }
|
@@ -192,6 +203,6 @@ module Asciidoctor
|
|
192
203
|
return nil if node.attr("no-pdf")
|
193
204
|
IsoDoc::BIPM::PdfConvert.new(doc_extract_attributes(node))
|
194
205
|
end
|
195
|
-
end
|
196
206
|
end
|
197
207
|
end
|
208
|
+
end
|
@@ -55,6 +55,13 @@
|
|
55
55
|
<param name="pattern">\i\c*|\c+#\c+</param>
|
56
56
|
</data>
|
57
57
|
</attribute>
|
58
|
+
<optional>
|
59
|
+
<attribute name="to">
|
60
|
+
<data type="string">
|
61
|
+
<param name="pattern">\i\c*|\c+#\c+</param>
|
62
|
+
</data>
|
63
|
+
</attribute>
|
64
|
+
</optional>
|
58
65
|
<optional>
|
59
66
|
<attribute name="type">
|
60
67
|
<ref name="ReferenceFormat"/>
|
@@ -246,6 +253,12 @@
|
|
246
253
|
<data type="boolean"/>
|
247
254
|
</attribute>
|
248
255
|
</optional>
|
256
|
+
<optional>
|
257
|
+
<attribute name="width"/>
|
258
|
+
</optional>
|
259
|
+
<optional>
|
260
|
+
<ref name="colgroup"/>
|
261
|
+
</optional>
|
249
262
|
<optional>
|
250
263
|
<ref name="tname"/>
|
251
264
|
</optional>
|
@@ -764,6 +777,21 @@
|
|
764
777
|
</define>
|
765
778
|
</include>
|
766
779
|
<!-- end overrides -->
|
780
|
+
<define name="colgroup">
|
781
|
+
<element name="colgroup">
|
782
|
+
<oneOrMore>
|
783
|
+
<ref name="col"/>
|
784
|
+
</oneOrMore>
|
785
|
+
</element>
|
786
|
+
</define>
|
787
|
+
<define name="col">
|
788
|
+
<element name="col">
|
789
|
+
<attribute name="width"/>
|
790
|
+
</element>
|
791
|
+
</define>
|
792
|
+
<define name="BibItemType" combine="choice">
|
793
|
+
<value>internal</value>
|
794
|
+
</define>
|
767
795
|
<define name="TextElement" combine="choice">
|
768
796
|
<ref name="concept"/>
|
769
797
|
</define>
|
@@ -784,6 +812,8 @@
|
|
784
812
|
<ref name="requirement"/>
|
785
813
|
<ref name="recommendation"/>
|
786
814
|
<ref name="permission"/>
|
815
|
+
<ref name="imagemap"/>
|
816
|
+
<ref name="svgmap"/>
|
787
817
|
</choice>
|
788
818
|
</define>
|
789
819
|
<define name="bibliography">
|
@@ -814,6 +844,9 @@
|
|
814
844
|
<data type="boolean"/>
|
815
845
|
</attribute>
|
816
846
|
</optional>
|
847
|
+
<optional>
|
848
|
+
<attribute name="number"/>
|
849
|
+
</optional>
|
817
850
|
<optional>
|
818
851
|
<attribute name="obligation">
|
819
852
|
<choice>
|
@@ -869,9 +902,11 @@
|
|
869
902
|
<element name="code">
|
870
903
|
<text/>
|
871
904
|
</element>
|
872
|
-
<
|
873
|
-
<text
|
874
|
-
|
905
|
+
<optional>
|
906
|
+
<element name="text">
|
907
|
+
<text/>
|
908
|
+
</element>
|
909
|
+
</optional>
|
875
910
|
</element>
|
876
911
|
</define>
|
877
912
|
<define name="standard-document">
|
@@ -1041,6 +1076,9 @@
|
|
1041
1076
|
</choice>
|
1042
1077
|
</attribute>
|
1043
1078
|
</optional>
|
1079
|
+
<optional>
|
1080
|
+
<attribute name="number"/>
|
1081
|
+
</optional>
|
1044
1082
|
<optional>
|
1045
1083
|
<attribute name="type"/>
|
1046
1084
|
</optional>
|
@@ -1094,6 +1132,9 @@
|
|
1094
1132
|
<optional>
|
1095
1133
|
<attribute name="type"/>
|
1096
1134
|
</optional>
|
1135
|
+
<optional>
|
1136
|
+
<attribute name="number"/>
|
1137
|
+
</optional>
|
1097
1138
|
<optional>
|
1098
1139
|
<ref name="section-title"/>
|
1099
1140
|
</optional>
|
@@ -1196,6 +1237,9 @@
|
|
1196
1237
|
<optional>
|
1197
1238
|
<attribute name="type"/>
|
1198
1239
|
</optional>
|
1240
|
+
<optional>
|
1241
|
+
<attribute name="number"/>
|
1242
|
+
</optional>
|
1199
1243
|
<optional>
|
1200
1244
|
<attribute name="obligation">
|
1201
1245
|
<choice>
|
@@ -1524,6 +1568,7 @@
|
|
1524
1568
|
<value>add</value>
|
1525
1569
|
<value>modify</value>
|
1526
1570
|
<value>delete</value>
|
1571
|
+
<value>replace</value>
|
1527
1572
|
</choice>
|
1528
1573
|
</attribute>
|
1529
1574
|
<optional>
|
@@ -1554,6 +1599,11 @@
|
|
1554
1599
|
</optional>
|
1555
1600
|
<optional>
|
1556
1601
|
<element name="newcontent">
|
1602
|
+
<optional>
|
1603
|
+
<attribute name="id">
|
1604
|
+
<data type="ID"/>
|
1605
|
+
</attribute>
|
1606
|
+
</optional>
|
1557
1607
|
<zeroOrMore>
|
1558
1608
|
<ref name="BasicBlock"/>
|
1559
1609
|
</zeroOrMore>
|
@@ -1587,4 +1637,65 @@
|
|
1587
1637
|
<text/>
|
1588
1638
|
</element>
|
1589
1639
|
</define>
|
1640
|
+
<define name="imagemap">
|
1641
|
+
<element name="imagemap">
|
1642
|
+
<ref name="figure"/>
|
1643
|
+
<zeroOrMore>
|
1644
|
+
<element name="area">
|
1645
|
+
<attribute name="type">
|
1646
|
+
<choice>
|
1647
|
+
<value>rect</value>
|
1648
|
+
<value>circle</value>
|
1649
|
+
<value>ellipse</value>
|
1650
|
+
<value>poly</value>
|
1651
|
+
</choice>
|
1652
|
+
</attribute>
|
1653
|
+
<choice>
|
1654
|
+
<ref name="xref"/>
|
1655
|
+
<ref name="hyperlink"/>
|
1656
|
+
<ref name="eref"/>
|
1657
|
+
</choice>
|
1658
|
+
<oneOrMore>
|
1659
|
+
<element name="coords">
|
1660
|
+
<attribute name="x">
|
1661
|
+
<data type="float"/>
|
1662
|
+
</attribute>
|
1663
|
+
<attribute name="y">
|
1664
|
+
<data type="float"/>
|
1665
|
+
</attribute>
|
1666
|
+
</element>
|
1667
|
+
</oneOrMore>
|
1668
|
+
<optional>
|
1669
|
+
<element name="radius">
|
1670
|
+
<attribute name="x">
|
1671
|
+
<data type="float"/>
|
1672
|
+
</attribute>
|
1673
|
+
<optional>
|
1674
|
+
<attribute name="y">
|
1675
|
+
<data type="float"/>
|
1676
|
+
</attribute>
|
1677
|
+
</optional>
|
1678
|
+
</element>
|
1679
|
+
</optional>
|
1680
|
+
</element>
|
1681
|
+
</zeroOrMore>
|
1682
|
+
</element>
|
1683
|
+
</define>
|
1684
|
+
<define name="svgmap">
|
1685
|
+
<element name="svgmap">
|
1686
|
+
<ref name="figure"/>
|
1687
|
+
<zeroOrMore>
|
1688
|
+
<element name="target">
|
1689
|
+
<attribute name="href">
|
1690
|
+
<data type="anyURI"/>
|
1691
|
+
</attribute>
|
1692
|
+
<choice>
|
1693
|
+
<ref name="xref"/>
|
1694
|
+
<ref name="hyperlink"/>
|
1695
|
+
<ref name="eref"/>
|
1696
|
+
</choice>
|
1697
|
+
</element>
|
1698
|
+
</zeroOrMore>
|
1699
|
+
</element>
|
1700
|
+
</define>
|
1590
1701
|
</grammar>
|