metanorma-gb 1.3.21 → 1.3.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9572e4b6c6d084df727b40bfc2827cdba1e9238f2905213753166091ce6d7fb6
4
- data.tar.gz: 0cc451ec6098c3fcaeb4d7f246cec4b623f2a2ce7a2ae9b9600f453163814767
3
+ metadata.gz: c5ab15c22cf0e24f6123d08214e17d272620bde6ec0075d242401c6cfa66b114
4
+ data.tar.gz: ac1ad202131c7f4a060ba2e5e564fd49079bf8d106e4a553adf382b6059b3668
5
5
  SHA512:
6
- metadata.gz: f62662c60f2f0bea290ae7bcc81cb17af9e7738f31305a90cdc9ce7259e8f2d6a31fb2596cc7e735e21cf62d3c20f240fced43f552ec04a8b359ae778b742e80
7
- data.tar.gz: 15727819f77f7d1b9456377f5c6aa22b4fbe4e900a9fd6de656dcd0015ea0125ecad379f3079adeefa3092d0d93fbe9c5ed6b3ab5113a0f089403f04aa678f84
6
+ metadata.gz: a6a151c0c4295e76c15b6d91f41afb3aab397cd864bd7d2ff53352c6e13b9a8e2ca1eaf965ddd7dee4d381581148c2e490b4788fcd562bd25f886e7103356a02
7
+ data.tar.gz: 06c2cc4e0c48481b05520836ad03da70a026a72f04620683bf8a5badad808050cfcd8961832dd9ea6c9de53edb769296ae7d8eee316282ff33c57cf305e07fd8
@@ -6,15 +6,23 @@ on:
6
6
  push:
7
7
  branches: [ master ]
8
8
  pull_request:
9
+ paths-ignore:
10
+ - .github/workflows/ubuntu.yml
11
+ - .github/workflows/windows.yml
9
12
 
10
13
  jobs:
11
14
  test-macos:
12
15
  name: Test on Ruby ${{ matrix.ruby }} macOS
13
16
  runs-on: macos-latest
17
+ continue-on-error: ${{ matrix.experimental }}
14
18
  strategy:
15
19
  fail-fast: false
16
20
  matrix:
17
21
  ruby: [ '2.6', '2.5', '2.4' ]
22
+ experimental: [false]
23
+ include:
24
+ - ruby: '2.7'
25
+ experimental: true
18
26
  steps:
19
27
  - uses: actions/checkout@master
20
28
  - name: Use Ruby
@@ -5,16 +5,26 @@ name: ubuntu
5
5
  on:
6
6
  push:
7
7
  branches: [ master ]
8
+ tags:
9
+ - '*'
8
10
  pull_request:
11
+ paths-ignore:
12
+ - .github/workflows/macos.yml
13
+ - .github/workflows/windows.yml
9
14
 
10
15
  jobs:
11
16
  test-linux:
12
17
  name: Test on Ruby ${{ matrix.ruby }} Ubuntu
13
18
  runs-on: ubuntu-latest
19
+ continue-on-error: ${{ matrix.experimental }}
14
20
  strategy:
15
21
  fail-fast: false
16
22
  matrix:
17
23
  ruby: [ '2.6', '2.5', '2.4' ]
24
+ experimental: [false]
25
+ include:
26
+ - ruby: '2.7'
27
+ experimental: true
18
28
  steps:
19
29
  - uses: actions/checkout@master
20
30
  - name: Use Ruby
@@ -39,5 +49,5 @@ jobs:
39
49
  [[ -f ".github/workflows/dependent_repos.env" ]] && source .github/workflows/dependent_repos.env
40
50
  for repo in $DEPENDENT_REPOS
41
51
  do
42
- sh trigger-gh-actions.sh $ORGANISATION $repo $GH_USERNAME $GH_ACCESS_TOKEN $GITHUB_REPOSITORY
52
+ sh trigger-gh-actions.sh $ORGANISATION $repo $GH_USERNAME $GH_ACCESS_TOKEN $GITHUB_REPOSITORY "{ \"ref\": \"${GITHUB_REF}\" }"
43
53
  done
@@ -6,15 +6,23 @@ on:
6
6
  push:
7
7
  branches: [ master ]
8
8
  pull_request:
9
+ paths-ignore:
10
+ - .github/workflows/macos.yml
11
+ - .github/workflows/ubuntu.yml
9
12
 
10
13
  jobs:
11
14
  test-windows:
12
15
  name: Test on Ruby ${{ matrix.ruby }} Windows
13
16
  runs-on: windows-latest
17
+ continue-on-error: ${{ matrix.experimental }}
14
18
  strategy:
15
19
  fail-fast: false
16
20
  matrix:
17
21
  ruby: [ '2.6', '2.5', '2.4' ]
22
+ experimental: [false]
23
+ include:
24
+ - ruby: '2.7'
25
+ experimental: true
18
26
  steps:
19
27
  - uses: actions/checkout@master
20
28
  - name: Use Ruby
@@ -27,7 +35,6 @@ jobs:
27
35
  run: |
28
36
  gem install bundler
29
37
  bundle config --local path vendor/bundle
30
- bundle update
31
38
  bundle install --jobs 4 --retry 3
32
39
  - name: Run specs
33
40
  run: |
@@ -88,7 +88,7 @@
88
88
  <text/>
89
89
  </element>
90
90
  </define>
91
- <define name="LocalizedString">
91
+ <define name="LocalizedString1">
92
92
  <optional>
93
93
  <!-- multiple languages and scripts possible: comma delimit them if so -->
94
94
  <attribute name="language"/>
@@ -98,6 +98,16 @@
98
98
  </optional>
99
99
  <text/>
100
100
  </define>
101
+ <define name="LocalizedString">
102
+ <choice>
103
+ <ref name="LocalizedString1"/>
104
+ <oneOrMore>
105
+ <element name="variant">
106
+ <ref name="LocalizedString1"/>
107
+ </element>
108
+ </oneOrMore>
109
+ </choice>
110
+ </define>
101
111
  <!--
102
112
  Unlike UML, change type to format: type is overloaded
103
113
  Would be need if plain were default value and could omit the attribute
@@ -121,7 +131,7 @@
121
131
  </optional>
122
132
  <ref name="LocalizedStringOrXsAny"/>
123
133
  </define>
124
- <define name="LocalizedStringOrXsAny">
134
+ <define name="LocalizedStringOrXsAny1">
125
135
  <optional>
126
136
  <!-- multiple languages and scripts possible: comma delimit them if so -->
127
137
  <attribute name="language"/>
@@ -136,6 +146,16 @@
136
146
  </choice>
137
147
  </oneOrMore>
138
148
  </define>
149
+ <define name="LocalizedStringOrXsAny">
150
+ <choice>
151
+ <ref name="LocalizedStringOrXsAny1"/>
152
+ <oneOrMore>
153
+ <element name="variant">
154
+ <ref name="LocalizedStringOrXsAny1"/>
155
+ </element>
156
+ </oneOrMore>
157
+ </choice>
158
+ </define>
139
159
  <define name="contributor">
140
160
  <element name="contributor">
141
161
  <zeroOrMore>
@@ -641,9 +661,9 @@
641
661
  <optional>
642
662
  <ref name="status"/>
643
663
  </optional>
644
- <optional>
664
+ <zeroOrMore>
645
665
  <ref name="copyright"/>
646
- </optional>
666
+ </zeroOrMore>
647
667
  <zeroOrMore>
648
668
  <ref name="docrelation"/>
649
669
  </zeroOrMore>
@@ -767,6 +787,8 @@
767
787
  <value>unchanged</value>
768
788
  <value>circulated</value>
769
789
  <value>adapted</value>
790
+ <value>vote-started</value>
791
+ <value>vote-ended</value>
770
792
  </choice>
771
793
  </define>
772
794
  <define name="bdate">
@@ -999,7 +1021,17 @@
999
1021
  <optional>
1000
1022
  <ref name="to"/>
1001
1023
  </optional>
1002
- <ref name="owner"/>
1024
+ <oneOrMore>
1025
+ <ref name="owner"/>
1026
+ </oneOrMore>
1027
+ <optional>
1028
+ <ref name="copyright_scope"/>
1029
+ </optional>
1030
+ </element>
1031
+ </define>
1032
+ <define name="copyright_scope">
1033
+ <element name="scope">
1034
+ <text/>
1003
1035
  </element>
1004
1036
  </define>
1005
1037
  <define name="from">
@@ -1019,38 +1051,63 @@
1019
1051
  </define>
1020
1052
  <define name="DocRelationType">
1021
1053
  <choice>
1022
- <value>obsoletes</value>
1023
- <value>obsoletedBy</value>
1024
- <value>supersedes</value>
1025
- <value>supersededBy</value>
1026
- <value>updates</value>
1027
- <value>updatedBy</value>
1028
- <value>complements</value>
1029
- <value>derivedFrom</value>
1030
- <value>translatedFrom</value>
1031
- <value>hasTranslation</value>
1032
- <value>adoptedFrom</value>
1033
- <value>equivalent</value>
1034
- <value>identical</value>
1035
- <value>nonequivalent</value>
1036
- <value>includedIn</value>
1037
1054
  <value>includes</value>
1038
- <value>instance</value>
1039
- <value>instanceOf</value>
1040
- <value>partOf</value>
1055
+ <value>includedIn</value>
1041
1056
  <value>hasPart</value>
1042
- <value>hasDraft</value>
1043
- <value>draftOf</value>
1057
+ <value>partOf</value>
1044
1058
  <value>merges</value>
1059
+ <value>mergedInto</value>
1045
1060
  <value>splits</value>
1046
- <value>amends</value>
1047
- <value>amendedBy</value>
1048
- <value>corrects</value>
1049
- <value>correctedBy</value>
1050
- <value>revises</value>
1051
- <value>revisedBy</value>
1061
+ <value>splitInto</value>
1062
+ <value>instance</value>
1063
+ <value>hasInstance</value>
1064
+ <value>exemplarOf</value>
1065
+ <value>hasExemplar</value>
1066
+ <value>manifestationOf</value>
1067
+ <value>hasManifestation</value>
1068
+ <value>reproductionOf</value>
1069
+ <value>hasReproduction</value>
1070
+ <value>reprintOf</value>
1071
+ <value>hasReprint</value>
1072
+ <value>expressionOf</value>
1073
+ <value>hasExpression</value>
1074
+ <value>translatedFrom</value>
1075
+ <value>hasTranslation</value>
1076
+ <value>arrangementOf</value>
1077
+ <value>hasArrangement</value>
1078
+ <value>abridgementOf</value>
1079
+ <value>hasAbridgement</value>
1080
+ <value>annotationOf</value>
1081
+ <value>hasAnnotation</value>
1082
+ <value>draftOf</value>
1083
+ <value>hasDraft</value>
1084
+ <value>editionOf</value>
1085
+ <value>hasEdition</value>
1086
+ <value>updates</value>
1087
+ <value>updatedBy</value>
1088
+ <value>derivedFrom</value>
1089
+ <value>derives</value>
1052
1090
  <value>describes</value>
1053
1091
  <value>describedBy</value>
1092
+ <value>catalogues</value>
1093
+ <value>cataloguedBy</value>
1094
+ <value>hasSuccessor</value>
1095
+ <value>successorOf</value>
1096
+ <value>adaptedFrom</value>
1097
+ <value>hasAdaptation</value>
1098
+ <value>adoptedFrom</value>
1099
+ <value>adoptedAs</value>
1100
+ <value>reviewOf</value>
1101
+ <value>hasReview</value>
1102
+ <value>commentaryOf</value>
1103
+ <value>hasCommentary</value>
1104
+ <value>related</value>
1105
+ <value>complements</value>
1106
+ <value>complementOf</value>
1107
+ <value>obsoletes</value>
1108
+ <value>obsoletedBy</value>
1109
+ <value>cited</value>
1110
+ <value>isCitedIn</value>
1054
1111
  </choice>
1055
1112
  </define>
1056
1113
  <define name="docrelation">
@@ -3,6 +3,7 @@ require "asciidoctor/iso/converter"
3
3
  require "metanorma/gb/version"
4
4
  require "isodoc/gb/gbconvert"
5
5
  require "isodoc/gb/gbwordconvert"
6
+ require "isodoc/gb/pdf_convert"
6
7
  require "gb_agencies"
7
8
  require_relative "./section_input.rb"
8
9
  require_relative "./front.rb"
@@ -58,6 +59,11 @@ module Asciidoctor
58
59
  IsoDoc::Gb::WordConvert.new(doc_extract_attributes(node))
59
60
  end
60
61
 
62
+ def pdf_converter(node)
63
+ node.nil? ? IsoDoc::Gb::PdfConvert.new({}) :
64
+ IsoDoc::Gb::PdfConvert.new(doc_extract_attributes(node))
65
+ end
66
+
61
67
  def document(node)
62
68
  init(node)
63
69
  ret = makexml(node).to_xml(indent: 2)
@@ -68,6 +74,7 @@ module Asciidoctor
68
74
  FileUtils.mv "#{filename}.html", "#{filename}_compliant.html"
69
75
  html_converter(node).convert(filename + ".xml")
70
76
  doc_converter(node).convert(filename + ".xml")
77
+ pdf_converter(node).convert(filename + ".xml")
71
78
  end
72
79
  @log.write(@localdir + @filename + ".err") unless @novalid
73
80
  @files_to_delete.each { |f| FileUtils.rm f }
@@ -1,24 +1,8 @@
1
+ require_relative "front_id"
2
+
1
3
  module Asciidoctor
2
4
  module Gb
3
5
  class Converter < ISO::Converter
4
- STAGE_ABBRS_CN = {
5
- "00": "新工作项目建议",
6
- "10": "新工作项目",
7
- "20": "标准草案工作组讨论稿",
8
- "30": "标准草案征求意见稿",
9
- "40": "标准草案送审稿",
10
- "50": "标准草案报批稿",
11
- "60": "国家标准",
12
- "90": "(Review)",
13
- "95": "(Withdrawal)",
14
- }.freeze
15
-
16
- def stage_name(stage, substage)
17
- return "Proof" if stage == "60" && substage == "00"
18
- @language == "en" ?
19
- STAGE_NAMES[stage.to_sym] : STAGE_ABBRS_CN[stage.to_sym]
20
- end
21
-
22
6
  def doctype(node)
23
7
  type = node.attr("mandate") || "mandatory"
24
8
  type = "standard" if type == "mandatory"
@@ -192,40 +176,6 @@ module Asciidoctor
192
176
  metadata_contributor1(node, xml, "issuer", "issuer")
193
177
  end
194
178
 
195
- def iso_id(node, xml)
196
- return unless node.attr("docnumber")
197
- part = node.attr("partnumber")
198
- dn = add_id_parts(node.attr("docnumber"), part, nil)
199
- dn = id_stage_prefix(dn, node)
200
- xml.docidentifier dn, **attr_code(type: "gb")
201
- end
202
-
203
- def structured_id(node, xml)
204
- part = node.attr("partnumber")
205
- xml.structuredidentifier do |i|
206
- i.project_number node.attr("docnumber"),
207
- **attr_code(part: part)
208
- end
209
- end
210
-
211
- def add_id_parts(dn, part, subpart)
212
- dn += ".#{part}" if part
213
- dn += ".#{subpart}" if subpart
214
- dn
215
- end
216
-
217
- def id_stage_prefix(dn, node)
218
- if node.attr("docstage") && node.attr("docstage").to_i < 60
219
- abbr = IsoDoc::Gb::Metadata.new("en", "Latn", {}).
220
- status_abbrev(node.attr("docstage"), node.attr("iteration"),
221
- node.attr("draft"))
222
- dn = "/#{abbr} #{dn}" # prefixes added in cleanup
223
- else
224
- dn += "-#{node.attr("copyright-year")}" if node.attr("copyright-year")
225
- end
226
- dn
227
- end
228
-
229
179
  def metadata_language(node, xml)
230
180
  xml.language (node.attr("language") || "zh")
231
181
  end
@@ -0,0 +1,57 @@
1
+ module Asciidoctor
2
+ module Gb
3
+ class Converter < ISO::Converter
4
+ STAGE_ABBRS_CN = {
5
+ "00": "新工作项目建议",
6
+ "10": "新工作项目",
7
+ "20": "标准草案工作组讨论稿",
8
+ "30": "标准草案征求意见稿",
9
+ "40": "标准草案送审稿",
10
+ "50": "标准草案报批稿",
11
+ "60": "国家标准",
12
+ "90": "(Review)",
13
+ "95": "(Withdrawal)",
14
+ }.freeze
15
+
16
+ def stage_name(stage, substage)
17
+ return "Proof" if stage == "60" && substage == "00"
18
+ @language == "en" ?
19
+ STAGE_NAMES[stage.to_sym] : STAGE_ABBRS_CN[stage.to_sym]
20
+ end
21
+
22
+ def iso_id(node, xml)
23
+ return unless node.attr("docnumber")
24
+ part = node.attr("partnumber")
25
+ dn = add_id_parts(node.attr("docnumber"), part, nil)
26
+ dn = id_stage_prefix(dn, node)
27
+ xml.docidentifier dn, **attr_code(type: "gb")
28
+ end
29
+
30
+ def structured_id(node, xml)
31
+ part = node.attr("partnumber")
32
+ xml.structuredidentifier do |i|
33
+ i.project_number node.attr("docnumber"),
34
+ **attr_code(part: part)
35
+ end
36
+ end
37
+
38
+ def add_id_parts(dn, part, subpart)
39
+ dn += ".#{part}" if part
40
+ dn += ".#{subpart}" if subpart
41
+ dn
42
+ end
43
+
44
+ def id_stage_prefix(dn, node)
45
+ if node.attr("docstage") && node.attr("docstage").to_i < 60
46
+ abbr = IsoDoc::Gb::Metadata.new("en", "Latn", {}).
47
+ status_abbrev(node.attr("docstage"), nil, node.attr("iteration"),
48
+ node.attr("draft"), node.attr("doctype"))
49
+ dn = "/#{abbr} #{dn}" # prefixes added in cleanup
50
+ else
51
+ dn += "-#{node.attr("copyright-year")}" if node.attr("copyright-year")
52
+ end
53
+ dn
54
+ end
55
+ end
56
+ end
57
+ end
@@ -53,6 +53,14 @@
53
53
  <optional>
54
54
  <attribute name="alt"/>
55
55
  </optional>
56
+ <optional>
57
+ <attribute name="case">
58
+ <choice>
59
+ <value>capital</value>
60
+ <value>lowercase</value>
61
+ </choice>
62
+ </attribute>
63
+ </optional>
56
64
  <text/>
57
65
  </element>
58
66
  </define>
@@ -129,6 +137,9 @@
129
137
  </choice>
130
138
  </attribute>
131
139
  </optional>
140
+ <attribute name="normative">
141
+ <data type="boolean"/>
142
+ </attribute>
132
143
  <optional>
133
144
  <ref name="section-title"/>
134
145
  </optional>
@@ -305,6 +316,21 @@
305
316
  </define>
306
317
  </include>
307
318
  <!-- end overrides -->
319
+ <define name="TextElement" combine="choice">
320
+ <ref name="concept"/>
321
+ </define>
322
+ <define name="concept">
323
+ <element name="concept">
324
+ <optional>
325
+ <attribute name="term"/>
326
+ </optional>
327
+ <choice>
328
+ <ref name="eref"/>
329
+ <ref name="xref"/>
330
+ <ref name="termref"/>
331
+ </choice>
332
+ </element>
333
+ </define>
308
334
  <define name="BasicBlock" combine="choice">
309
335
  <choice>
310
336
  <ref name="requirement"/>
@@ -884,7 +910,15 @@
884
910
  <attribute name="id">
885
911
  <data type="ID"/>
886
912
  </attribute>
887
- <ref name="paragraph"/>
913
+ <oneOrMore>
914
+ <choice>
915
+ <ref name="paragraph"/>
916
+ <ref name="ul"/>
917
+ <ref name="ol"/>
918
+ <ref name="dl"/>
919
+ <ref name="formula"/>
920
+ </choice>
921
+ </oneOrMore>
888
922
  </element>
889
923
  </define>
890
924
  <define name="termexample">
@@ -911,7 +945,10 @@
911
945
  </define>
912
946
  <define name="origin">
913
947
  <element name="origin">
914
- <ref name="erefType"/>
948
+ <choice>
949
+ <ref name="erefType"/>
950
+ <ref name="termref"/>
951
+ </choice>
915
952
  </element>
916
953
  </define>
917
954
  <define name="modification">
@@ -919,6 +956,15 @@
919
956
  <ref name="paragraph"/>
920
957
  </element>
921
958
  </define>
959
+ <define name="termref">
960
+ <element name="termref">
961
+ <attribute name="base"/>
962
+ <attribute name="target"/>
963
+ <optional>
964
+ <text/>
965
+ </optional>
966
+ </element>
967
+ </define>
922
968
  <define name="structuredidentifier">
923
969
  <element name="structuredidentifier">
924
970
  <optional>