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
@@ -23,12 +23,20 @@
23
23
  <span class="docyear">{{ docyear }} {{ draftinfo }}</span>
24
24
  </div>
25
25
 
26
+ <div class="coverpage-logo">
27
+ <img src="{{ logo }}"/>
28
+ </div>
29
+
26
30
  <div class="coverpage-title">
27
- {% if appendixtitle %}
31
+ {% if appendixtitle or parttitle or subparttitle %}
28
32
  <span class="title-third">{{ doctitle }}</span>
29
33
  <span class="title-third">{{ docsubtitle }}</span><br/>
30
- <span class="title-first">{{ appendixid}}: {{ appendixtitle }}</span><br/>
31
- <span class="title-second">{{ appendixid_alt}}: {{ appendixsubtitle }}</span>
34
+ {% if partid %}<span class="title-first">{{ partid}}: {{ parttitle }}</span><br/>{% endif %}
35
+ {% if partid_alt %}<span class="title-second">{{ partid_alt}}: {{ partsubtitle }}</span>{% endif %}
36
+ {% if subparttitle %}<span class="title-first">{{ subparttitle }}</span><br/>{% endif %}
37
+ {% if subpartsubtitle %}<span class="title-second">{{ subpartsubtitle }}</span><br/>{% endif %}
38
+ {% if appendixid %}<span class="title-first">{{ appendixid}}: {{ appendixtitle }}</span><br/>{% endif %}
39
+ {% if appendixid_alt %}<span class="title-second">{{ appendixid_alt}}: {{ appendixsubtitle }}</span>{% endif %}
32
40
  {% else %}
33
41
  <span class="title-first">{{ doctitle }}</span><br/>
34
42
  <span class="title-second">{{ docsubtitle }}</span>
@@ -38,11 +46,34 @@
38
46
 
39
47
  <div class="coverpage-logo">
40
48
  <span>Bureau International de Poids et Mesures {{ docyear }}</span>
49
+ {% if metadata_extensions["si-aspect"] %}
50
+ <br/>
51
+ {% for item in si_aspect_index %}
52
+ {% if item == metadata_extensions["si-aspect"] %}
53
+ <img src="{{ si_aspect_paths[forloop.index0] }}" width="310px" height="310px"/>
54
+ {% endif %}
55
+ {% endfor %}
56
+ {% endif %}
41
57
  </div>
42
58
 
59
+ {% for item in metadata_extensions["editorialgroup"]["committee"]["variant_language"] %}
60
+ {% if item == lang %}
61
+ {% assign committee = metadata_extensions["editorialgroup"]["committee"]["variant"][forloop.index0] %}
62
+ {% endif %}
63
+ {% endfor %}
64
+
43
65
  <div class="coverpage-tc-name">
44
- <span>{{ tc }}</span>
66
+ <span>{{ metadata_extensions["editorialgroup"]["committee_acronym"] }}{% if metadata_extensions["editorialgroup"]["committee_acronym"] and committee %}: {% endif %}{{ committee }}</span>
45
67
  </div>
68
+
69
+ {% if authors %}
70
+ <div class="coverpage-tc-name">
71
+ {% for item in authors %}
72
+ <span>{{item}} {% if authors_affiliations[forloop.index0] %}({{ authors_affiliations[forloop.index0] }}){% endif %}{% if forloop.last == false %}, {% endif %}{% endfor %}.
73
+ </div>
74
+ {% endif %}
75
+
76
+
46
77
  </div>
47
78
 
48
79
  <div class="wrapper-top-bottom"></div>
@@ -17,7 +17,7 @@ fieldset, form, label, legend,
17
17
  table, caption, tbody, tfoot, thead, tr, th, td,
18
18
  article, aside, canvas, details, embed,
19
19
  figure, figcaption, footer, header, hgroup,
20
- menu, nav, output, ruby, section, summary,
20
+ menu, output, ruby, section, summary,
21
21
  time, mark, audio, video {
22
22
  margin: 0;
23
23
  padding: 0; }
@@ -112,16 +112,20 @@ b, strong {
112
112
  div.document-stage-band, div.document-type-band {
113
113
  background-color: #333333; }
114
114
 
115
+ a.FootnoteRef + a.FootnoteRef:before {
116
+ content: ", ";
117
+ vertical-align: super; }
118
+
115
119
  #brochure-band {
116
120
  background-color: #0AC442; }
117
121
 
118
122
  #brochure {
119
123
  border-bottom: solid 3px #0AC442; }
120
124
 
121
- #mis-en-pratique-band {
125
+ #mise-en-pratique-band {
122
126
  background-color: #540D6E; }
123
127
 
124
- #mis-en-pratique {
128
+ #mise-en-pratique {
125
129
  border-bottom: solid 3px #540D6E; }
126
130
 
127
131
  #rapport-band {
@@ -209,7 +213,7 @@ body {
209
213
  margin-left: auto;
210
214
  margin-right: auto;
211
215
  max-width: 100%;
212
- font-size: 15px;
216
+ font-size: {{normalfontsize}};
213
217
  font-weight: 300;
214
218
  line-height: 1.4em;
215
219
  color: #1d1d1d;
@@ -446,31 +450,6 @@ p.document-stage {
446
450
  font-weight: 300;
447
451
  height: 160px; }
448
452
 
449
- #proposal-band p {
450
- height: 150px; }
451
-
452
- #standard-band,
453
- #published-band {
454
- background-color: #007864; }
455
-
456
- #standard,
457
- #published {
458
- border-bottom: solid 3px #007864; }
459
-
460
- #governance,
461
- #policy-and-procedures {
462
- border-bottom: solid 3px #750697; }
463
-
464
- #governance-band,
465
- #policy-and-procedures-band {
466
- background-color: #750697; }
467
-
468
- #guide {
469
- border-bottom: solid 3px #48a0e7; }
470
-
471
- #guide-band {
472
- background-color: #48a0e7; }
473
-
474
453
  .coverpage-maturity {
475
454
  font-family: {{bodyfont}};
476
455
  font-weight: 400;
@@ -478,38 +457,6 @@ p.document-stage {
478
457
  margin: 0 0 2em 0;
479
458
  text-transform: uppercase; }
480
459
 
481
- #working-draft,
482
- #proposal {
483
- border-bottom: solid 3px #F7803C; }
484
-
485
- #working-draft-band,
486
- #proposal-band {
487
- background-color: #F7803C; }
488
-
489
- #committee-draft {
490
- border-bottom: solid 3px #fd06fd; }
491
-
492
- #committee-draft-band {
493
- background-color: #fd06fd; }
494
-
495
- #draft-standard {
496
- border-bottom: solid 3px #fdf906; }
497
-
498
- #draft-standard-band {
499
- background-color: #fdf906; }
500
-
501
- #standard {
502
- border-bottom: solid 3px #007864; }
503
-
504
- #standard-band {
505
- background-color: #007864; }
506
-
507
- #obsolete {
508
- border-bottom: solid 3px #7e0d13; }
509
-
510
- #obsolete-band {
511
- background-color: #7e0d13; }
512
-
513
460
  /*
514
461
  3. TYPOGRAPHY
515
462
  */
@@ -608,6 +555,53 @@ ul li:first-child {
608
555
  content: " ";
609
556
  display: none; }
610
557
 
558
+ /* https://github.com/metanorma/metanorma-bipm/issues/47 */
559
+ ol[class="alphabet"] {
560
+ counter-reset: alphabet; }
561
+
562
+ ol[class="roman"] {
563
+ counter-reset: roman; }
564
+
565
+ ol[class="alphabet"] ol[class="alphabet"] {
566
+ counter-reset: none; }
567
+
568
+ ol[class="alphabet"] > li {
569
+ list-style: none;
570
+ position: relative; }
571
+
572
+ ol[class="alphabet"] ol[class="alphabet"] > li {
573
+ list-style: inherit; }
574
+
575
+ ol[class="alphabet"] > li:before {
576
+ counter-increment: alphabet;
577
+ content: counter(alphabet, lower-alpha) ") ";
578
+ position: absolute;
579
+ left: -1.4em; }
580
+
581
+ ol[class="alphabet"] ol[class="alphabet"] > li:before {
582
+ counter-increment: none;
583
+ content: initial; }
584
+
585
+ ol[class="roman"] ol[class="roman"] {
586
+ counter-reset: none; }
587
+
588
+ ol[class="roman"] > li {
589
+ list-style: none;
590
+ position: relative; }
591
+
592
+ ol[class="roman"] ol[class="roman"] > li {
593
+ list-style: inherit; }
594
+
595
+ ol[class="roman"] > li:before {
596
+ counter-increment: roman;
597
+ content: "(" counter(roman, lower-roman) ") ";
598
+ position: absolute;
599
+ left: -2.0em; }
600
+
601
+ ol[class="roman"] ol[class="roman"] > li:before {
602
+ counter-increment: none;
603
+ content: initial; }
604
+
611
605
  /*
612
606
  3.4 Rules
613
607
  */
@@ -631,7 +625,7 @@ p.Biblio, p.NormRef {
631
625
  pre,
632
626
  .pseudocode {
633
627
  background-color: #f7f7f7;
634
- font-size: 0.8em;
628
+ font-size: {{monospacefontsize}};
635
629
  line-height: 1.6em;
636
630
  padding: 1.5em;
637
631
  margin: 2em 0 1em 0;
@@ -727,7 +721,7 @@ a.footnote-number {
727
721
  font-size: 0.8em; }
728
722
 
729
723
  .footnote {
730
- font-size: 0.9em; }
724
+ font-size: {{footnotefontsize}}; }
731
725
 
732
726
  /*
733
727
  3.11 Blockquotes
@@ -9,7 +9,7 @@
9
9
 
10
10
  $doctype-colors-list: (
11
11
  brochure: #0AC442,
12
- mis-en-pratique: #540D6E,
12
+ mise-en-pratique: #540D6E,
13
13
  rapport: #D183C9,
14
14
  monographie: #65AFFF,
15
15
  guide: #3A405A,
@@ -36,7 +36,7 @@ $docstage-colors-list: (
36
36
  */
37
37
 
38
38
  body {
39
- @include bodyStyle1(15px, 1.4em, #1d1d1d, #ffffff, 300);
39
+ @include bodyStyle1($normalfontsize, 1.4em, #1d1d1d, #ffffff, 300);
40
40
  font-weight: 400;
41
41
 
42
42
  pre * {
@@ -147,84 +147,10 @@ p.document-stage {
147
147
  height: 160px;
148
148
  }
149
149
 
150
- #proposal-band p {
151
- height: 150px;
152
- }
153
-
154
- #standard-band,
155
- #published-band {
156
- background-color: #007864;
157
- }
158
-
159
- #standard,
160
- #published {
161
- border-bottom: solid 3px #007864;
162
- }
163
-
164
- #governance,
165
- #policy-and-procedures {
166
- border-bottom: solid 3px #750697;
167
- }
168
-
169
- #governance-band,
170
- #policy-and-procedures-band {
171
- background-color: #750697;
172
- }
173
-
174
- #guide {
175
- border-bottom: solid 3px #48a0e7;
176
- }
177
-
178
- #guide-band {
179
- background-color: #48a0e7;
180
- }
181
-
182
150
  .coverpage-maturity {
183
151
  @include coverpageStageBlock();
184
152
  }
185
153
 
186
- #working-draft,
187
- #proposal {
188
- border-bottom: solid 3px #F7803C;
189
- }
190
-
191
- #working-draft-band,
192
- #proposal-band {
193
- background-color: #F7803C;
194
- }
195
-
196
- #committee-draft {
197
- border-bottom: solid 3px #fd06fd;
198
- }
199
-
200
- #committee-draft-band {
201
- background-color: #fd06fd;
202
- }
203
-
204
- #draft-standard {
205
- border-bottom: solid 3px #fdf906;
206
- }
207
-
208
- #draft-standard-band {
209
- background-color: #fdf906;
210
- }
211
-
212
- #standard {
213
- border-bottom: solid 3px #007864;
214
- }
215
-
216
- #standard-band {
217
- background-color: #007864;
218
- }
219
-
220
- #obsolete {
221
- border-bottom: solid 3px #7e0d13;
222
- }
223
-
224
- #obsolete-band {
225
- background-color: #7e0d13;
226
- }
227
-
228
154
  /*
229
155
  3. TYPOGRAPHY
230
156
  */
@@ -330,6 +256,56 @@ ul li:first-child {
330
256
  display: none;
331
257
  }
332
258
 
259
+ /* https://github.com/metanorma/metanorma-bipm/issues/47 */
260
+
261
+ ol[class="alphabet"] {
262
+ counter-reset: alphabet;
263
+ }
264
+ ol[class="roman"] {
265
+ counter-reset: roman;
266
+ }
267
+ ol[class="alphabet"] ol[class="alphabet"] {
268
+ counter-reset: none;
269
+ }
270
+ ol[class="alphabet"] > li {
271
+ list-style: none;
272
+ position: relative;
273
+ }
274
+ ol[class="alphabet"] ol[class="alphabet"] > li {
275
+ list-style: inherit;
276
+ }
277
+ ol[class="alphabet"] > li:before {
278
+ counter-increment: alphabet;
279
+ content: counter(alphabet, lower-alpha)") ";
280
+ position: absolute;
281
+ left: -1.4em;
282
+ }
283
+ ol[class="alphabet"] ol[class="alphabet"] > li:before {
284
+ counter-increment: none;
285
+ content: initial;
286
+ }
287
+ ol[class="roman"] ol[class="roman"] {
288
+ counter-reset: none;
289
+ }
290
+ ol[class="roman"] > li {
291
+ list-style: none;
292
+ position: relative;
293
+ }
294
+ ol[class="roman"] ol[class="roman"] > li {
295
+ list-style: inherit;
296
+ }
297
+ ol[class="roman"] > li:before {
298
+ counter-increment: roman;
299
+ content: "("counter(roman, lower-roman)") ";
300
+ position: absolute;
301
+ left: -2.0em;
302
+ }
303
+ ol[class="roman"] ol[class="roman"] > li:before {
304
+ counter-increment: none;
305
+ content: initial;
306
+ }
307
+
308
+
333
309
 
334
310
  /*
335
311
  3.4 Rules
@@ -425,7 +401,7 @@ a.footnote-number {
425
401
  }
426
402
 
427
403
  .footnote {
428
- font-size: 0.9em;
404
+ font-size: $footnotefontsize;
429
405
  }
430
406
 
431
407
 
@@ -7,6 +7,38 @@ module IsoDoc
7
7
  module BIPM
8
8
  class HtmlConvert < IsoDoc::Generic::HtmlConvert
9
9
 
10
+ def middle(isoxml, out)
11
+ super
12
+ doccontrol isoxml, out
13
+ end
14
+
15
+ def doccontrol(isoxml, out)
16
+ c = isoxml.at(ns("//doccontrol")) or return
17
+ out.div **attr_code(class: "doccontrol") do |div|
18
+ clause_parse_title(c, div, c.at(ns("./title")), out)
19
+ c.children.reject { |c1| c1.name == "title" }.each do |c1|
20
+ parse(c1, div)
21
+ end
22
+ end
23
+ end
24
+
25
+ def counter_reset(node)
26
+ s = node["start"]
27
+ return nil unless s && !s.empty? && !s.to_i.zero?
28
+ "counter-reset: #{node['type']} #{s.to_i - 1};"
29
+ end
30
+
31
+ def ol_attrs(node)
32
+ klass, style = if node["type"] == "roman" &&
33
+ !node.at("./ancestor::xmlns:ol[@type = 'roman']") ||
34
+ node["type"] == "alphabet" &&
35
+ !node.at("./ancestor::xmlns:ol[@type = 'alphabet']")
36
+ [node["type"], counter_reset(node)]
37
+ end
38
+ super.merge(attr_code(type: ol_style((node["type"] || "arabic").to_sym),
39
+ start: node["start"]), style: style, class: klass)
40
+ end
41
+
10
42
  include BaseConvert
11
43
  include Init
12
44
  end