metanorma-itu 1.2.1 → 1.2.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: a6028239b8ffb9cf94de7759755fe208f1fdd936cf725f8888c17f197327a01f
4
- data.tar.gz: e32f5d0ee934edb77e41a0014d6cce1be685ed99505331808b3c4a96268e3f37
3
+ metadata.gz: eb287ff921a50fb1e0bc7f1c6e6508d96ed8850e973d0dc1da25720fa0e3856f
4
+ data.tar.gz: 55782324626afcec59caf220ae8129d0b9bf3acc66197b95146b909cba834590
5
5
  SHA512:
6
- metadata.gz: 6f49a564d79e27806d8d8669d8b58ac0400a560ea7cab85d5dfb00240e7d644ef70a1c31a8f873f44c10b88edf95f246a736c66ccac9c175b578ed709e08d43c
7
- data.tar.gz: c738f41c4de7edd4e5b1ca26f5f298731002c1299d644138638c76addbb8433d2bdb9882e80d0ffd04c5f85159392c6f361c6ec214b2d8a2b99d08bbf9216334
6
+ metadata.gz: 1ffb8747c3b8c3574393a27a1186842a0528840c2d02dc77a1154296db777d98ffbe31072833f08aa8802c39b0e2731cdbd10459ec68ddb0ca4467a341f3303b
7
+ data.tar.gz: 5c9519836a9c530132183ff18870764ffa97a6f88c36691cf554d423b1bd23f65ff4bc506fb4dcbe9a90198104b87b7e9ba70e25aae4759ecee9a4510748efb2
@@ -0,0 +1,44 @@
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 ]
8
+ pull_request:
9
+
10
+ jobs:
11
+ rake:
12
+ name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
13
+ runs-on: ${{ matrix.os }}
14
+ continue-on-error: ${{ matrix.experimental }}
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ ruby: [ '2.6', '2.5', '2.4' ]
19
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
20
+ experimental: [ false ]
21
+ include:
22
+ - ruby: '2.7'
23
+ os: 'ubuntu-latest'
24
+ experimental: true
25
+ - ruby: '2.7'
26
+ os: 'windows-latest'
27
+ experimental: true
28
+ - ruby: '2.7'
29
+ os: 'macos-latest'
30
+ experimental: true
31
+ steps:
32
+ - uses: actions/checkout@master
33
+
34
+ - name: Use Ruby
35
+ uses: ruby/setup-ruby@v1
36
+ with:
37
+ ruby-version: ${{ matrix.ruby }}
38
+ bundler-cache: true
39
+
40
+ - name: Update gems
41
+ run: bundle install --jobs 4 --retry 3
42
+
43
+ - name: Run specs
44
+ run: bundle exec rake
@@ -402,6 +402,16 @@
402
402
  </choice>
403
403
  </attribute>
404
404
  </optional>
405
+ <optional>
406
+ <attribute name="valign">
407
+ <choice>
408
+ <value>top</value>
409
+ <value>middle</value>
410
+ <value>bottom</value>
411
+ <value>baseline</value>
412
+ </choice>
413
+ </attribute>
414
+ </optional>
405
415
  <choice>
406
416
  <zeroOrMore>
407
417
  <ref name="TextElement"/>
@@ -429,6 +439,16 @@
429
439
  </choice>
430
440
  </attribute>
431
441
  </optional>
442
+ <optional>
443
+ <attribute name="valign">
444
+ <choice>
445
+ <value>top</value>
446
+ <value>middle</value>
447
+ <value>bottom</value>
448
+ <value>baseline</value>
449
+ </choice>
450
+ </attribute>
451
+ </optional>
432
452
  <choice>
433
453
  <zeroOrMore>
434
454
  <ref name="TextElement"/>
@@ -998,6 +1018,9 @@
998
1018
  <value>alphabet_upper</value>
999
1019
  </choice>
1000
1020
  </attribute>
1021
+ <optional>
1022
+ <attribute name="start"/>
1023
+ </optional>
1001
1024
  <oneOrMore>
1002
1025
  <ref name="li"/>
1003
1026
  </oneOrMore>
@@ -11,7 +11,7 @@ module Asciidoctor
11
11
  super
12
12
  xmldoc.xpath("//thead/tr[1]/th | //thead/tr[1]/td").each do |t|
13
13
  text = t.at("./descendant::text()") or next
14
- text.replace(text.text.titlecase)
14
+ text.replace(text.text.capitalize)
15
15
  end
16
16
  end
17
17
 
@@ -39,7 +39,7 @@ module Asciidoctor
39
39
  end
40
40
 
41
41
  def doctype(node)
42
- ret = node.attr("doctype") || "recommendation"
42
+ ret = super || "recommendation"
43
43
  ret = "recommendation" if ret == "article"
44
44
  ret
45
45
  end
@@ -60,8 +60,9 @@ module Asciidoctor
60
60
  nil, false, "#{@filename}.html")
61
61
  doc_converter(node).convert(@filename + ".presentation.xml",
62
62
  nil, false, "#{@filename}.doc")
63
- pdf_converter(node)&.convert(@filename + ".presentation.xml",
64
- nil, false, "#{@filename}.pdf")
63
+ node.attr("no-pdf") or
64
+ pdf_converter(node)&.convert(@filename + ".presentation.xml",
65
+ nil, false, "#{@filename}.pdf")
65
66
  end
66
67
 
67
68
  def validate(doc)
@@ -34,32 +34,34 @@ module Asciidoctor
34
34
  type = /^annex/.match(k) ? "annex" : "main"
35
35
  xml.title **attr_code(language: lang, format: "text/plain",
36
36
  type: type) do |t|
37
- t << v
37
+ t << Asciidoctor::Standoc::Utils::asciidoc_sub(v)
38
38
  end
39
39
  end
40
40
  end
41
41
 
42
42
  def title(node, xml)
43
43
  super
44
- subtitle_english(node, xml)
45
- subtitle_otherlangs(node, xml)
44
+ %w(subtitle amendment-title corrigendum-title).each do |t|
45
+ other_title_english(node, xml, t)
46
+ other_title_otherlangs(node, xml, t)
47
+ end
46
48
  end
47
49
 
48
- def subtitle_english(node, xml)
49
- at = { language: "en", format: "text/plain", type: "subtitle" }
50
- a = node.attr("subtitle") || node.attr("subtitle-en")
50
+ def other_title_english(node, xml, type)
51
+ at = { language: "en", format: "text/plain", type: type.sub(/-title/, "") }
52
+ a = node.attr(type) || node.attr("#{type}-en")
51
53
  xml.title **attr_code(at) do |t|
52
54
  t << Asciidoctor::Standoc::Utils::asciidoc_sub(a)
53
55
  end
54
56
  end
55
57
 
56
- def subtitle_otherlangs(node, xml)
58
+ def other_title_otherlangs(node, xml, type)
57
59
  node.attributes.each do |k, v|
58
- next unless /^subtitle-(?<lang>.+)$/ =~ k
59
- next if lang == "en"
60
- xml.title **attr_code(language: lang, format: "text/plain",
61
- type: "subtitle") do |t|
62
- t << v
60
+ next unless m = /^#{type}-(?<lang>.+)$/.match(k)
61
+ next if m[:lang] == "en"
62
+ xml.title **attr_code(language: m[:lang], format: "text/plain",
63
+ type: type.sub(/-title/, "")) do |t|
64
+ t << Asciidoctor::Standoc::Utils::asciidoc_sub(v)
63
65
  end
64
66
  end
65
67
  end
@@ -171,6 +173,27 @@ module Asciidoctor
171
173
  i.bureau node.attr("bureau") || "T"
172
174
  i.docnumber node.attr("docnumber")
173
175
  a = node.attr("annexid") and i.annexid a
176
+ a = node.attr("amendment-number") and i.amendment a
177
+ a = node.attr("corrigendum-number") and i.corrigendum a
178
+ end
179
+ end
180
+
181
+ def metadata_techreport(node, xml)
182
+ a = node.attr("meeting") and xml.meeting a
183
+ a = node.attr("meeting-date") and metadata_meeting_date(a, xml)
184
+ a = node.attr("intended-type") and xml.intended_type a
185
+ a = node.attr("source") and xml.source a
186
+ end
187
+
188
+ def metadata_meeting_date(a, xml)
189
+ xml.meeting_date do |m|
190
+ d = a.split("/")
191
+ if d.size > 1
192
+ m.from d[0]
193
+ m.to d[1]
194
+ else
195
+ m.on d[0]
196
+ end
174
197
  end
175
198
  end
176
199
 
@@ -180,6 +203,7 @@ module Asciidoctor
180
203
  metadata_ics(node, xml)
181
204
  metadata_recommendationstatus(node, xml)
182
205
  metadata_ip_notice(node, xml)
206
+ metadata_techreport(node, xml)
183
207
  structured_id(node, xml)
184
208
  end
185
209
  end
@@ -43,7 +43,9 @@
43
43
  <define name="xref">
44
44
  <element name="xref">
45
45
  <attribute name="target">
46
- <data type="IDREF"/>
46
+ <data type="string">
47
+ <param name="pattern">\i\c*|\c+#\c+</param>
48
+ </data>
47
49
  </attribute>
48
50
  <optional>
49
51
  <attribute name="type">
@@ -61,6 +63,11 @@
61
63
  </choice>
62
64
  </attribute>
63
65
  </optional>
66
+ <optional>
67
+ <attribute name="droploc">
68
+ <data type="boolean"/>
69
+ </attribute>
70
+ </optional>
64
71
  <text/>
65
72
  </element>
66
73
  </define>
@@ -578,6 +585,8 @@
578
585
  <ref name="ol"/>
579
586
  <ref name="dl"/>
580
587
  <ref name="formula"/>
588
+ <ref name="quote"/>
589
+ <ref name="sourcecode"/>
581
590
  </choice>
582
591
  </oneOrMore>
583
592
  </element>
@@ -661,6 +670,16 @@
661
670
  </choice>
662
671
  </attribute>
663
672
  </optional>
673
+ <optional>
674
+ <attribute name="valign">
675
+ <choice>
676
+ <value>top</value>
677
+ <value>middle</value>
678
+ <value>bottom</value>
679
+ <value>baseline</value>
680
+ </choice>
681
+ </attribute>
682
+ </optional>
664
683
  <choice>
665
684
  <zeroOrMore>
666
685
  <choice>
@@ -697,6 +716,16 @@
697
716
  </choice>
698
717
  </attribute>
699
718
  </optional>
719
+ <optional>
720
+ <attribute name="valign">
721
+ <choice>
722
+ <value>top</value>
723
+ <value>middle</value>
724
+ <value>bottom</value>
725
+ <value>baseline</value>
726
+ </choice>
727
+ </attribute>
728
+ </optional>
700
729
  <choice>
701
730
  <zeroOrMore>
702
731
  <choice>
@@ -834,6 +863,13 @@
834
863
  </define>
835
864
  <define name="standard-document">
836
865
  <element name="standard-document">
866
+ <attribute name="version"/>
867
+ <attribute name="type">
868
+ <choice>
869
+ <value>semantic</value>
870
+ <value>presentation</value>
871
+ </choice>
872
+ </attribute>
837
873
  <ref name="bibdata"/>
838
874
  <optional>
839
875
  <ref name="boilerplate"/>
@@ -855,7 +891,7 @@
855
891
  <oneOrMore>
856
892
  <choice>
857
893
  <ref name="content"/>
858
- <ref name="preface_abstract"/>
894
+ <ref name="abstract"/>
859
895
  <ref name="foreword"/>
860
896
  <ref name="introduction"/>
861
897
  <ref name="acknowledgements"/>
@@ -1049,14 +1085,17 @@
1049
1085
  <ref name="section-title"/>
1050
1086
  </optional>
1051
1087
  <group>
1052
- <group>
1053
- <zeroOrMore>
1054
- <ref name="BasicBlock"/>
1055
- </zeroOrMore>
1056
- <zeroOrMore>
1057
- <ref name="note"/>
1058
- </zeroOrMore>
1059
- </group>
1088
+ <choice>
1089
+ <group>
1090
+ <zeroOrMore>
1091
+ <ref name="BasicBlock"/>
1092
+ </zeroOrMore>
1093
+ <zeroOrMore>
1094
+ <ref name="note"/>
1095
+ </zeroOrMore>
1096
+ </group>
1097
+ <ref name="amend"/>
1098
+ </choice>
1060
1099
  <zeroOrMore>
1061
1100
  <choice>
1062
1101
  <ref name="clause-subsection"/>
@@ -1125,49 +1164,7 @@
1125
1164
  </define>
1126
1165
  <define name="annex">
1127
1166
  <element name="annex">
1128
- <optional>
1129
- <attribute name="id">
1130
- <data type="ID"/>
1131
- </attribute>
1132
- </optional>
1133
- <optional>
1134
- <attribute name="language"/>
1135
- </optional>
1136
- <optional>
1137
- <attribute name="script"/>
1138
- </optional>
1139
- <optional>
1140
- <attribute name="inline-header">
1141
- <data type="boolean"/>
1142
- </attribute>
1143
- </optional>
1144
- <attribute name="obligation">
1145
- <choice>
1146
- <value>normative</value>
1147
- <value>informative</value>
1148
- </choice>
1149
- </attribute>
1150
- <optional>
1151
- <ref name="section-title"/>
1152
- </optional>
1153
- <group>
1154
- <group>
1155
- <zeroOrMore>
1156
- <ref name="BasicBlock"/>
1157
- </zeroOrMore>
1158
- <zeroOrMore>
1159
- <ref name="note"/>
1160
- </zeroOrMore>
1161
- </group>
1162
- <zeroOrMore>
1163
- <choice>
1164
- <ref name="annex-subsection"/>
1165
- <ref name="terms"/>
1166
- <ref name="definitions"/>
1167
- <ref name="references"/>
1168
- </choice>
1169
- </zeroOrMore>
1170
- </group>
1167
+ <ref name="Annex-Section"/>
1171
1168
  </element>
1172
1169
  </define>
1173
1170
  <define name="terms">
@@ -1453,11 +1450,6 @@
1453
1450
  </optional>
1454
1451
  </element>
1455
1452
  </define>
1456
- <define name="preface_abstract">
1457
- <element name="abstract">
1458
- <ref name="Basic-Section"/>
1459
- </element>
1460
- </define>
1461
1453
  <define name="term-clause">
1462
1454
  <element name="clause">
1463
1455
  <optional>
@@ -1507,4 +1499,79 @@
1507
1499
  <ref name="CitationType"/>
1508
1500
  </element>
1509
1501
  </define>
1502
+ <define name="amend">
1503
+ <element name="amend">
1504
+ <optional>
1505
+ <attribute name="id">
1506
+ <data type="ID"/>
1507
+ </attribute>
1508
+ </optional>
1509
+ <attribute name="change">
1510
+ <choice>
1511
+ <value>add</value>
1512
+ <value>modify</value>
1513
+ <value>delete</value>
1514
+ </choice>
1515
+ </attribute>
1516
+ <optional>
1517
+ <attribute name="path"/>
1518
+ </optional>
1519
+ <optional>
1520
+ <attribute name="path_end"/>
1521
+ </optional>
1522
+ <optional>
1523
+ <attribute name="title"/>
1524
+ </optional>
1525
+ <optional>
1526
+ <element name="location">
1527
+ <zeroOrMore>
1528
+ <ref name="locality"/>
1529
+ </zeroOrMore>
1530
+ </element>
1531
+ </optional>
1532
+ <zeroOrMore>
1533
+ <ref name="autonumber"/>
1534
+ </zeroOrMore>
1535
+ <optional>
1536
+ <element name="description">
1537
+ <zeroOrMore>
1538
+ <ref name="BasicBlock"/>
1539
+ </zeroOrMore>
1540
+ </element>
1541
+ </optional>
1542
+ <optional>
1543
+ <element name="newcontent">
1544
+ <zeroOrMore>
1545
+ <ref name="BasicBlock"/>
1546
+ </zeroOrMore>
1547
+ </element>
1548
+ </optional>
1549
+ <optional>
1550
+ <element name="description">
1551
+ <zeroOrMore>
1552
+ <ref name="BasicBlock"/>
1553
+ </zeroOrMore>
1554
+ </element>
1555
+ </optional>
1556
+ </element>
1557
+ </define>
1558
+ <define name="autonumber">
1559
+ <element name="autonumber">
1560
+ <attribute name="type">
1561
+ <choice>
1562
+ <value>requirement</value>
1563
+ <value>recommendation</value>
1564
+ <value>permission</value>
1565
+ <value>table</value>
1566
+ <value>figure</value>
1567
+ <value>admonition</value>
1568
+ <value>formula</value>
1569
+ <value>sourcecode</value>
1570
+ <value>example</value>
1571
+ <value>note</value>
1572
+ </choice>
1573
+ </attribute>
1574
+ <text/>
1575
+ </element>
1576
+ </define>
1510
1577
  </grammar>