metanorma-iso 1.5.1 → 1.5.6

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: a4efe57fc87938f85770ed9c8a784736a25e1f69712ed770f21bf6b59a212b3f
4
- data.tar.gz: ebd36532e1f6742007b4415ace26933d72670d0d376485ed7f7fe5713bca3e5c
3
+ metadata.gz: af5b522de99b45f3bfe7f85160164adef26c76fd3422589d47309fa9e45086b3
4
+ data.tar.gz: 99305967e4efd098f560a968e290ed45f687841f3246995b73e472a1776e29be
5
5
  SHA512:
6
- metadata.gz: 9c44d90b036a28539859a9c291bbdb6575061196fe52f25ddb76a48b512ee284f107e82ab8aa25e57c3c95135480ecd3e48e13932e839fcd8978764b25a0693b
7
- data.tar.gz: d6166c40c1003fa88abfd11ee36938bd435c58549501e321a6048ecbcf5c21f2be25ad30667d75a26845d6b63e0cc251778451d970de8c43237452327b8061d9
6
+ metadata.gz: 277da3d65b6fb4b0de530d152ef7c3f02cdd8aca331f8b0b8d201fd9ce99c245f80556ad9f5465d7aba7a47b0cfba3823ce98b6afb11dd8df2ef3ced774c2232
7
+ data.tar.gz: 767a3e807f6f26548c1535e297063a73c9b04e45c62b9f7c97929c4bde1917b33027b05a50625ee45b5fb9983f40d9e6337016978db94319bd2ce9f834c28860
@@ -39,7 +39,7 @@ jobs:
39
39
  polling_interval_seconds: 5
40
40
  timeout_minutes: 5
41
41
  max_attempts: 3
42
- command: sudo bash -c "curl -L https://github.com/metanorma/plantuml-install/raw/master/ubuntu.sh | bash"
42
+ command: sudo apt-get update -y && sudo bash -c "curl -L https://github.com/metanorma/plantuml-install/raw/master/ubuntu.sh | bash"
43
43
  - name: Run specs
44
44
  run: |
45
45
  bundle exec rake
@@ -46,7 +46,7 @@ module Asciidoctor
46
46
 
47
47
  def init(node)
48
48
  super
49
- @amd = %w(amendment technical-corrigendum).include? node.attr("doctype")
49
+ @amd = %w(amendment technical-corrigendum).include? doctype(node)
50
50
  end
51
51
 
52
52
  def outputs(node, ret)
@@ -158,7 +158,17 @@
158
158
  <data type="ID"/>
159
159
  </attribute>
160
160
  <oneOrMore>
161
- <ref name="paragraph"/>
161
+ <choice>
162
+ <ref name="formula"/>
163
+ <ref name="ul"/>
164
+ <ref name="ol"/>
165
+ <ref name="dl"/>
166
+ <ref name="quote"/>
167
+ <ref name="sourcecode"/>
168
+ <ref name="paragraph"/>
169
+ <ref name="table"/>
170
+ <ref name="figure"/>
171
+ </choice>
162
172
  </oneOrMore>
163
173
  </element>
164
174
  </define>
@@ -402,6 +412,16 @@
402
412
  </choice>
403
413
  </attribute>
404
414
  </optional>
415
+ <optional>
416
+ <attribute name="valign">
417
+ <choice>
418
+ <value>top</value>
419
+ <value>middle</value>
420
+ <value>bottom</value>
421
+ <value>baseline</value>
422
+ </choice>
423
+ </attribute>
424
+ </optional>
405
425
  <choice>
406
426
  <zeroOrMore>
407
427
  <ref name="TextElement"/>
@@ -429,6 +449,16 @@
429
449
  </choice>
430
450
  </attribute>
431
451
  </optional>
452
+ <optional>
453
+ <attribute name="valign">
454
+ <choice>
455
+ <value>top</value>
456
+ <value>middle</value>
457
+ <value>bottom</value>
458
+ <value>baseline</value>
459
+ </choice>
460
+ </attribute>
461
+ </optional>
432
462
  <choice>
433
463
  <zeroOrMore>
434
464
  <ref name="TextElement"/>
@@ -13,7 +13,7 @@ module Asciidoctor
13
13
  super
14
14
  structured_id(node, xml)
15
15
  xml.stagename stage_name(get_stage(node), get_substage(node),
16
- node.attr("doctype"), node.attr("iteration"))
16
+ doctype(node), node.attr("iteration"))
17
17
  @amd && a = node.attr("updates-document-type") and
18
18
  xml.updates_document_type a
19
19
  end
@@ -34,7 +34,7 @@ module Asciidoctor
34
34
 
35
35
  def metadata_author(node, xml)
36
36
  publishers = node.attr("publisher") || "ISO"
37
- publishers.split(/,[ ]?/).each do |p|
37
+ csv_split(publishers).each do |p|
38
38
  xml.contributor do |c|
39
39
  c.role **{ type: "author" }
40
40
  c.organization { |a| organization(a, p) }
@@ -44,7 +44,7 @@ module Asciidoctor
44
44
 
45
45
  def metadata_publisher(node, xml)
46
46
  publishers = node.attr("publisher") || "ISO"
47
- publishers.split(/,[ ]?/).each do |p|
47
+ csv_split(publishers).each do |p|
48
48
  xml.contributor do |c|
49
49
  c.role **{ type: "publisher" }
50
50
  c.organization { |a| organization(a, p) }
@@ -53,8 +53,8 @@ module Asciidoctor
53
53
  end
54
54
 
55
55
  def metadata_copyright(node, xml)
56
- publishers = node.attr("publisher") || "ISO"
57
- publishers.split(/,[ ]?/).each do |p|
56
+ publishers = node.attr("copyright-holder") || node.attr("publisher") || "ISO"
57
+ csv_split(publishers).each do |p|
58
58
  xml.copyright do |c|
59
59
  c.from (node.attr("copyright-year") || Date.today.year)
60
60
  c.owner do |owner|
@@ -68,7 +68,7 @@ module Asciidoctor
68
68
  stage = get_stage(node)
69
69
  substage = get_substage(node)
70
70
  xml.status do |s|
71
- s.stage stage, **attr_code(abbreviation: stage_abbr(stage, substage, node.attr("doctype")))
71
+ s.stage stage, **attr_code(abbreviation: stage_abbr(stage, substage, doctype(node)))
72
72
  s.substage substage
73
73
  node.attr("iteration") && (s.iteration node.attr("iteration"))
74
74
  end
@@ -95,7 +95,7 @@ module Asciidoctor
95
95
  def add_amd_parts(dn, node)
96
96
  a = node.attr("amendment-number")
97
97
  c = node.attr("corrigendum-number")
98
- case node.attr("doctype")
98
+ case doctype(node)
99
99
  when "amendment"
100
100
  "#{dn}/Amd #{node.attr('amendment-number')}"
101
101
  when "technical-corrigendum"
@@ -134,11 +134,11 @@ module Asciidoctor
134
134
 
135
135
  def id_stage_abbr(stage, substage, node)
136
136
  ret = IsoDoc::Iso::Metadata.new("en", "Latn", @i18n).
137
- status_abbrev(stage_abbr(stage, substage, node.attr("doctype")),
137
+ status_abbrev(stage_abbr(stage, substage, doctype(node)),
138
138
  substage, node.attr("iteration"),
139
- node.attr("draft"), node.attr("doctype"))
139
+ node.attr("draft"), doctype(node))
140
140
  if %w(amendment technical-corrigendum amendment
141
- technical-corrigendum).include?(node.attr("doctype"))
141
+ technical-corrigendum).include?(doctype(node))
142
142
  ret = ret + " " unless %w(40 50).include?(stage)
143
143
  end
144
144
  ret
@@ -184,7 +184,7 @@ module Asciidoctor
184
184
  end
185
185
 
186
186
  def get_typeabbr(node)
187
- case node.attr("doctype")
187
+ case doctype(node)
188
188
  when "technical-report" then "TR "
189
189
  when "technical-specification" then "TS "
190
190
  else
@@ -42,8 +42,11 @@
42
42
  </define>
43
43
  <define name="xref">
44
44
  <element name="xref">
45
+ <!-- attribute target { xsd:IDREF }, -->
45
46
  <attribute name="target">
46
- <data type="IDREF"/>
47
+ <data type="string">
48
+ <param name="pattern">\i\c*|\c+#\c+</param>
49
+ </data>
47
50
  </attribute>
48
51
  <optional>
49
52
  <attribute name="type">
@@ -578,6 +581,8 @@
578
581
  <ref name="ol"/>
579
582
  <ref name="dl"/>
580
583
  <ref name="formula"/>
584
+ <ref name="quote"/>
585
+ <ref name="sourcecode"/>
581
586
  </choice>
582
587
  </oneOrMore>
583
588
  </element>
@@ -661,6 +666,16 @@
661
666
  </choice>
662
667
  </attribute>
663
668
  </optional>
669
+ <optional>
670
+ <attribute name="valign">
671
+ <choice>
672
+ <value>top</value>
673
+ <value>middle</value>
674
+ <value>bottom</value>
675
+ <value>baseline</value>
676
+ </choice>
677
+ </attribute>
678
+ </optional>
664
679
  <choice>
665
680
  <zeroOrMore>
666
681
  <choice>
@@ -697,6 +712,16 @@
697
712
  </choice>
698
713
  </attribute>
699
714
  </optional>
715
+ <optional>
716
+ <attribute name="valign">
717
+ <choice>
718
+ <value>top</value>
719
+ <value>middle</value>
720
+ <value>bottom</value>
721
+ <value>baseline</value>
722
+ </choice>
723
+ </attribute>
724
+ </optional>
700
725
  <choice>
701
726
  <zeroOrMore>
702
727
  <choice>
@@ -1049,14 +1074,17 @@
1049
1074
  <ref name="section-title"/>
1050
1075
  </optional>
1051
1076
  <group>
1052
- <group>
1053
- <zeroOrMore>
1054
- <ref name="BasicBlock"/>
1055
- </zeroOrMore>
1056
- <zeroOrMore>
1057
- <ref name="note"/>
1058
- </zeroOrMore>
1059
- </group>
1077
+ <choice>
1078
+ <group>
1079
+ <zeroOrMore>
1080
+ <ref name="BasicBlock"/>
1081
+ </zeroOrMore>
1082
+ <zeroOrMore>
1083
+ <ref name="note"/>
1084
+ </zeroOrMore>
1085
+ </group>
1086
+ <ref name="amend"/>
1087
+ </choice>
1060
1088
  <zeroOrMore>
1061
1089
  <choice>
1062
1090
  <ref name="clause-subsection"/>
@@ -1507,4 +1535,79 @@
1507
1535
  <ref name="CitationType"/>
1508
1536
  </element>
1509
1537
  </define>
1538
+ <define name="amend">
1539
+ <element name="amend">
1540
+ <optional>
1541
+ <attribute name="id">
1542
+ <data type="ID"/>
1543
+ </attribute>
1544
+ </optional>
1545
+ <attribute name="change">
1546
+ <choice>
1547
+ <value>add</value>
1548
+ <value>modify</value>
1549
+ <value>delete</value>
1550
+ </choice>
1551
+ </attribute>
1552
+ <optional>
1553
+ <attribute name="path"/>
1554
+ </optional>
1555
+ <optional>
1556
+ <attribute name="path_end"/>
1557
+ </optional>
1558
+ <optional>
1559
+ <attribute name="title"/>
1560
+ </optional>
1561
+ <optional>
1562
+ <element name="location">
1563
+ <zeroOrMore>
1564
+ <ref name="locality"/>
1565
+ </zeroOrMore>
1566
+ </element>
1567
+ </optional>
1568
+ <zeroOrMore>
1569
+ <ref name="autonumber"/>
1570
+ </zeroOrMore>
1571
+ <optional>
1572
+ <element name="description">
1573
+ <zeroOrMore>
1574
+ <ref name="BasicBlock"/>
1575
+ </zeroOrMore>
1576
+ </element>
1577
+ </optional>
1578
+ <optional>
1579
+ <element name="newcontent">
1580
+ <zeroOrMore>
1581
+ <ref name="BasicBlock"/>
1582
+ </zeroOrMore>
1583
+ </element>
1584
+ </optional>
1585
+ <optional>
1586
+ <element name="description">
1587
+ <zeroOrMore>
1588
+ <ref name="BasicBlock"/>
1589
+ </zeroOrMore>
1590
+ </element>
1591
+ </optional>
1592
+ </element>
1593
+ </define>
1594
+ <define name="autonumber">
1595
+ <element name="autonumber">
1596
+ <attribute name="type">
1597
+ <choice>
1598
+ <value>requirement</value>
1599
+ <value>recommendation</value>
1600
+ <value>permission</value>
1601
+ <value>table</value>
1602
+ <value>figure</value>
1603
+ <value>admonition</value>
1604
+ <value>formula</value>
1605
+ <value>sourcecode</value>
1606
+ <value>example</value>
1607
+ <value>note</value>
1608
+ </choice>
1609
+ </attribute>
1610
+ <text/>
1611
+ </element>
1612
+ </define>
1510
1613
  </grammar>
@@ -30,13 +30,6 @@ module Asciidoctor
30
30
  xml << node.content
31
31
  end
32
32
 
33
- def section_attributes(node)
34
- super.merge(
35
- change: @amd ? node.attr("change") : nil,
36
- locality: @amd ? node.attr("locality") : nil,
37
- )
38
- end
39
-
40
33
  def sectiontype(node, level = true)
41
34
  return nil if @amd
42
35
  super
@@ -7,6 +7,7 @@ module Asciidoctor
7
7
  foreword_validate(doc.root)
8
8
  normref_validate(doc.root)
9
9
  symbols_validate(doc.root)
10
+ sections_presence_validate(doc.root)
10
11
  sections_sequence_validate(doc.root)
11
12
  section_style(doc.root)
12
13
  subclause_validate(doc.root)
@@ -55,6 +56,15 @@ module Asciidoctor
55
56
  names
56
57
  end
57
58
 
59
+ def sections_presence_validate(root)
60
+ root.at("//sections/clause[@type = 'scope']") or
61
+ @log.add("Style", nil, "Scope clause missing")
62
+ root.at("//references[@normative = 'true']") or
63
+ @log.add("Style", nil, "Normative references missing")
64
+ root.at("//terms") or
65
+ @log.add("Style", nil, "Terms & definitions missing")
66
+ end
67
+
58
68
  # spec of permissible section sequence
59
69
  # we skip normative references, it goes to end of list
60
70
  SEQ =
@@ -652,7 +652,7 @@ div.figdl p, table.figdl p {
652
652
  table.formula_dl {
653
653
  margin-left: 20.15pt; }
654
654
 
655
- table.MsoISOTable {
655
+ table.MsoISOTable, table.MsoISOTableBig {
656
656
  mso-style-name: "Table ISO";
657
657
  mso-tstyle-rowband-size: 0;
658
658
  mso-tstyle-colband-size: 0;
@@ -673,17 +673,17 @@ table.MsoISOTable {
673
673
  font-size: 10.0pt;
674
674
  font-family: {{bodyfont}}; }
675
675
 
676
- table.MsoISOTable th {
676
+ table.MsoISOTable th, table.MsoISOTableBig th {
677
677
  border: solid windowtext 1pt;
678
678
  mso-border-alt: solid windowtext 1pt;
679
679
  padding: 0cm 2.85pt 0cm 2.85pt; }
680
680
 
681
- table.MsoISOTable td {
681
+ table.MsoISOTable td, table.MsoISOTableBig td {
682
682
  border: solid windowtext 1pt;
683
683
  mso-border-alt: solid windowtext 1pt;
684
684
  padding: 0cm 2.85pt 0cm 2.85pt; }
685
685
 
686
- table.MsoISOTable p {
686
+ table.MsoISOTable p, table.MsoISOTableBig p {
687
687
  font-size: 10.0pt; }
688
688
 
689
689
  table.MsoTableGrid {
@@ -855,8 +855,20 @@ div.example p.MsoListParagraph {
855
855
  font-size: 10.0pt; }
856
856
 
857
857
  div.Note p.MsoListParagraph {
858
+ font-size: 10.0pt;
859
+ margin-left: 1.0cm; }
860
+
861
+ div.Note span.stem {
858
862
  font-size: 10.0pt; }
859
863
 
864
+ div.Note p.Sourcecode, div.Note pre.Sourcecode {
865
+ font-size: 8.0pt;
866
+ margin-left: 1.0cm; }
867
+
868
+ div.Note table.dl {
869
+ font-size: 10.0pt;
870
+ margin-left: 1.0cm; }
871
+
860
872
  span.note_label, span.example_label, td.example_label, td.note_label {
861
873
  font-size: 10.0pt;
862
874
  font-family: {{bodyfont}}; }
@@ -627,7 +627,7 @@ table.formula_dl {
627
627
  margin-left:20.15pt;
628
628
  }
629
629
 
630
- table.MsoISOTable
630
+ table.MsoISOTable, table.MsoISOTableBig
631
631
  {mso-style-name:"Table ISO";
632
632
  mso-tstyle-rowband-size:0;
633
633
  mso-tstyle-colband-size:0;
@@ -647,15 +647,15 @@ table.MsoISOTable
647
647
  mso-border-insidev:.75pt solid windowtext;
648
648
  font-size:10.0pt;
649
649
  font-family:$bodyfont;}
650
- table.MsoISOTable th
650
+ table.MsoISOTable th, table.MsoISOTableBig th
651
651
  {border:solid windowtext 1pt;
652
652
  mso-border-alt:solid windowtext 1pt;
653
653
  padding:0cm 2.85pt 0cm 2.85pt;}
654
- table.MsoISOTable td
654
+ table.MsoISOTable td, table.MsoISOTableBig td
655
655
  {border:solid windowtext 1pt;
656
656
  mso-border-alt:solid windowtext 1pt;
657
657
  padding:0cm 2.85pt 0cm 2.85pt;}
658
- table.MsoISOTable p
658
+ table.MsoISOTable p, table.MsoISOTableBig p
659
659
  {font-size:10.0pt; }
660
660
  table.MsoTableGrid
661
661
  {mso-style-name:"Table Grid";
@@ -842,6 +842,20 @@ div.example p.MsoListParagraph {
842
842
 
843
843
  div.Note p.MsoListParagraph {
844
844
  font-size: 10.0pt;
845
+ margin-left: 1.0cm;
846
+ }
847
+
848
+ div.Note span.stem {
849
+ font-size: 10.0pt; }
850
+
851
+ div.Note p.Sourcecode, div.Note pre.Sourcecode {
852
+ font-size: 8.0pt;
853
+ margin-left: 1.0cm;
854
+ }
855
+
856
+ div.Note table.dl {
857
+ font-size: 10.0pt;
858
+ margin-left: 1.0cm;
845
859
  }
846
860
 
847
861
  span.note_label, span.example_label, td.example_label, td.note_label