metanorma-iec 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/macos.yml +2 -1
- data/.github/workflows/ubuntu.yml +2 -1
- data/.github/workflows/windows.yml +2 -1
- data/lib/asciidoctor/iec/biblio.rng +2 -2
- data/lib/asciidoctor/iec/converter.rb +14 -0
- data/lib/asciidoctor/iec/iec.rng +42 -0
- data/lib/asciidoctor/iec/isostandard.rng +1 -1
- data/lib/asciidoctor/iec/reqt.rng +6 -0
- data/lib/isodoc/iec/html/htmlstyle.scss +1 -1
- data/lib/isodoc/iec/html/isodoc.scss +1 -1
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +0 -1
- data/spec/asciidoctor-iec/base_spec.rb +12 -12
- data/spec/asciidoctor-iec/blocks_spec.rb +20 -20
- data/spec/asciidoctor-iec/cleanup_spec.rb +18 -44
- data/spec/asciidoctor-iec/inline_spec.rb +7 -7
- data/spec/asciidoctor-iec/lists_spec.rb +3 -3
- data/spec/asciidoctor-iec/section_spec.rb +5 -5
- data/spec/asciidoctor-iec/table_spec.rb +4 -4
- data/spec/metanorma/processor_spec.rb +3 -3
- data/spec/spec_helper.rb +1 -1
- metadata +3 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0167d1ad572f9b2c59a4eb5fdc8a8a435d85e1988fb50a6879bb4bba805da11a
|
4
|
+
data.tar.gz: 108372e67daae3d226de96ad9679952d1ce07382ddfcf79ab3487bea65fb09d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c05a985a4cf158d06344bfa206ebdfc58855ef1a16fcf3793c0a714fb1c49b4e6d13e64298b9640b7f0930e3da66767643bc147634d6c68aaea7777bccb1d11
|
7
|
+
data.tar.gz: f106fbd3b6d3bbc816a4cbb44254c47304b43b2afa087427265199898e6a09a59128a1400135eea01d111728b7b17cc90f922c155274769b80a2c69f1fb89e74
|
data/.github/workflows/macos.yml
CHANGED
@@ -9,6 +9,7 @@ jobs:
|
|
9
9
|
name: Test on Ruby ${{ matrix.ruby }} macOS
|
10
10
|
runs-on: macos-latest
|
11
11
|
strategy:
|
12
|
+
fail-fast: false
|
12
13
|
matrix:
|
13
14
|
ruby: [ '2.6', '2.5', '2.4' ]
|
14
15
|
steps:
|
@@ -20,7 +21,7 @@ jobs:
|
|
20
21
|
architecture: 'x64'
|
21
22
|
- name: Update gems
|
22
23
|
run: |
|
23
|
-
sudo gem install bundler
|
24
|
+
sudo gem install bundler --force
|
24
25
|
bundle install --jobs 4 --retry 3
|
25
26
|
- name: Use Node
|
26
27
|
uses: actions/setup-node@v1
|
@@ -9,6 +9,7 @@ jobs:
|
|
9
9
|
name: Test on Ruby ${{ matrix.ruby }} Ubuntu
|
10
10
|
runs-on: ubuntu-latest
|
11
11
|
strategy:
|
12
|
+
fail-fast: false
|
12
13
|
matrix:
|
13
14
|
ruby: [ '2.6', '2.5', '2.4' ]
|
14
15
|
steps:
|
@@ -20,7 +21,7 @@ jobs:
|
|
20
21
|
architecture: 'x64'
|
21
22
|
- name: Update gems
|
22
23
|
run: |
|
23
|
-
gem install bundler
|
24
|
+
gem install bundler
|
24
25
|
bundle install --jobs 4 --retry 3
|
25
26
|
- name: Use Node
|
26
27
|
uses: actions/setup-node@v1
|
@@ -9,6 +9,7 @@ jobs:
|
|
9
9
|
name: Test on Ruby ${{ matrix.ruby }} Windows
|
10
10
|
runs-on: windows-latest
|
11
11
|
strategy:
|
12
|
+
fail-fast: false
|
12
13
|
matrix:
|
13
14
|
ruby: [ '2.6', '2.5', '2.4' ]
|
14
15
|
steps:
|
@@ -21,7 +22,7 @@ jobs:
|
|
21
22
|
- name: Update gems
|
22
23
|
shell: pwsh
|
23
24
|
run: |
|
24
|
-
gem install bundler
|
25
|
+
gem install bundler
|
25
26
|
bundle config --local path vendor/bundle
|
26
27
|
bundle update
|
27
28
|
bundle install --jobs 4 --retry 3
|
@@ -70,6 +70,12 @@ module Asciidoctor
|
|
70
70
|
warn "IEC Document Attributes: #{doctype} is not a recognised document type"
|
71
71
|
end
|
72
72
|
|
73
|
+
def validate(doc)
|
74
|
+
content_validate(doc)
|
75
|
+
schema_validate(formattedstr_strip(doc.dup),
|
76
|
+
File.join(File.dirname(__FILE__), "iec.rng"))
|
77
|
+
end
|
78
|
+
|
73
79
|
STAGE_CODES = {
|
74
80
|
"PNW" => "1000",
|
75
81
|
"ANW" => "2000",
|
@@ -172,6 +178,14 @@ module Asciidoctor
|
|
172
178
|
def initial_boilerplate(xmldoc)
|
173
179
|
end
|
174
180
|
|
181
|
+
def makexml1(node)
|
182
|
+
result = ["<?xml version='1.0' encoding='UTF-8'?>\n<iec-standard>"]
|
183
|
+
result << noko { |ixml| front node, ixml }
|
184
|
+
result << noko { |ixml| middle node, ixml }
|
185
|
+
result << "</iec-standard>"
|
186
|
+
textcleanup(result)
|
187
|
+
end
|
188
|
+
|
175
189
|
def html_converter(node)
|
176
190
|
node.nil? ? IsoDoc::Iec::HtmlConvert.new({}) :
|
177
191
|
IsoDoc::Iec::HtmlConvert.new(html_extract_attributes(node))
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<grammar ns="http://riboseinc.com/isoxml" xmlns="http://relaxng.org/ns/structure/1.0">
|
3
|
+
<include href="isostandard.rng">
|
4
|
+
<start>
|
5
|
+
<ref name="iec-standard"/>
|
6
|
+
</start>
|
7
|
+
<define name="DocumentType">
|
8
|
+
<choice>
|
9
|
+
<value>international-standard</value>
|
10
|
+
<value>technical-specification</value>
|
11
|
+
<value>technical-report</value>
|
12
|
+
<value>publicly-available-specification</value>
|
13
|
+
<value>international-workshop-agreement</value>
|
14
|
+
<value>guide</value>
|
15
|
+
</choice>
|
16
|
+
</define>
|
17
|
+
</include>
|
18
|
+
<!-- end overrides -->
|
19
|
+
<!--
|
20
|
+
We display the Normative References between scope and terms; but to keep the
|
21
|
+
grammar simple, we keep the references together
|
22
|
+
-->
|
23
|
+
<define name="iec-standard">
|
24
|
+
<element name="iec-standard">
|
25
|
+
<ref name="bibdata"/>
|
26
|
+
<zeroOrMore>
|
27
|
+
<ref name="termdocsource"/>
|
28
|
+
</zeroOrMore>
|
29
|
+
<optional>
|
30
|
+
<ref name="boilerplate"/>
|
31
|
+
</optional>
|
32
|
+
<ref name="preface"/>
|
33
|
+
<oneOrMore>
|
34
|
+
<ref name="sections"/>
|
35
|
+
</oneOrMore>
|
36
|
+
<zeroOrMore>
|
37
|
+
<ref name="annex"/>
|
38
|
+
</zeroOrMore>
|
39
|
+
<ref name="bibliography"/>
|
40
|
+
</element>
|
41
|
+
</define>
|
42
|
+
</grammar>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<grammar
|
2
|
+
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
3
3
|
<include href="isodoc.rng">
|
4
4
|
<start>
|
5
5
|
<ref name="iso-standard"/>
|
@@ -634,7 +634,7 @@ margin: 2em 0 1em 0;
|
|
634
634
|
overflow: auto;
|
635
635
|
}
|
636
636
|
|
637
|
-
.figure-title, .FigureTitle, .SourceTitle, .AdmonitionTitle {
|
637
|
+
.figure-title, .FigureTitle, .SourceTitle, .AdmonitionTitle, .RecommendationTitle {
|
638
638
|
font-weight: 700;
|
639
639
|
font-size: 1em;
|
640
640
|
text-align: center;
|
data/metanorma-iec.gemspec
CHANGED
@@ -31,7 +31,6 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_dependency "isodoc", "~> 1.0.0"
|
32
32
|
spec.add_dependency "metanorma-iso", "~> 1.3.0"
|
33
33
|
|
34
|
-
spec.add_development_dependency "bundler", "~> 2.0.1"
|
35
34
|
spec.add_development_dependency "byebug"
|
36
35
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
37
36
|
spec.add_development_dependency "guard", "~> 2.14"
|
@@ -23,7 +23,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
23
23
|
INPUT
|
24
24
|
#{BLANK_HDR}
|
25
25
|
<sections/>
|
26
|
-
</
|
26
|
+
</iec-standard>
|
27
27
|
OUTPUT
|
28
28
|
end
|
29
29
|
|
@@ -38,7 +38,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
38
38
|
INPUT
|
39
39
|
#{BLANK_HDR}
|
40
40
|
<sections/>
|
41
|
-
</
|
41
|
+
</iec-standard>
|
42
42
|
OUTPUT
|
43
43
|
expect(File.exist?("test.doc")).to be true
|
44
44
|
expect(File.exist?("htmlstyle.css")).to be false
|
@@ -89,7 +89,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
89
89
|
:library-ics: 1,2,3
|
90
90
|
INPUT
|
91
91
|
<?xml version="1.0" encoding="UTF-8"?>
|
92
|
-
<
|
92
|
+
<iec-standard xmlns="http://riboseinc.com/isoxml">
|
93
93
|
<bibdata type="standard">
|
94
94
|
<title language="en" format="text/plain" type="main">Introduction — Main Title — Title — Title Part</title>
|
95
95
|
<title language="en" format="text/plain" type="title-intro">Introduction</title>
|
@@ -163,7 +163,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
163
163
|
</bibdata>
|
164
164
|
#{BOILERPLATE}
|
165
165
|
<sections/>
|
166
|
-
</
|
166
|
+
</iec-standard>
|
167
167
|
OUTPUT
|
168
168
|
end
|
169
169
|
|
@@ -186,7 +186,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
186
186
|
:docstage: A2CD
|
187
187
|
INPUT
|
188
188
|
<?xml version="1.0" encoding="UTF-8"?>
|
189
|
-
<
|
189
|
+
<iec-standard xmlns="http://riboseinc.com/isoxml">
|
190
190
|
<bibdata type="standard">
|
191
191
|
<docidentifier type="iso">ISO/IEC/IETF/2CD 1000-1-1</docidentifier>
|
192
192
|
<docidentifier type="iso-tc">2000</docidentifier>
|
@@ -278,7 +278,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
278
278
|
</bibdata>
|
279
279
|
#{BOILERPLATE}
|
280
280
|
<sections/>
|
281
|
-
</
|
281
|
+
</iec-standard>
|
282
282
|
OUTPUT
|
283
283
|
end
|
284
284
|
|
@@ -333,7 +333,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
333
333
|
:docnumber: 1000
|
334
334
|
:docstage: 50
|
335
335
|
INPUT
|
336
|
-
<
|
336
|
+
<iec-standard xmlns="http://riboseinc.com/isoxml">
|
337
337
|
<bibdata type="standard">
|
338
338
|
<docidentifier type="iso">IEC/FDIS 1000</docidentifier>
|
339
339
|
<docnumber>1000</docnumber>
|
@@ -381,7 +381,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
381
381
|
</bibdata>
|
382
382
|
#{BOILERPLATE}
|
383
383
|
<sections/>
|
384
|
-
</
|
384
|
+
</iec-standard>
|
385
385
|
OUTPUT
|
386
386
|
end
|
387
387
|
|
@@ -396,7 +396,7 @@ OUTPUT
|
|
396
396
|
:docnumber: 1000
|
397
397
|
:docstage: 60
|
398
398
|
INPUT
|
399
|
-
<
|
399
|
+
<iec-standard xmlns="http://riboseinc.com/isoxml">
|
400
400
|
<bibdata type="standard">
|
401
401
|
<docidentifier type="iso">IEC 1000</docidentifier>
|
402
402
|
<docnumber>1000</docnumber>
|
@@ -444,7 +444,7 @@ OUTPUT
|
|
444
444
|
</bibdata>
|
445
445
|
#{BOILERPLATE}
|
446
446
|
<sections/>
|
447
|
-
</
|
447
|
+
</iec-standard>
|
448
448
|
OUTPUT
|
449
449
|
end
|
450
450
|
|
@@ -460,7 +460,7 @@ OUTPUT
|
|
460
460
|
:docstage: 60
|
461
461
|
:docsubstage: 00
|
462
462
|
INPUT
|
463
|
-
<
|
463
|
+
<iec-standard xmlns="http://riboseinc.com/isoxml">
|
464
464
|
<bibdata type="standard">
|
465
465
|
<docidentifier type="iso">IEC 1000</docidentifier>
|
466
466
|
<docnumber>1000</docnumber>
|
@@ -508,7 +508,7 @@ OUTPUT
|
|
508
508
|
</bibdata>
|
509
509
|
#{BOILERPLATE}
|
510
510
|
<sections/>
|
511
|
-
</
|
511
|
+
</iec-standard>
|
512
512
|
OUTPUT
|
513
513
|
end
|
514
514
|
|
@@ -16,7 +16,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
16
16
|
<sections><p id="_">x</p>
|
17
17
|
<p id="_">y</p>
|
18
18
|
<p id="_">z</p></sections>
|
19
|
-
</
|
19
|
+
</iec-standard>
|
20
20
|
OUTPUT
|
21
21
|
end
|
22
22
|
|
@@ -44,7 +44,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
44
44
|
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub> <mrow> <mrow> <mi mathvariant="bold-italic">F</mi> </mrow> </mrow> <mrow> <mrow> <mi mathvariant="bold-italic">Α</mi> </mrow> </mrow> </msub> </math></stem>
|
45
45
|
</formula>
|
46
46
|
</sections>
|
47
|
-
</
|
47
|
+
</iec-standard>
|
48
48
|
OUTPUT
|
49
49
|
end
|
50
50
|
|
@@ -65,7 +65,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
65
65
|
#{BLANK_HDR}
|
66
66
|
<sections><p id="foreword">Foreword</p>
|
67
67
|
</sections>
|
68
|
-
</
|
68
|
+
</iec-standard>
|
69
69
|
OUTPUT
|
70
70
|
end
|
71
71
|
|
@@ -121,7 +121,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
121
121
|
</term>
|
122
122
|
</terms>
|
123
123
|
</sections>
|
124
|
-
</
|
124
|
+
</iec-standard>
|
125
125
|
OUTPUT
|
126
126
|
end
|
127
127
|
|
@@ -136,7 +136,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
136
136
|
<p id="_">This is a note</p>
|
137
137
|
</note>
|
138
138
|
</sections>
|
139
|
-
</
|
139
|
+
</iec-standard>
|
140
140
|
|
141
141
|
OUTPUT
|
142
142
|
end
|
@@ -154,7 +154,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
154
154
|
<pre id="_">LITERAL</pre>
|
155
155
|
</figure>
|
156
156
|
</sections>
|
157
|
-
</
|
157
|
+
</iec-standard>
|
158
158
|
OUTPUT
|
159
159
|
end
|
160
160
|
|
@@ -169,7 +169,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
169
169
|
<p id="_">Only use paddy or parboiled rice for the determination of husked rice yield.</p>
|
170
170
|
</admonition>
|
171
171
|
</sections>
|
172
|
-
</
|
172
|
+
</iec-standard>
|
173
173
|
|
174
174
|
OUTPUT
|
175
175
|
end
|
@@ -203,7 +203,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
203
203
|
</li>
|
204
204
|
</ol></admonition>
|
205
205
|
</sections>
|
206
|
-
</
|
206
|
+
</iec-standard>
|
207
207
|
|
208
208
|
OUTPUT
|
209
209
|
end
|
@@ -232,7 +232,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
232
232
|
</term>
|
233
233
|
</terms>
|
234
234
|
</sections>
|
235
|
-
</
|
235
|
+
</iec-standard>
|
236
236
|
|
237
237
|
OUTPUT
|
238
238
|
end
|
@@ -252,7 +252,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
252
252
|
<example id="_"><p id="_">This is an example</p>
|
253
253
|
<p id="_">Amen</p></example>
|
254
254
|
</sections>
|
255
|
-
</
|
255
|
+
</iec-standard>
|
256
256
|
OUTPUT
|
257
257
|
end
|
258
258
|
|
@@ -271,7 +271,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
271
271
|
<clause id="_" inline-header="false" obligation="normative">
|
272
272
|
<title>Section 1</title>
|
273
273
|
</clause></sections>
|
274
|
-
</
|
274
|
+
</iec-standard>
|
275
275
|
OUTPUT
|
276
276
|
end
|
277
277
|
|
@@ -289,7 +289,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
289
289
|
<image src="spec/examples/rice_images/rice_image1.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
290
290
|
</figure>
|
291
291
|
</sections>
|
292
|
-
</
|
292
|
+
</iec-standard>
|
293
293
|
OUTPUT
|
294
294
|
end
|
295
295
|
|
@@ -306,7 +306,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
306
306
|
<image src="spec/examples/rice_images/rice_image1.png" id="_" mimetype="image/png" height="4" width="3"/>
|
307
307
|
</figure>
|
308
308
|
</sections>
|
309
|
-
</
|
309
|
+
</iec-standard>
|
310
310
|
OUTPUT
|
311
311
|
end
|
312
312
|
|
@@ -323,7 +323,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
323
323
|
<image src="spec/examples/rice_images/rice_image1.png" id="_" mimetype="image/png" height="4" width="auto"/>
|
324
324
|
</figure>
|
325
325
|
</sections>
|
326
|
-
</
|
326
|
+
</iec-standard>
|
327
327
|
OUTPUT
|
328
328
|
end
|
329
329
|
|
@@ -337,7 +337,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
337
337
|
<sections>
|
338
338
|
<p align="right" id="_">This para is right-aligned.</p>
|
339
339
|
</sections>
|
340
|
-
</
|
340
|
+
</iec-standard>
|
341
341
|
OUTPUT
|
342
342
|
end
|
343
343
|
|
@@ -357,7 +357,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
357
357
|
<p id="_">Block quotation</p>
|
358
358
|
</quote>
|
359
359
|
</sections>
|
360
|
-
</
|
360
|
+
</iec-standard>
|
361
361
|
OUTPUT
|
362
362
|
end
|
363
363
|
|
@@ -379,7 +379,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
379
379
|
puts x
|
380
380
|
end</sourcecode>
|
381
381
|
</sections>
|
382
|
-
</
|
382
|
+
</iec-standard>
|
383
383
|
OUTPUT
|
384
384
|
end
|
385
385
|
|
@@ -406,7 +406,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
406
406
|
<p id="_">This is another callout</p>
|
407
407
|
</annotation></sourcecode>
|
408
408
|
</sections>
|
409
|
-
</
|
409
|
+
</iec-standard>
|
410
410
|
OUTPUT
|
411
411
|
end
|
412
412
|
|
@@ -434,7 +434,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
434
434
|
</term>
|
435
435
|
</terms>
|
436
436
|
</sections>
|
437
|
-
</
|
437
|
+
</iec-standard>
|
438
438
|
OUTPUT
|
439
439
|
end
|
440
440
|
|
@@ -465,7 +465,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
465
465
|
</term>
|
466
466
|
</terms>
|
467
467
|
</sections>
|
468
|
-
</
|
468
|
+
</iec-standard>
|
469
469
|
OUTPUT
|
470
470
|
end
|
471
471
|
|
@@ -12,7 +12,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
12
12
|
|
13
13
|
</clause>
|
14
14
|
</sections>
|
15
|
-
</
|
15
|
+
</iec-standard>
|
16
16
|
OUTPUT
|
17
17
|
end
|
18
18
|
|
@@ -38,33 +38,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
38
38
|
<definition><p id="_">Time</p></definition></term>
|
39
39
|
</terms>
|
40
40
|
</sections>
|
41
|
-
</
|
42
|
-
OUTPUT
|
43
|
-
end
|
44
|
-
|
45
|
-
it "moves term domains out of the term definition paragraph" do
|
46
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
47
|
-
#{ASCIIDOC_BLANK_HDR}
|
48
|
-
== Terms and Definitions
|
49
|
-
|
50
|
-
=== Tempus
|
51
|
-
|
52
|
-
domain:[relativity] Time
|
53
|
-
INPUT
|
54
|
-
#{BLANK_HDR}
|
55
|
-
<sections>
|
56
|
-
<terms id="_" obligation="normative">
|
57
|
-
<title>Terms and definitions</title>
|
58
|
-
<p>For the purposes of this document,
|
59
|
-
the following terms and definitions apply.</p>
|
60
|
-
#{TERMS_BOILERPLATE}
|
61
|
-
<term id="_">
|
62
|
-
<preferred>Tempus</preferred>
|
63
|
-
<domain>relativity</domain><definition><p id="_"> Time</p></definition>
|
64
|
-
</term>
|
65
|
-
</terms>
|
66
|
-
</sections>
|
67
|
-
</iso-standard>
|
41
|
+
</iec-standard>
|
68
42
|
OUTPUT
|
69
43
|
end
|
70
44
|
|
@@ -102,7 +76,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
102
76
|
</term>
|
103
77
|
</terms>
|
104
78
|
</sections>
|
105
|
-
</
|
79
|
+
</iec-standard>
|
106
80
|
OUTPUT
|
107
81
|
end
|
108
82
|
|
@@ -131,7 +105,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
131
105
|
<definition><p id="_">This paragraph is extraneous</p></definition>
|
132
106
|
</term></terms>
|
133
107
|
</sections>
|
134
|
-
</
|
108
|
+
</iec-standard>
|
135
109
|
OUTPUT
|
136
110
|
end
|
137
111
|
|
@@ -166,7 +140,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
166
140
|
</contributor>
|
167
141
|
</bibitem>
|
168
142
|
</references></bibliography>
|
169
|
-
</
|
143
|
+
</iec-standard>
|
170
144
|
OUTPUT
|
171
145
|
end
|
172
146
|
|
@@ -194,7 +168,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
194
168
|
</term>
|
195
169
|
</terms>
|
196
170
|
</sections>
|
197
|
-
</
|
171
|
+
</iec-standard>
|
198
172
|
OUTPUT
|
199
173
|
end
|
200
174
|
|
@@ -225,7 +199,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
225
199
|
</bibitem>
|
226
200
|
</references>
|
227
201
|
</bibliography>
|
228
|
-
</
|
202
|
+
</iec-standard>
|
229
203
|
OUTPUT
|
230
204
|
end
|
231
205
|
|
@@ -238,7 +212,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
238
212
|
<sections>
|
239
213
|
<p id="_">Paragraph</p>
|
240
214
|
</sections>
|
241
|
-
</
|
215
|
+
</iec-standard>
|
242
216
|
OUTPUT
|
243
217
|
end
|
244
218
|
|
@@ -258,7 +232,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
258
232
|
</note>
|
259
233
|
</example>
|
260
234
|
</sections>
|
261
|
-
</
|
235
|
+
</iec-standard>
|
262
236
|
OUTPUT
|
263
237
|
end
|
264
238
|
|
@@ -290,7 +264,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
290
264
|
</dl></table>
|
291
265
|
|
292
266
|
</sections>
|
293
|
-
</
|
267
|
+
</iec-standard>
|
294
268
|
OUTPUT
|
295
269
|
end
|
296
270
|
|
@@ -329,7 +303,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
329
303
|
</tbody>
|
330
304
|
</table>
|
331
305
|
</sections>
|
332
|
-
</
|
306
|
+
</iec-standard>
|
333
307
|
OUTPUT
|
334
308
|
end
|
335
309
|
|
@@ -374,7 +348,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
374
348
|
</tbody>
|
375
349
|
</table>
|
376
350
|
</sections>
|
377
|
-
</
|
351
|
+
</iec-standard>
|
378
352
|
OUTPUT
|
379
353
|
end
|
380
354
|
|
@@ -401,7 +375,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
401
375
|
</dl></formula>
|
402
376
|
|
403
377
|
</sections>
|
404
|
-
</
|
378
|
+
</iec-standard>
|
405
379
|
OUTPUT
|
406
380
|
end
|
407
381
|
|
@@ -425,7 +399,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
425
399
|
|
426
400
|
</sections>
|
427
401
|
|
428
|
-
</
|
402
|
+
</iec-standard>
|
429
403
|
OUTPUT
|
430
404
|
end
|
431
405
|
|
@@ -450,7 +424,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
450
424
|
|
451
425
|
</sections>
|
452
426
|
|
453
|
-
</
|
427
|
+
</iec-standard>
|
454
428
|
OUTPUT
|
455
429
|
end
|
456
430
|
|
@@ -502,7 +476,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
502
476
|
</bibitem>
|
503
477
|
</references>
|
504
478
|
</bibliography>
|
505
|
-
</
|
479
|
+
</iec-standard>
|
506
480
|
OUTPUT
|
507
481
|
end
|
508
482
|
|
@@ -527,7 +501,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
527
501
|
<title>Clause</title>
|
528
502
|
<p id="_">Text</p>
|
529
503
|
</annex>
|
530
|
-
</
|
504
|
+
</iec-standard>
|
531
505
|
OUTPUT
|
532
506
|
end
|
533
507
|
|
@@ -590,7 +564,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
590
564
|
</clause>
|
591
565
|
</clause>
|
592
566
|
</sections>
|
593
|
-
</
|
567
|
+
</iec-standard>
|
594
568
|
OUTPUT
|
595
569
|
end
|
596
570
|
end
|
@@ -36,7 +36,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
36
36
|
<strike>strike</strike>
|
37
37
|
<smallcap>smallcap</smallcap>
|
38
38
|
</sections>
|
39
|
-
</
|
39
|
+
</iec-standard>
|
40
40
|
OUTPUT
|
41
41
|
end
|
42
42
|
|
@@ -55,7 +55,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
55
55
|
line break</p>
|
56
56
|
<hr/>
|
57
57
|
<pagebreak/></sections>
|
58
|
-
</
|
58
|
+
</iec-standard>
|
59
59
|
OUTPUT
|
60
60
|
end
|
61
61
|
|
@@ -72,7 +72,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
72
72
|
<link target="http://example.com"/>
|
73
73
|
<link target="http://example.com">Link</link></p>
|
74
74
|
</sections>
|
75
|
-
</
|
75
|
+
</iec-standard>
|
76
76
|
OUTPUT
|
77
77
|
end
|
78
78
|
|
@@ -85,7 +85,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
85
85
|
<sections>
|
86
86
|
<p id="_">Text <bookmark id="bookmark"/> Text</p>
|
87
87
|
</sections>
|
88
|
-
</
|
88
|
+
</iec-standard>
|
89
89
|
OUTPUT
|
90
90
|
end
|
91
91
|
|
@@ -110,7 +110,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
110
110
|
Footnoted Reference with Text to <xref target="reference">text</xref></p>
|
111
111
|
</clause>
|
112
112
|
</sections>
|
113
|
-
</
|
113
|
+
</iec-standard>
|
114
114
|
OUTPUT
|
115
115
|
end
|
116
116
|
|
@@ -140,7 +140,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
140
140
|
</bibitem>
|
141
141
|
</references>
|
142
142
|
</bibliography>
|
143
|
-
</
|
143
|
+
</iec-standard>
|
144
144
|
OUTPUT
|
145
145
|
end
|
146
146
|
|
@@ -155,7 +155,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
155
155
|
<p id="_">Footnote text</p>
|
156
156
|
</fn></p>
|
157
157
|
</sections>
|
158
|
-
</
|
158
|
+
</iec-standard>
|
159
159
|
OUTPUT
|
160
160
|
end
|
161
161
|
|
@@ -52,7 +52,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
52
52
|
</li>
|
53
53
|
</ul>
|
54
54
|
</sections>
|
55
|
-
</
|
55
|
+
</iec-standard>
|
56
56
|
OUTPUT
|
57
57
|
end
|
58
58
|
|
@@ -160,7 +160,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
160
160
|
</ol>
|
161
161
|
</li>
|
162
162
|
</ol></sections>
|
163
|
-
</
|
163
|
+
</iec-standard>
|
164
164
|
OUTPUT
|
165
165
|
end
|
166
166
|
|
@@ -183,7 +183,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
183
183
|
</li>
|
184
184
|
</ul>
|
185
185
|
</sections>
|
186
|
-
</
|
186
|
+
</iec-standard>
|
187
187
|
OUTPUT
|
188
188
|
end
|
189
189
|
|
@@ -108,7 +108,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
108
108
|
</references>
|
109
109
|
</clause>
|
110
110
|
</bibliography>
|
111
|
-
</
|
111
|
+
</iec-standard>
|
112
112
|
OUTPUT
|
113
113
|
end
|
114
114
|
|
@@ -240,7 +240,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
240
240
|
</references>
|
241
241
|
</clause>
|
242
242
|
</bibliography>
|
243
|
-
</
|
243
|
+
</iec-standard>
|
244
244
|
OUTPUT
|
245
245
|
end
|
246
246
|
|
@@ -271,7 +271,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
271
271
|
</sections><annex id="_" inline-header="false" obligation="informative">
|
272
272
|
<title>Annex</title>
|
273
273
|
</annex>
|
274
|
-
</
|
274
|
+
</iec-standard>
|
275
275
|
OUTPUT
|
276
276
|
end
|
277
277
|
|
@@ -302,7 +302,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
302
302
|
<title>Clause Aa</title>
|
303
303
|
</clause>
|
304
304
|
</annex>
|
305
|
-
</
|
305
|
+
</iec-standard>
|
306
306
|
OUTPUT
|
307
307
|
end
|
308
308
|
|
@@ -322,7 +322,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
322
322
|
</clause>
|
323
323
|
</clause>
|
324
324
|
</sections>
|
325
|
-
</
|
325
|
+
</iec-standard>
|
326
326
|
OUTPUT
|
327
327
|
end
|
328
328
|
|
@@ -31,7 +31,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
31
31
|
</tbody>
|
32
32
|
</table>
|
33
33
|
</sections>
|
34
|
-
</
|
34
|
+
</iec-standard>
|
35
35
|
OUTPUT
|
36
36
|
end
|
37
37
|
|
@@ -70,7 +70,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
70
70
|
</tbody>
|
71
71
|
</table>
|
72
72
|
</sections>
|
73
|
-
</
|
73
|
+
</iec-standard>
|
74
74
|
OUTPUT
|
75
75
|
end
|
76
76
|
|
@@ -107,7 +107,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
107
107
|
</tbody>
|
108
108
|
</table>
|
109
109
|
</sections>
|
110
|
-
</
|
110
|
+
</iec-standard>
|
111
111
|
OUTPUT
|
112
112
|
end
|
113
113
|
|
@@ -300,7 +300,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
300
300
|
</tfoot>
|
301
301
|
</table>
|
302
302
|
</sections>
|
303
|
-
</
|
303
|
+
</iec-standard>
|
304
304
|
OUTPUT
|
305
305
|
end
|
306
306
|
end
|
@@ -29,14 +29,14 @@ RSpec.describe Metanorma::Iec::Processor do
|
|
29
29
|
INPUT
|
30
30
|
#{BLANK_HDR}
|
31
31
|
<sections/>
|
32
|
-
</
|
32
|
+
</iec-standard>
|
33
33
|
OUTPUT
|
34
34
|
end
|
35
35
|
|
36
36
|
it "generates HTML from IsoDoc XML" do
|
37
37
|
FileUtils.rm_f "test.xml"
|
38
38
|
processor.output(<<~"INPUT", "test.html", :html)
|
39
|
-
<
|
39
|
+
<iec-standard xmlns="http://riboseinc.com/isoxml">
|
40
40
|
<sections>
|
41
41
|
<terms id="H" obligation="normative"><title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
42
42
|
<term id="J">
|
@@ -44,7 +44,7 @@ RSpec.describe Metanorma::Iec::Processor do
|
|
44
44
|
</term>
|
45
45
|
</terms>
|
46
46
|
</sections>
|
47
|
-
</
|
47
|
+
</iec-standard>
|
48
48
|
INPUT
|
49
49
|
expect(xmlpp(File.read("test.html", encoding: "utf-8").gsub(%r{^.*<main}m, "<main").gsub(%r{</main>.*}m, "</main>"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
50
50
|
<main class="main-section"><button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
|
data/spec/spec_helper.rb
CHANGED
@@ -127,7 +127,7 @@ BOILERPLATE
|
|
127
127
|
|
128
128
|
BLANK_HDR = <<~"HDR"
|
129
129
|
<?xml version="1.0" encoding="UTF-8"?>
|
130
|
-
<
|
130
|
+
<iec-standard xmlns="http://riboseinc.com/isoxml">
|
131
131
|
<bibdata type="standard">
|
132
132
|
<contributor>
|
133
133
|
<role type="author"/>
|
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: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-jing
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 1.3.0
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: bundler
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 2.0.1
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 2.0.1
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: byebug
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -248,6 +234,7 @@ files:
|
|
248
234
|
- lib/asciidoctor/iec/i18n-en.yaml
|
249
235
|
- lib/asciidoctor/iec/i18n-fr.yaml
|
250
236
|
- lib/asciidoctor/iec/i18n-zh-Hans.yaml
|
237
|
+
- lib/asciidoctor/iec/iec.rng
|
251
238
|
- lib/asciidoctor/iec/iec_intro_en.xml
|
252
239
|
- lib/asciidoctor/iec/iec_intro_fr.xml
|
253
240
|
- lib/asciidoctor/iec/isodoc.rng
|