metanorma-iec 1.0.1 → 1.0.2

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: '0478aec1aa1acf4dbf00c1992325723e57ebe14121769810ef6a230b2dfbf7a9'
4
- data.tar.gz: 3d63928086246375072c6039e814e6b3c2344fbbdf84fc5ba0725b9ee3389548
3
+ metadata.gz: 5441a7cb520a15e832819d028708f0cd859794de377cc8cc38c24c4a748338c6
4
+ data.tar.gz: df973bae07cbf8d9be4eff4d33a2b3f5fed9c780aa497a7b6fbcfbeefbd17af8
5
5
  SHA512:
6
- metadata.gz: 6374795004440b778feaf50fc4f0ddb6fe515e673428ce4c743d81aed019ad311b97cc038a7038318e9d92a881454e058df17c19c54cc9f01131fe44ff188b3b
7
- data.tar.gz: '098debb725126f728718996db03b5adad76e2a13badd47808f9f51f602a2f2724fe7acad96f2b45c00820c00a4656b2ee2b0daedf22d0758b74578e5fe132f8b'
6
+ metadata.gz: '00190704a6285a58a466d9a25fc8f877f038f438030d1cc2e299db072d4d85862372204f76db233f76e236acb0b0baed7b351a0c6be4e25a3bf732126f56a905'
7
+ data.tar.gz: 171bb257c17a0b100da9cf3fb64d3ee72f675359a3281b123292dce13927395e9bc62496d75ec0ed1d406d37c77af1145400fa31b395b6db8eb1c878b01df08e
@@ -70,7 +70,7 @@ module Asciidoctor
70
70
  %w(international-standard technical-specification technical-report
71
71
  publicly-available-specification international-workshop-agreement
72
72
  guide interpretation-sheet).include? doctype or
73
- warn "IEC Document Attributes: #{doctype} is not a recognised document type"
73
+ @log.add("Document Attributes", nil, "#{doctype} is not a recognised document type")
74
74
  end
75
75
 
76
76
  def validate(doc)
@@ -645,6 +645,11 @@
645
645
  <optional>
646
646
  <attribute name="script"/>
647
647
  </optional>
648
+ <optional>
649
+ <attribute name="inline-header">
650
+ <data type="boolean"/>
651
+ </attribute>
652
+ </optional>
648
653
  <optional>
649
654
  <attribute name="obligation">
650
655
  <choice>
@@ -73,6 +73,19 @@
73
73
  </choice>
74
74
  </element>
75
75
  </define>
76
+ <define name="ul">
77
+ <element name="ul">
78
+ <attribute name="id">
79
+ <data type="ID"/>
80
+ </attribute>
81
+ <oneOrMore>
82
+ <ref name="ul_li"/>
83
+ </oneOrMore>
84
+ <zeroOrMore>
85
+ <ref name="note"/>
86
+ </zeroOrMore>
87
+ </element>
88
+ </define>
76
89
  <define name="sections">
77
90
  <element name="sections">
78
91
  <ref name="clause"/>
@@ -325,6 +338,51 @@
325
338
  </oneOrMore>
326
339
  </choice>
327
340
  </define>
341
+ <define name="table">
342
+ <element name="table">
343
+ <attribute name="id">
344
+ <data type="ID"/>
345
+ </attribute>
346
+ <optional>
347
+ <attribute name="width"/>
348
+ </optional>
349
+ <optional>
350
+ <attribute name="unnumbered">
351
+ <data type="boolean"/>
352
+ </attribute>
353
+ </optional>
354
+ <optional>
355
+ <attribute name="subsequence"/>
356
+ </optional>
357
+ <optional>
358
+ <attribute name="alt"/>
359
+ </optional>
360
+ <optional>
361
+ <attribute name="summary"/>
362
+ </optional>
363
+ <optional>
364
+ <attribute name="uri">
365
+ <data type="anyURI"/>
366
+ </attribute>
367
+ </optional>
368
+ <optional>
369
+ <ref name="tname"/>
370
+ </optional>
371
+ <optional>
372
+ <ref name="thead"/>
373
+ </optional>
374
+ <ref name="tbody"/>
375
+ <optional>
376
+ <ref name="tfoot"/>
377
+ </optional>
378
+ <zeroOrMore>
379
+ <ref name="table-note"/>
380
+ </zeroOrMore>
381
+ <optional>
382
+ <ref name="dl"/>
383
+ </optional>
384
+ </element>
385
+ </define>
328
386
  </include>
329
387
  <!-- end overrides -->
330
388
  <!--
@@ -431,4 +489,26 @@
431
489
  <ref name="Clause-Section"/>
432
490
  </element>
433
491
  </define>
492
+ <define name="ul_li">
493
+ <element name="li">
494
+ <optional>
495
+ <attribute name="id">
496
+ <data type="ID"/>
497
+ </attribute>
498
+ </optional>
499
+ <optional>
500
+ <attribute name="uncheckedcheckbox">
501
+ <data type="boolean"/>
502
+ </attribute>
503
+ </optional>
504
+ <optional>
505
+ <attribute name="checkedcheckbox">
506
+ <data type="boolean"/>
507
+ </attribute>
508
+ </optional>
509
+ <oneOrMore>
510
+ <ref name="paragraph-with-footnote"/>
511
+ </oneOrMore>
512
+ </element>
513
+ </define>
434
514
  </grammar>
@@ -675,6 +675,10 @@ ol > li > p:before {
675
675
  @include formulaBlock(#f7f7f7)
676
676
  }
677
677
 
678
+ dl.formula_dl {
679
+ background-color: #f7f7f7;
680
+ }
681
+
678
682
  /*
679
683
  Keywords
680
684
  */
@@ -563,6 +563,9 @@ p.Formula, li.Formula, div.Formula
563
563
  letter-spacing:.4pt;
564
564
  mso-ansi-language:EN-GB;
565
565
  mso-fareast-language:ZH-CN;}
566
+ table.formula_dl {
567
+ margin-left:0.0cm;
568
+ }
566
569
  p.FOREWORD, li.FOREWORD, div.FOREWORD
567
570
  {mso-style-name:FOREWORD;
568
571
  mso-style-unhide:no;
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
6
6
 
@@ -40,6 +40,5 @@ Gem::Specification.new do |spec|
40
40
  spec.add_development_dependency "rubocop", "= 0.54.0"
41
41
  spec.add_development_dependency "simplecov", "~> 0.15"
42
42
  spec.add_development_dependency "timecop", "~> 0.9"
43
- spec.add_development_dependency "metanorma", "~> 0.3.0"
44
43
  spec.add_development_dependency "iev", "~> 0.2.0"
45
44
  end
@@ -4,7 +4,8 @@ require "fileutils"
4
4
  RSpec.describe Asciidoctor::Iec do
5
5
 
6
6
  it "Warns of illegal doctype" do
7
- expect { Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true) }.to output(/pizza is not a recognised document type/).to_stderr
7
+ FileUtils.rm_f "test.err"
8
+ Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
8
9
  = Document title
9
10
  Author
10
11
  :docfile: test.adoc
@@ -14,119 +15,6 @@ it "Warns of illegal doctype" do
14
15
 
15
16
  text
16
17
  INPUT
18
+ expect(File.read("test.err")).to include "pizza is not a recognised document type"
17
19
  end
18
-
19
- it "Warns of illegal script" do
20
- expect { Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true) }.to output(/pizza is not a recognised script/).to_stderr
21
- = Document title
22
- Author
23
- :docfile: test.adoc
24
- :nodoc:
25
- :no-isobib:
26
- :script: pizza
27
-
28
- text
29
- INPUT
30
- end
31
-
32
- it "Warns of illegal stage" do
33
- expect { Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true) }.to output(/pizza is not a recognised stage/).to_stderr
34
- = Document title
35
- Author
36
- :docfile: test.adoc
37
- :nodoc:
38
- :no-isobib:
39
- :status: pizza
40
-
41
- text
42
- INPUT
43
- end
44
-
45
- it "Warns of illegal substage" do
46
- expect { Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true) }.to output(/pizza is not a recognised substage/).to_stderr
47
- = Document title
48
- Author
49
- :docfile: test.adoc
50
- :nodoc:
51
- :no-isobib:
52
- :status: 60
53
- :docsubstage: pizza
54
-
55
- text
56
- INPUT
57
- end
58
-
59
- it "Warns of illegal iteration" do
60
- expect { Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true) }.to output(/pizza is not a recognised iteration/).to_stderr
61
- = Document title
62
- Author
63
- :docfile: test.adoc
64
- :nodoc:
65
- :no-isobib:
66
- :status: 60
67
- :iteration: pizza
68
-
69
- text
70
- INPUT
71
- end
72
-
73
- it "Warns of illegal script" do
74
- expect { Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true) }.to output(/pizza is not a recognised script/).to_stderr
75
- = Document title
76
- Author
77
- :docfile: test.adoc
78
- :nodoc:
79
- :no-isobib:
80
- :script: pizza
81
-
82
- text
83
- INPUT
84
- end
85
-
86
-
87
- it "Warning if invalid technical committee type" do
88
- expect { Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true) }.to output(%r{invalid technical committee type}).to_stderr
89
- = Document title
90
- Author
91
- :docfile: test.adoc
92
- :nodoc:
93
- :technical-committee-type: X
94
- :no-isobib:
95
-
96
- INPUT
97
- end
98
-
99
- it "Warning if invalid subcommittee type" do
100
- expect { Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true) }.to output(%r{invalid subcommittee type}).to_stderr
101
- = Document title
102
- Author
103
- :docfile: test.adoc
104
- :nodoc:
105
- :subcommittee-type: X
106
- :no-isobib:
107
-
108
- INPUT
109
- end
110
-
111
- it "Warning if invalid subcommittee type" do
112
- expect { Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true) }.to output(%r{invalid subcommittee type}).to_stderr
113
- = Document title
114
- Author
115
- :docfile: test.adoc
116
- :nodoc:
117
- :subcommittee-type: X
118
- :no-isobib:
119
-
120
- INPUT
121
- end
122
-
123
- it "validates document against ISO XML schema" do
124
- expect { Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true) }.to output(%r{value of attribute "align" is invalid; must be equal to}).to_stderr
125
- #{VALIDATING_BLANK_HDR}
126
-
127
- [align=mid-air]
128
- Para
129
- INPUT
130
- end
131
-
132
20
  end
@@ -220,13 +220,22 @@ RSpec.describe IsoDoc do
220
220
  INPUT
221
221
  word = File.read("test.doc", encoding: "UTF-8").sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">').
222
222
  sub(%r{<br[^>]*>\s*<div class="colophon">.*$}m, "")
223
- expect((word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
223
+ expect(xmlpp(word)).to be_equivalent_to xmlpp(<<~"OUTPUT")
224
224
  <div class="WordSection3">
225
- #{IEC_TITLE}
225
+ #{IEC_TITLE.gsub(/\&#160;/, "&#xA0;")}
226
226
  <p class="MsoNormal">
227
227
  <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
228
228
  </p>
229
229
  <div class="Section3"><a name="P" id="P"></a>
230
+ <h1 class='Annex'>
231
+ <b>Annex A</b>
232
+ <br/>
233
+ <br/>
234
+ (normative)
235
+ <br/>
236
+ <br/>
237
+ <b/>
238
+ </h1>
230
239
  <div class="example"><a name="_63112cbc-cde0-435f-9553-e0b8c4f5851c" id="_63112cbc-cde0-435f-9553-e0b8c4f5851c"></a>
231
240
  <p class="example"><span class="example_label">EXAMPLE 1</span><span style="mso-tab-count:1">&#xA0; </span>'1M', '01M', and '0001M' all describe the calendar month January.</p>
232
241
  </div>
@@ -264,6 +273,15 @@ RSpec.describe IsoDoc do
264
273
  <br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
265
274
  </p>
266
275
  <div class="Section3"><a name="P" id="P"></a>
276
+ <h1 class='Annex'>
277
+ <b>Annex A</b>
278
+ <br/>
279
+ <br/>
280
+ (normative)
281
+ <br/>
282
+ <br/>
283
+ <b/>
284
+ </h1>
267
285
  <p class="Sourcecode" style='page-break-after:avoid;'><a name="A" id="A"></a>puts "Hello, world."</p>
268
286
  <p class='SourceTitle' style='text-align:center;'>Figure A.1</p>
269
287
  <p class="TableTitle" style="text-align:center;">Table A.1</p>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-05 00:00:00.000000000 Z
11
+ date: 2020-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-jing
@@ -178,20 +178,6 @@ dependencies:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0.9'
181
- - !ruby/object:Gem::Dependency
182
- name: metanorma
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - "~>"
186
- - !ruby/object:Gem::Version
187
- version: 0.3.0
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - "~>"
193
- - !ruby/object:Gem::Version
194
- version: 0.3.0
195
181
  - !ruby/object:Gem::Dependency
196
182
  name: iev
197
183
  requirement: !ruby/object:Gem::Requirement