metanorma-bipm 1.0.0 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1124fc9a829ea0ff6c013bbba40f1c24d3a3c832f032c3457618e5c111b80b1c
4
- data.tar.gz: 0d321b641c701353e57d8f7666e769ef3eb4a429d14403682996ec908d434e96
3
+ metadata.gz: c0b4698a24ef97618afbec45c35c528cadb9552b49d1dcd89bd15ad7c8a6876a
4
+ data.tar.gz: 96c9a111515b7df05186ffae09bcf19c5409929ea13809499ec583a3e97da0cd
5
5
  SHA512:
6
- metadata.gz: c6f9597091c23cfd4543d2a7c7085e464723344c46f321083dbabfb7e64ac00b55cf0104a76fe5c5f3b1904df2878656e036308dba3687574054ae4d9f3dcd52
7
- data.tar.gz: f453d61d6c061490a1dd831c34350fb5aa98fef65766695c42c4c8e9534572d91a1d20324b9ba5b778a75cc3aa2fb0f73dca9bb3866462acf0338ada116d9b01
6
+ metadata.gz: 7d76e1b157bbe5c6fbff33ac87424c239965e9c1fa6ea6649a2dd5098b72460c988b92235ed0149400996c6d4a339409cdda396f271a7f08a0d8a00b9b689395
7
+ data.tar.gz: 995c9cb871a5b5ca91d00f370d1d6bc0ff0c7040c8362300bfd77c52978e9a479edf5deb242b837d21f2755be6cf6980110fd5c87b39c0d161dbe1c7b70a6c6e
@@ -36,6 +36,9 @@ jobs:
36
36
  with:
37
37
  ruby-version: ${{ matrix.ruby }}
38
38
 
39
+ - if: matrix.os == 'macos-latest'
40
+ run: brew install autoconf automake libtool
41
+
39
42
  - uses: actions/cache@v2
40
43
  with:
41
44
  path: vendor/bundle
@@ -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="secondary"/>
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
- <attribute name="tertiary"/>
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>
@@ -335,10 +340,15 @@
335
340
  <zeroOrMore>
336
341
  <ref name="termdocsource"/>
337
342
  </zeroOrMore>
343
+ <optional>
344
+ <ref name="misccontainer"/>
345
+ </optional>
338
346
  <optional>
339
347
  <ref name="boilerplate"/>
340
348
  </optional>
341
- <ref name="preface"/>
349
+ <optional>
350
+ <ref name="preface"/>
351
+ </optional>
342
352
  <oneOrMore>
343
353
  <ref name="sections"/>
344
354
  </oneOrMore>
@@ -348,6 +358,9 @@
348
358
  <optional>
349
359
  <ref name="bibliography"/>
350
360
  </optional>
361
+ <zeroOrMore>
362
+ <ref name="indexsect"/>
363
+ </zeroOrMore>
351
364
  </element>
352
365
  </define>
353
366
  </grammar>
@@ -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
+
@@ -42,14 +42,10 @@ module Asciidoctor
42
42
 
43
43
  def metadata_committee2(node, a)
44
44
  i = 2
45
- while node.attr("committee-en_#{i}") ||
46
- node.attr("committee-fr_#{i}") do
47
- a.committee **attr_code(acronym:
48
- node.attr("committee-acronym_#{i}")) do |c|
49
- e = node.attr("committee-en_#{i}") and
50
- c.variant e, language: "en", script: "Latn"
51
- e = node.attr("committee-fr_#{i}") and
52
- 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"
53
49
  end
54
50
  i += 1
55
51
  end
@@ -108,13 +104,11 @@ module Asciidoctor
108
104
  ["en", "fr"].each do |lang|
109
105
  at = { language: lang, format: "text/plain" }
110
106
  xml.title **attr_code(at.merge(type: "main")) do |t1|
111
- t1 << Asciidoctor::Standoc::Utils::asciidoc_sub(
112
- node.attr("title-#{lang}"))
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)
113
111
  end
114
- typed_title(node, xml, lang, "cover")
115
- typed_title(node, xml, lang, "appendix")
116
- typed_title(node, xml, lang, "part")
117
- typed_title(node, xml, lang, "subpart")
118
112
  end
119
113
  end
120
114
 
@@ -122,7 +116,7 @@ module Asciidoctor
122
116
  at = { language: lang, format: "text/plain" }
123
117
  return unless title = node.attr("title-#{type}-#{lang}")
124
118
  xml.title **attr_code(at.merge(type: type)) do |t1|
125
- t1 << Asciidoctor::Standoc::Utils::asciidoc_sub(title)
119
+ t1 << Metanorma::Utils::asciidoc_sub(title)
126
120
  end
127
121
  end
128
122
 
@@ -135,7 +129,7 @@ module Asciidoctor
135
129
  end
136
130
 
137
131
  def inline_anchor_xref_attrs(node)
138
- flags = %w(pagenumber nosee).each_with_object({}) do |w, m|
132
+ flags = %w(pagenumber nosee nopage).each_with_object({}) do |w, m|
139
133
  if /#{w}%/.match(node.text)
140
134
  node.text = node.text.sub(/#{w}%/, "")
141
135
  m[w] = true
@@ -178,6 +172,11 @@ module Asciidoctor
178
172
  end
179
173
  end
180
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
+
181
180
  def mathml_mi_italics
182
181
  { uppergreek: false, upperroman: false,
183
182
  lowergreek: false, lowerroman: true }
@@ -204,6 +203,6 @@ module Asciidoctor
204
203
  return nil if node.attr("no-pdf")
205
204
  IsoDoc::BIPM::PdfConvert.new(doc_extract_attributes(node))
206
205
  end
207
- end
208
206
  end
209
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,9 @@
246
253
  <data type="boolean"/>
247
254
  </attribute>
248
255
  </optional>
256
+ <optional>
257
+ <attribute name="width"/>
258
+ </optional>
249
259
  <optional>
250
260
  <ref name="colgroup"/>
251
261
  </optional>
@@ -779,6 +789,9 @@
779
789
  <attribute name="width"/>
780
790
  </element>
781
791
  </define>
792
+ <define name="BibItemType" combine="choice">
793
+ <value>internal</value>
794
+ </define>
782
795
  <define name="TextElement" combine="choice">
783
796
  <ref name="concept"/>
784
797
  </define>
@@ -799,6 +812,8 @@
799
812
  <ref name="requirement"/>
800
813
  <ref name="recommendation"/>
801
814
  <ref name="permission"/>
815
+ <ref name="imagemap"/>
816
+ <ref name="svgmap"/>
802
817
  </choice>
803
818
  </define>
804
819
  <define name="bibliography">
@@ -829,6 +844,9 @@
829
844
  <data type="boolean"/>
830
845
  </attribute>
831
846
  </optional>
847
+ <optional>
848
+ <attribute name="number"/>
849
+ </optional>
832
850
  <optional>
833
851
  <attribute name="obligation">
834
852
  <choice>
@@ -884,9 +902,11 @@
884
902
  <element name="code">
885
903
  <text/>
886
904
  </element>
887
- <element name="text">
888
- <text/>
889
- </element>
905
+ <optional>
906
+ <element name="text">
907
+ <text/>
908
+ </element>
909
+ </optional>
890
910
  </element>
891
911
  </define>
892
912
  <define name="standard-document">
@@ -899,6 +919,9 @@
899
919
  </choice>
900
920
  </attribute>
901
921
  <ref name="bibdata"/>
922
+ <optional>
923
+ <ref name="misccontainer"/>
924
+ </optional>
902
925
  <optional>
903
926
  <ref name="boilerplate"/>
904
927
  </optional>
@@ -909,11 +932,21 @@
909
932
  <zeroOrMore>
910
933
  <ref name="annex"/>
911
934
  </zeroOrMore>
935
+ <optional>
936
+ <ref name="bibliography"/>
937
+ </optional>
912
938
  <zeroOrMore>
913
- <ref name="references"/>
939
+ <ref name="indexsect"/>
914
940
  </zeroOrMore>
915
941
  </element>
916
942
  </define>
943
+ <define name="misccontainer">
944
+ <element name="misc-container">
945
+ <oneOrMore>
946
+ <ref name="AnyElement"/>
947
+ </oneOrMore>
948
+ </element>
949
+ </define>
917
950
  <define name="preface">
918
951
  <element name="preface">
919
952
  <oneOrMore>
@@ -937,6 +970,11 @@
937
970
  <ref name="Content-Section"/>
938
971
  </element>
939
972
  </define>
973
+ <define name="indexsect">
974
+ <element name="indexsect">
975
+ <ref name="Content-Section"/>
976
+ </element>
977
+ </define>
940
978
  <define name="boilerplate">
941
979
  <element name="boilerplate">
942
980
  <optional>
@@ -1056,6 +1094,9 @@
1056
1094
  </choice>
1057
1095
  </attribute>
1058
1096
  </optional>
1097
+ <optional>
1098
+ <attribute name="number"/>
1099
+ </optional>
1059
1100
  <optional>
1060
1101
  <attribute name="type"/>
1061
1102
  </optional>
@@ -1109,6 +1150,9 @@
1109
1150
  <optional>
1110
1151
  <attribute name="type"/>
1111
1152
  </optional>
1153
+ <optional>
1154
+ <attribute name="number"/>
1155
+ </optional>
1112
1156
  <optional>
1113
1157
  <ref name="section-title"/>
1114
1158
  </optional>
@@ -1211,6 +1255,9 @@
1211
1255
  <optional>
1212
1256
  <attribute name="type"/>
1213
1257
  </optional>
1258
+ <optional>
1259
+ <attribute name="number"/>
1260
+ </optional>
1214
1261
  <optional>
1215
1262
  <attribute name="obligation">
1216
1263
  <choice>
@@ -1539,6 +1586,7 @@
1539
1586
  <value>add</value>
1540
1587
  <value>modify</value>
1541
1588
  <value>delete</value>
1589
+ <value>replace</value>
1542
1590
  </choice>
1543
1591
  </attribute>
1544
1592
  <optional>
@@ -1569,6 +1617,11 @@
1569
1617
  </optional>
1570
1618
  <optional>
1571
1619
  <element name="newcontent">
1620
+ <optional>
1621
+ <attribute name="id">
1622
+ <data type="ID"/>
1623
+ </attribute>
1624
+ </optional>
1572
1625
  <zeroOrMore>
1573
1626
  <ref name="BasicBlock"/>
1574
1627
  </zeroOrMore>
@@ -1602,4 +1655,65 @@
1602
1655
  <text/>
1603
1656
  </element>
1604
1657
  </define>
1658
+ <define name="imagemap">
1659
+ <element name="imagemap">
1660
+ <ref name="figure"/>
1661
+ <zeroOrMore>
1662
+ <element name="area">
1663
+ <attribute name="type">
1664
+ <choice>
1665
+ <value>rect</value>
1666
+ <value>circle</value>
1667
+ <value>ellipse</value>
1668
+ <value>poly</value>
1669
+ </choice>
1670
+ </attribute>
1671
+ <choice>
1672
+ <ref name="xref"/>
1673
+ <ref name="hyperlink"/>
1674
+ <ref name="eref"/>
1675
+ </choice>
1676
+ <oneOrMore>
1677
+ <element name="coords">
1678
+ <attribute name="x">
1679
+ <data type="float"/>
1680
+ </attribute>
1681
+ <attribute name="y">
1682
+ <data type="float"/>
1683
+ </attribute>
1684
+ </element>
1685
+ </oneOrMore>
1686
+ <optional>
1687
+ <element name="radius">
1688
+ <attribute name="x">
1689
+ <data type="float"/>
1690
+ </attribute>
1691
+ <optional>
1692
+ <attribute name="y">
1693
+ <data type="float"/>
1694
+ </attribute>
1695
+ </optional>
1696
+ </element>
1697
+ </optional>
1698
+ </element>
1699
+ </zeroOrMore>
1700
+ </element>
1701
+ </define>
1702
+ <define name="svgmap">
1703
+ <element name="svgmap">
1704
+ <ref name="figure"/>
1705
+ <zeroOrMore>
1706
+ <element name="target">
1707
+ <attribute name="href">
1708
+ <data type="anyURI"/>
1709
+ </attribute>
1710
+ <choice>
1711
+ <ref name="xref"/>
1712
+ <ref name="hyperlink"/>
1713
+ <ref name="eref"/>
1714
+ </choice>
1715
+ </element>
1716
+ </zeroOrMore>
1717
+ </element>
1718
+ </define>
1605
1719
  </grammar>