metanorma-bipm 0.0.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +62 -0
  3. data/README.adoc +7 -109
  4. data/lib/asciidoctor/bipm/bipm.rng +225 -24
  5. data/lib/asciidoctor/bipm/boilerplate-en.xml +2 -3
  6. data/lib/asciidoctor/bipm/boilerplate-fr.xml +3 -4
  7. data/lib/asciidoctor/bipm/converter.rb +139 -15
  8. data/lib/asciidoctor/bipm/isodoc.rng +29 -44
  9. data/lib/isodoc/bipm/base_convert.rb +47 -0
  10. data/lib/isodoc/bipm/bipm.brochure.xsl +2469 -626
  11. data/lib/isodoc/bipm/bipm.guide.xsl +7290 -0
  12. data/lib/isodoc/bipm/bipm.mise-en-pratique.xsl +7290 -0
  13. data/lib/isodoc/bipm/bipm.rapport.xsl +7290 -0
  14. data/lib/isodoc/bipm/html/html_bipm_titlepage.html +35 -4
  15. data/lib/isodoc/bipm/html/htmlstyle.css +57 -63
  16. data/lib/isodoc/bipm/html/htmlstyle.scss +53 -77
  17. data/lib/isodoc/bipm/html/si-aspect/A_e.png +0 -0
  18. data/lib/isodoc/bipm/html/si-aspect/A_e_deltanu.png +0 -0
  19. data/lib/isodoc/bipm/html/si-aspect/K_k.png +0 -0
  20. data/lib/isodoc/bipm/html/si-aspect/K_k_deltanu_h.png +0 -0
  21. data/lib/isodoc/bipm/html/si-aspect/cd_Kcd.png +0 -0
  22. data/lib/isodoc/bipm/html/si-aspect/cd_Kcd_h_deltanu.png +0 -0
  23. data/lib/isodoc/bipm/html/si-aspect/full.png +0 -0
  24. data/lib/isodoc/bipm/html/si-aspect/kg_h.png +0 -0
  25. data/lib/isodoc/bipm/html/si-aspect/kg_h_c_deltanu.png +0 -0
  26. data/lib/isodoc/bipm/html/si-aspect/m_c.png +0 -0
  27. data/lib/isodoc/bipm/html/si-aspect/m_c_deltanu.png +0 -0
  28. data/lib/isodoc/bipm/html/si-aspect/mol_NA.png +0 -0
  29. data/lib/isodoc/bipm/html/si-aspect/s_deltanu.png +0 -0
  30. data/lib/isodoc/bipm/html_convert.rb +32 -0
  31. data/lib/isodoc/bipm/i18n-en.yaml +7 -0
  32. data/lib/isodoc/bipm/i18n-fr.yaml +16 -0
  33. data/lib/isodoc/bipm/metadata.rb +34 -10
  34. data/lib/isodoc/bipm/pdf_convert.rb +20 -1
  35. data/lib/isodoc/bipm/presentation_xml_convert.rb +102 -7
  36. data/lib/isodoc/bipm/xref.rb +138 -3
  37. data/lib/metanorma/bipm.rb +7 -0
  38. data/lib/metanorma/bipm/fonts_manifest.yaml +7 -0
  39. data/lib/metanorma/bipm/version.rb +1 -1
  40. data/metanorma-bipm.gemspec +1 -2
  41. data/metanorma.yml +42 -1
  42. metadata +22 -21
  43. data/.github/workflows/macos.yml +0 -38
  44. data/.github/workflows/ubuntu.yml +0 -56
  45. data/.github/workflows/windows.yml +0 -40
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b794a40444463cb9b1d3723f7964c8bb2936165a845f48557be8ef7adcada9c
4
- data.tar.gz: 7e392b5f79b223deacf1092b0d06dc4bb12c0af0987e37ef664b4100b1899528
3
+ metadata.gz: 1124fc9a829ea0ff6c013bbba40f1c24d3a3c832f032c3457618e5c111b80b1c
4
+ data.tar.gz: 0d321b641c701353e57d8f7666e769ef3eb4a429d14403682996ec908d434e96
5
5
  SHA512:
6
- metadata.gz: 26571b020caa32428945853cafbea125396f0defd9fa2d2c2c209951f09dc4b2f48645941e7b5beab8a1a76d8f01d25a40e4caa4622c0a78cf481eaba08644b5
7
- data.tar.gz: 79b3e4734a35aa5057421237e0a4d7b60c2c5890cd67a37fd8027522be26b780c92e672ce61885fbd780341094b40149a9f34858e58f5af75f98103d93fb1fd4
6
+ metadata.gz: c6f9597091c23cfd4543d2a7c7085e464723344c46f321083dbabfb7e64ac00b55cf0104a76fe5c5f3b1904df2878656e036308dba3687574054ae4d9f3dcd52
7
+ data.tar.gz: f453d61d6c061490a1dd831c34350fb5aa98fef65766695c42c4c8e9534572d91a1d20324b9ba5b778a75cc3aa2fb0f73dca9bb3866462acf0338ada116d9b01
@@ -0,0 +1,62 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: rake
4
+
5
+ on:
6
+ push:
7
+ branches: [ master, main ]
8
+ tags: [ v* ]
9
+ pull_request:
10
+
11
+ jobs:
12
+ rake:
13
+ name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
14
+ runs-on: ${{ matrix.os }}
15
+ continue-on-error: ${{ matrix.experimental }}
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ ruby: [ '2.6', '2.5', '2.4' ]
20
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
21
+ experimental: [ false ]
22
+ include:
23
+ - ruby: '2.7'
24
+ os: 'ubuntu-latest'
25
+ experimental: true
26
+ - ruby: '2.7'
27
+ os: 'windows-latest'
28
+ experimental: true
29
+ - ruby: '2.7'
30
+ os: 'macos-latest'
31
+ experimental: true
32
+ steps:
33
+ - uses: actions/checkout@master
34
+
35
+ - uses: ruby/setup-ruby@v1
36
+ with:
37
+ ruby-version: ${{ matrix.ruby }}
38
+
39
+ - uses: actions/cache@v2
40
+ with:
41
+ path: vendor/bundle
42
+ key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
43
+ restore-keys: bundle-${{ matrix.os }}-${{ matrix.ruby }}
44
+
45
+ - run: bundle config set path 'vendor/bundle'
46
+
47
+ - run: bundle install --jobs 4 --retry 3
48
+
49
+ - run: bundle exec rake
50
+
51
+ tests-passed:
52
+ needs: rake
53
+ runs-on: ubuntu-latest
54
+ steps:
55
+ - name: Trigger tests passed event
56
+ uses: Sibz/github-status-action@v1
57
+ with:
58
+ authToken: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
59
+ context: 'tests-passed-successfully'
60
+ description: 'Tests passed successfully'
61
+ state: 'success'
62
+ sha: ${{ github.event.pull_request.head.sha || github.sha }}
@@ -1,17 +1,14 @@
1
1
  = Metanorma for BIPM: Metanorma processor for Bureau International de Poids et Mesures
2
2
 
3
- image:https://img.shields.io/gem/v/metanorma-bimp.sbimp["Gem Version", link="https://rubygems.org/gems/metanorma-bimp"]
4
- image:https://github.com/metanorma/metanorma-bimp/workflows/macos/badge.sbimp["Build Status (macOS)", link="https://github.com/metanorma/metanorma-bimp/actions?workflow=macos"]
5
- image:https://github.com/metanorma/metanorma-bimp/workflows/ubuntu/badge.sbimp["Build Status (ubuntu)", link="https://github.com/metanorma/metanorma-bimp/actions?workflow=ubuntu"]
6
- image:https://github.com/metanorma/metanorma-bimp/workflows/windows/badge.sbimp["Build Status (Windows)", link="https://github.com/metanorma/metanorma-bimp/actions?workflow=windows"]
7
- image:https://codeclimate.com/github/metanorma/metanorma-bimp/badges/gpa.sbimp["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-bimp"]
8
- image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-bimp.sbimp["Pull Requests", link="https://github.com/metanorma/metanorma-bimp/pulls"]
9
- image:https://img.shields.io/github/commits-since/metanorma/metanorma-bimp/latest.sbimp["Commits since latest",link="https://github.com/metanorma/metanorma-bimp/releases"]
3
+ image:https://img.shields.io/gem/v/metanorma-bipm.svg["Gem Version", link="https://rubygems.org/gems/metanorma-bipm"]
4
+ image:https://github.com/metanorma/metanorma-bipm/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/metanorma-bipm/actions?workflow=rake"]
5
+ image:https://codeclimate.com/github/metanorma/metanorma-bipm/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-bipm"]
6
+ image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-bipm.svg["Pull Requests", link="https://github.com/metanorma/metanorma-bipm/pulls"]
7
+ image:https://img.shields.io/github/commits-since/metanorma/metanorma-bipm/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-bipm/releases"]
10
8
 
11
9
  == Functionality
12
10
 
13
- This gem processes http://asciidoctor.org/[Asciidoctor] documents following
14
- a template for generating BIPM standards.
11
+ This gem processes https://www.metanorma.com[Metanorma documents] following a template for generating BIPM standards.
15
12
 
16
13
  == Usage
17
14
 
@@ -42,109 +39,10 @@ scripts such as this one. You need only run the following in a Terminal console:
42
39
  [source,console]
43
40
  ----
44
41
  $ bash <(curl -s https://raw.githubusercontent.com/riboseinc/metanorma-macos-setup/master/metanorma-setup)
45
- $ gem install metanorma-vg
42
+ $ gem install metanorma-bipm
46
43
  ----
47
44
 
48
45
 
49
- == Document Attributes
50
-
51
- The gem relies on Asciidoctor document attributes to provide necessary
52
- metadata about the document. These include:
53
-
54
- `:edition:`:: The document edition
55
-
56
- `:revdate:`:: The date the document was last updated
57
-
58
- `:title-en:`:: The title of the document in English (mandatory)
59
- `:title-fr:`:: The title of the document in French (mandatory)
60
- `:title-cover-en:`:: The title of the front cover of the document in English (where different from the title proper)
61
- `:title-cover-fr:`:: The title of the front cover of the document in French (where different from the title proper)
62
- `:title-appendix-en:`:: The title of the appendix in English, if this document is an appendix published separately; `title-en` becomes the title of the main document, as presented within the standalone appendix.
63
- `:title-appendix-fr:`:: The title of the appendix in English, if this document is an appendix published separately; `title-en` becomes the title of the main document, as presented within the standalone appendix.
64
-
65
- `:appendix-id:`:: The number of the appendix, if this document is an appendix published separately
66
-
67
- `:si-aspect:`:: The domain of SI covered by the document; used to select logo in PDF cover page. The logo nominates one primary SI base units, and defining consonants for that unit and possibly others as well. The permitted values are:
68
- +
69
- --
70
- * A_e_deltanu (ampere; time)
71
- * A_e (ampere)
72
- * cd_Kcd_h_deltanu (candela; mass, time)
73
- * cd_Kcd (candela)
74
- * full (all units)
75
- * K_k_deltanu (kelvin; mass, time)
76
- * K_k (kelvin)
77
- * kg_h_c_deltanu (kilogram; length, time)
78
- * kg_h (kilogram)
79
- * m_c_deltanu (metre; time)
80
- * m_c (metre)
81
- * mol_NA (mole)
82
- * s_deltanu (second)
83
- --
84
-
85
- `:copyright-year:`:: The year which will be claimed as when the copyright for
86
- the document was issued
87
-
88
- `:supersedes:`:: One or more BIPM document that this BIPM document standard supersedes; the superseded
89
- document may still remain in effect. Comma delimited.
90
-
91
- `:superseded-by:`:: One or more BIPM document that this BIPM document standard is superseded by; this
92
- document may still remain in effect. Comma delimited.
93
-
94
- `:doctype:`:: The document type (mandatory). The permitted types are:
95
- +
96
- --
97
- * brochure (default)
98
- * mise-en-pratique
99
- * rapport
100
- * monographie
101
- * guide
102
- * meeting-report
103
- * technical-report
104
- * working-party-note
105
- * strategy
106
- * cipm-mra
107
- * resolution
108
- --
109
-
110
- `:status:``:: The document status. The permitted types are: `draft-proposal`,
111
- `draft-development`, `in-force`, `retired`.
112
-
113
- `:committee:`:: The name of the relevant committee (mandatory):
114
- +
115
- --
116
- * CGPM: General Conference on Weights and Measures
117
- * CIPM: International Committee for Weights and Measures
118
- * BIPM: International Bureau of Weights and Measures
119
- * CCAUV: Consultative Committee for Acoustics, Ultrasound and Vibration
120
- * CCEM: Consultative Committee for Electricity and Magnetism
121
- * CCL: Consultative Committee for Length
122
- * CCM: Consultative Committee for Mass and Related Quantities
123
- * CCPR: Consultative Committee for Photometry and Radiometry
124
- * CCQM: Consultative Committee for Amount of Substance:: Metrology in Chemistry and Biology
125
- * CCRI: Consultative Committee for Ionizing Radiation
126
- * CCT: Consultative Committee for Thermometry
127
- * CCTF: Consultative Committee for Time and Frequency
128
- * CCU: Consultative Committee for Units
129
- * CCL-CCTF: Frequency Standards Working Group
130
- * JCGM: Joint Committee for Guides in Metrology
131
- * JCRB: Joint Committee of the Regional Metrology Organizations and the BIPM
132
- * JCTLM: Joint Committee for Traceability in Laboratory Medicine
133
- * INetQI: International Network on Quality Infrastructure
134
- --
135
- `:workgroup:`:: The name of the relevant workgroup (mandatory)
136
-
137
- `:language:` :: The language of the document (`en` or `fr`) (mandatory)
138
-
139
- `:comment-period-from:`:: Start of the period during which comments are allowed on the document draft
140
- `:comment-period-to:`:: End of the period during which comments are allowed on the document draft (optional)
141
-
142
- `:obsoleted-date:`:: The date a document was superseded
143
- `:implemented-date:`:: The date a document became effective
144
-
145
- The attribute `:draft:`, if present, includes review notes in the XML output;
146
- these are otherwise suppressed.
147
-
148
46
  == Data Models
149
47
 
150
48
  The document model for BIPM is given in https://github.com/metanorma/metanorma-model-bipm[metanorma-model-bipm].
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar ns="https://www.metanorma.org/ns/bipm" xmlns="http://relaxng.org/ns/structure/1.0">
2
+ <grammar ns="https://www.metanorma.org/ns/bipm" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
3
  <!--
4
4
  Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
5
5
  we cannot have a new default namespace: we will end up with a grammar with two different
@@ -9,6 +9,191 @@
9
9
  <start>
10
10
  <ref name="bipm-standard"/>
11
11
  </start>
12
+ <define name="xref">
13
+ <element name="xref">
14
+ <attribute name="target">
15
+ <data type="string">
16
+ <param name="pattern">\i\c*|\c+#\c+</param>
17
+ </data>
18
+ </attribute>
19
+ <optional>
20
+ <attribute name="type">
21
+ <ref name="ReferenceFormat"/>
22
+ </attribute>
23
+ </optional>
24
+ <optional>
25
+ <attribute name="alt"/>
26
+ </optional>
27
+ <optional>
28
+ <attribute name="case">
29
+ <choice>
30
+ <value>capital</value>
31
+ <value>lowercase</value>
32
+ </choice>
33
+ </attribute>
34
+ </optional>
35
+ <optional>
36
+ <attribute name="droploc">
37
+ <data type="boolean"/>
38
+ </attribute>
39
+ </optional>
40
+ <optional>
41
+ <attribute name="pagenumber">
42
+ <data type="boolean"/>
43
+ </attribute>
44
+ </optional>
45
+ <optional>
46
+ <attribute name="nosee">
47
+ <data type="boolean"/>
48
+ </attribute>
49
+ </optional>
50
+ <text/>
51
+ </element>
52
+ </define>
53
+ <define name="Clause-Section">
54
+ <optional>
55
+ <attribute name="id">
56
+ <data type="ID"/>
57
+ </attribute>
58
+ </optional>
59
+ <optional>
60
+ <attribute name="language"/>
61
+ </optional>
62
+ <optional>
63
+ <attribute name="script"/>
64
+ </optional>
65
+ <optional>
66
+ <attribute name="inline-header">
67
+ <data type="boolean"/>
68
+ </attribute>
69
+ </optional>
70
+ <optional>
71
+ <attribute name="obligation">
72
+ <choice>
73
+ <value>normative</value>
74
+ <value>informative</value>
75
+ </choice>
76
+ </attribute>
77
+ </optional>
78
+ <optional>
79
+ <attribute name="type"/>
80
+ </optional>
81
+ <optional>
82
+ <attribute name="unnumbered">
83
+ <data type="boolean"/>
84
+ </attribute>
85
+ </optional>
86
+ <optional>
87
+ <ref name="section-title"/>
88
+ </optional>
89
+ <group>
90
+ <choice>
91
+ <group>
92
+ <zeroOrMore>
93
+ <ref name="BasicBlock"/>
94
+ </zeroOrMore>
95
+ <zeroOrMore>
96
+ <ref name="note"/>
97
+ </zeroOrMore>
98
+ </group>
99
+ <ref name="amend"/>
100
+ </choice>
101
+ <zeroOrMore>
102
+ <choice>
103
+ <ref name="clause-subsection"/>
104
+ <ref name="terms"/>
105
+ <ref name="definitions"/>
106
+ </choice>
107
+ </zeroOrMore>
108
+ </group>
109
+ </define>
110
+ <define name="Annex-Section">
111
+ <optional>
112
+ <attribute name="id">
113
+ <data type="ID"/>
114
+ </attribute>
115
+ </optional>
116
+ <optional>
117
+ <attribute name="language"/>
118
+ </optional>
119
+ <optional>
120
+ <attribute name="script"/>
121
+ </optional>
122
+ <optional>
123
+ <attribute name="inline-header">
124
+ <data type="boolean"/>
125
+ </attribute>
126
+ </optional>
127
+ <optional>
128
+ <attribute name="obligation">
129
+ <choice>
130
+ <value>normative</value>
131
+ <value>informative</value>
132
+ </choice>
133
+ </attribute>
134
+ </optional>
135
+ <optional>
136
+ <attribute name="unnumbered">
137
+ <data type="boolean"/>
138
+ </attribute>
139
+ </optional>
140
+ <optional>
141
+ <ref name="section-title"/>
142
+ </optional>
143
+ <group>
144
+ <group>
145
+ <zeroOrMore>
146
+ <ref name="BasicBlock"/>
147
+ </zeroOrMore>
148
+ <zeroOrMore>
149
+ <ref name="note"/>
150
+ </zeroOrMore>
151
+ </group>
152
+ <zeroOrMore>
153
+ <choice>
154
+ <ref name="annex-subsection"/>
155
+ <ref name="terms"/>
156
+ <ref name="definitions"/>
157
+ <ref name="references"/>
158
+ </choice>
159
+ </zeroOrMore>
160
+ </group>
161
+ </define>
162
+ <define name="ol">
163
+ <element name="ol">
164
+ <attribute name="id">
165
+ <data type="ID"/>
166
+ </attribute>
167
+ <optional>
168
+ <attribute name="keep-with-next">
169
+ <data type="boolean"/>
170
+ </attribute>
171
+ </optional>
172
+ <optional>
173
+ <attribute name="keep-lines-together">
174
+ <data type="boolean"/>
175
+ </attribute>
176
+ </optional>
177
+ <attribute name="type">
178
+ <choice>
179
+ <value>roman</value>
180
+ <value>alphabet</value>
181
+ <value>arabic</value>
182
+ <value>roman_upper</value>
183
+ <value>alphabet_upper</value>
184
+ </choice>
185
+ </attribute>
186
+ <optional>
187
+ <attribute name="start"/>
188
+ </optional>
189
+ <oneOrMore>
190
+ <ref name="li"/>
191
+ </oneOrMore>
192
+ <zeroOrMore>
193
+ <ref name="note"/>
194
+ </zeroOrMore>
195
+ </element>
196
+ </define>
12
197
  <define name="DocumentType">
13
198
  <choice>
14
199
  <value>brochure</value>
@@ -29,9 +214,9 @@
29
214
  <oneOrMore>
30
215
  <ref name="committee"/>
31
216
  </oneOrMore>
32
- <oneOrMore>
217
+ <zeroOrMore>
33
218
  <ref name="workgroup"/>
34
- </oneOrMore>
219
+ </zeroOrMore>
35
220
  </element>
36
221
  </define>
37
222
  <define name="structuredidentifier">
@@ -62,6 +247,9 @@
62
247
  <optional>
63
248
  <ref name="si-aspect"/>
64
249
  </optional>
250
+ <optional>
251
+ <ref name="meeting-note"/>
252
+ </optional>
65
253
  <ref name="structuredidentifier"/>
66
254
  </define>
67
255
  </include>
@@ -96,30 +284,41 @@
96
284
  </define>
97
285
  <define name="committee">
98
286
  <element name="committee">
99
- <choice>
100
- <value>CGPM</value>
101
- <value>CIPM</value>
102
- <value>BIPM</value>
103
- <value>CCAUV</value>
104
- <value>CCEM</value>
105
- <value>CCL</value>
106
- <value>CCM</value>
107
- <value>CCPR</value>
108
- <value>CCQM</value>
109
- <value>CCRI</value>
110
- <value>CCT</value>
111
- <value>CCTF</value>
112
- <value>CCU</value>
113
- <value>CCL-CCTF</value>
114
- <value>JCGM</value>
115
- <value>JCRB</value>
116
- <value>JCTLM</value>
117
- <value>INetQI</value>
118
- </choice>
287
+ <attribute name="acronym">
288
+ <choice>
289
+ <value>CGPM</value>
290
+ <value>CIPM</value>
291
+ <value>BIPM</value>
292
+ <value>CCAUV</value>
293
+ <value>CCEM</value>
294
+ <value>CCL</value>
295
+ <value>CCM</value>
296
+ <value>CCPR</value>
297
+ <value>CCQM</value>
298
+ <value>CCRI</value>
299
+ <value>CCT</value>
300
+ <value>CCTF</value>
301
+ <value>CCU</value>
302
+ <value>CCL-CCTF</value>
303
+ <value>JCGM</value>
304
+ <value>JCRB</value>
305
+ <value>JCTLM</value>
306
+ <value>INetQI</value>
307
+ </choice>
308
+ </attribute>
309
+ <ref name="LocalizedString"/>
119
310
  </element>
120
311
  </define>
121
312
  <define name="workgroup">
122
313
  <element name="workgroup">
314
+ <optional>
315
+ <attribute name="acronym"/>
316
+ </optional>
317
+ <text/>
318
+ </element>
319
+ </define>
320
+ <define name="meeting-note">
321
+ <element name="meeting-note">
123
322
  <text/>
124
323
  </element>
125
324
  </define>
@@ -146,7 +345,9 @@
146
345
  <zeroOrMore>
147
346
  <ref name="annex"/>
148
347
  </zeroOrMore>
149
- <ref name="bibliography"/>
348
+ <optional>
349
+ <ref name="bibliography"/>
350
+ </optional>
150
351
  </element>
151
352
  </define>
152
353
  </grammar>