metanorma-iec 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -0
- data/.hound.yml +3 -0
- data/.rubocop.yml +10 -0
- data/.travis.yml +22 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/LICENSE +25 -0
- data/Rakefile +6 -0
- data/appveyor.yml +37 -0
- data/lib/asciidoctor/iec/basicdoc.rng +27 -2
- data/lib/asciidoctor/iec/converter.rb +14 -0
- data/lib/asciidoctor/iec/i18n-en.yaml +12 -0
- data/lib/asciidoctor/iec/i18n-fr.yaml +11 -0
- data/lib/asciidoctor/iec/i18n-zh-Hans.yaml +9 -0
- data/lib/asciidoctor/iec/reqt.rng +3 -0
- data/lib/metanorma/iec/version.rb +1 -1
- data/spec/asciidoctor-iec/blocks_spec.rb +1 -2
- data/spec/asciidoctor-iec/cleanup_spec.rb +1 -48
- data/spec/isodoc/postproc_spec.rb +17 -17
- metadata +13 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48b2ae8f6f1e2066c374d758bbf0492940e64f5e6e602808dda479c71fe68c38
|
4
|
+
data.tar.gz: 2299bfb4aa616d9f2d7ecfb6614916e11f968648875292b5d604787fd076f6ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3029efdd4c9d36e66c7eb069b4e16133235c36af0ae5cab152c1b37896d9676bf1c44b34e83ef68c020f92ffd863082875d00b6364c8e6b9ecea373ee3912b5e
|
7
|
+
data.tar.gz: 0116bb3755de1fb86d8e9a3e9c29293af3ad6c6e8e1dfe5a1d1c049ab5d81b6cf4ede7b47f4df399b47e7bcd580bf5deb501b53e0b60e1fbcb2449743a3a8225
|
data/.gitignore
ADDED
data/.hound.yml
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
# This project follows the Ribose OSS style guide.
|
2
|
+
# https://github.com/riboseinc/oss-guides
|
3
|
+
# All project-specific additions and overrides should be specified in this file.
|
4
|
+
|
5
|
+
inherit_from:
|
6
|
+
- https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
|
7
|
+
AllCops:
|
8
|
+
TargetRubyVersion: 2.3
|
9
|
+
Rails:
|
10
|
+
Enabled: true
|
data/.travis.yml
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# Auto-generated !!! Do not edit it manually
|
2
|
+
# use ci-master https://github.com/metanorma/metanorma-build-scripts
|
3
|
+
language: ruby
|
4
|
+
cache: bundler
|
5
|
+
os:
|
6
|
+
- linux
|
7
|
+
- osx
|
8
|
+
rvm:
|
9
|
+
- 2.6
|
10
|
+
- 2.5
|
11
|
+
- 2.4
|
12
|
+
- ruby-head
|
13
|
+
before_install:
|
14
|
+
- nvm install 8
|
15
|
+
- npm install -g puppeteer
|
16
|
+
- npm install
|
17
|
+
- gem install bundler -v "~> 2"
|
18
|
+
- bundle update
|
19
|
+
matrix:
|
20
|
+
allow_failures:
|
21
|
+
- rvm: ruby-head
|
22
|
+
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at ronald.tse@ribose.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/LICENSE
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
BSD 2-Clause License
|
2
|
+
|
3
|
+
Copyright (c) 2018, Ribose
|
4
|
+
All rights reserved.
|
5
|
+
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
8
|
+
|
9
|
+
* Redistributions of source code must retain the above copyright notice, this
|
10
|
+
list of conditions and the following disclaimer.
|
11
|
+
|
12
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
14
|
+
and/or other materials provided with the distribution.
|
15
|
+
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
17
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
18
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
19
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
20
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
21
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
22
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
23
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
24
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
25
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/Rakefile
ADDED
data/appveyor.yml
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# Auto-generated !!! Do not edit it manually
|
2
|
+
# use ci-master https://github.com/metanorma/metanorma-build-scripts
|
3
|
+
version: '{build}'
|
4
|
+
|
5
|
+
cache:
|
6
|
+
- vendor/bundle
|
7
|
+
|
8
|
+
environment:
|
9
|
+
matrix:
|
10
|
+
- RUBY_VERSION: 26
|
11
|
+
- RUBY_VERSION: 25
|
12
|
+
- RUBY_VERSION: 24
|
13
|
+
- RUBY_VERSION: _trunk
|
14
|
+
|
15
|
+
matrix:
|
16
|
+
allow_failures:
|
17
|
+
- RUBY_VERSION: _trunk
|
18
|
+
|
19
|
+
install:
|
20
|
+
- ps: . { iwr -useb https://raw.githubusercontent.com/metanorma/metanorma-build-scripts/master/appveyor.ps1 } | iex
|
21
|
+
- refreshenv
|
22
|
+
|
23
|
+
build_script:
|
24
|
+
- set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
|
25
|
+
- set GIT_TERMINAL_PROMPT=0
|
26
|
+
- gem install bundler -v "~> 2"
|
27
|
+
- bundle config --local path vendor/bundle
|
28
|
+
- bundle update
|
29
|
+
- bundle install
|
30
|
+
|
31
|
+
before_test:
|
32
|
+
- ruby -v
|
33
|
+
- gem -v
|
34
|
+
- bundle -v
|
35
|
+
|
36
|
+
test_script:
|
37
|
+
- bundle exec rake
|
@@ -194,6 +194,14 @@
|
|
194
194
|
<data type="boolean"/>
|
195
195
|
</attribute>
|
196
196
|
</optional>
|
197
|
+
<optional>
|
198
|
+
<attribute name="subsequence"/>
|
199
|
+
</optional>
|
200
|
+
<optional>
|
201
|
+
<attribute name="inequality">
|
202
|
+
<data type="boolean"/>
|
203
|
+
</attribute>
|
204
|
+
</optional>
|
197
205
|
<ref name="stem"/>
|
198
206
|
<optional>
|
199
207
|
<ref name="dl"/>
|
@@ -247,6 +255,9 @@
|
|
247
255
|
<data type="boolean"/>
|
248
256
|
</attribute>
|
249
257
|
</optional>
|
258
|
+
<optional>
|
259
|
+
<attribute name="subsequence"/>
|
260
|
+
</optional>
|
250
261
|
<optional>
|
251
262
|
<attribute name="lang"/>
|
252
263
|
</optional>
|
@@ -291,9 +302,15 @@
|
|
291
302
|
<data type="boolean"/>
|
292
303
|
</attribute>
|
293
304
|
</optional>
|
305
|
+
<optional>
|
306
|
+
<attribute name="subsequence"/>
|
307
|
+
</optional>
|
294
308
|
<optional>
|
295
309
|
<attribute name="alt"/>
|
296
310
|
</optional>
|
311
|
+
<optional>
|
312
|
+
<attribute name="summary"/>
|
313
|
+
</optional>
|
297
314
|
<optional>
|
298
315
|
<attribute name="uri">
|
299
316
|
<data type="anyURI"/>
|
@@ -423,6 +440,9 @@
|
|
423
440
|
<data type="boolean"/>
|
424
441
|
</attribute>
|
425
442
|
</optional>
|
443
|
+
<optional>
|
444
|
+
<attribute name="subsequence"/>
|
445
|
+
</optional>
|
426
446
|
<oneOrMore>
|
427
447
|
<choice>
|
428
448
|
<ref name="formula"/>
|
@@ -486,6 +506,9 @@
|
|
486
506
|
<data type="boolean"/>
|
487
507
|
</attribute>
|
488
508
|
</optional>
|
509
|
+
<optional>
|
510
|
+
<attribute name="subsequence"/>
|
511
|
+
</optional>
|
489
512
|
<optional>
|
490
513
|
<ref name="source"/>
|
491
514
|
</optional>
|
@@ -497,6 +520,8 @@
|
|
497
520
|
</optional>
|
498
521
|
<choice>
|
499
522
|
<ref name="image"/>
|
523
|
+
<ref name="video"/>
|
524
|
+
<ref name="audio"/>
|
500
525
|
<ref name="pre"/>
|
501
526
|
<zeroOrMore>
|
502
527
|
<ref name="figure"/>
|
@@ -792,7 +817,7 @@
|
|
792
817
|
</element>
|
793
818
|
</define>
|
794
819
|
<define name="video">
|
795
|
-
<element name="
|
820
|
+
<element name="video">
|
796
821
|
<attribute name="id">
|
797
822
|
<data type="ID"/>
|
798
823
|
</attribute>
|
@@ -833,7 +858,7 @@
|
|
833
858
|
</element>
|
834
859
|
</define>
|
835
860
|
<define name="audio">
|
836
|
-
<element name="
|
861
|
+
<element name="audio">
|
837
862
|
<attribute name="id">
|
838
863
|
<data type="ID"/>
|
839
864
|
</attribute>
|
@@ -147,6 +147,20 @@ module Asciidoctor
|
|
147
147
|
abbr
|
148
148
|
end
|
149
149
|
|
150
|
+
def load_yaml(lang, script)
|
151
|
+
y = if @i18nyaml then YAML.load_file(@i18nyaml)
|
152
|
+
elsif lang == "en"
|
153
|
+
YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
|
154
|
+
elsif lang == "fr"
|
155
|
+
YAML.load_file(File.join(File.dirname(__FILE__), "i18n-fr.yaml"))
|
156
|
+
elsif lang == "zh" && script == "Hans"
|
157
|
+
YAML.load_file(File.join(File.dirname(__FILE__), "i18n-zh-Hans.yaml"))
|
158
|
+
else
|
159
|
+
YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
|
160
|
+
end
|
161
|
+
super.merge(y)
|
162
|
+
end
|
163
|
+
|
150
164
|
def html_converter(node)
|
151
165
|
node.nil? ? IsoDoc::Iec::HtmlConvert.new({}) :
|
152
166
|
IsoDoc::Iec::HtmlConvert.new(html_extract_attributes(node))
|
@@ -0,0 +1,12 @@
|
|
1
|
+
term_def_boilerplate: |
|
2
|
+
<p>ISO and IEC maintain terminological databases for use in
|
3
|
+
standardization at the following addresses:</p>
|
4
|
+
|
5
|
+
<ul>
|
6
|
+
<li> <p>IEC Electropedia: available at
|
7
|
+
<link target="http://www.electropedia.org"/>
|
8
|
+
</p> </li>
|
9
|
+
<li> <p>ISO Online browsing platform: available at
|
10
|
+
<link target="http://www.iso.org/obp"/></p> </li>
|
11
|
+
</ul>
|
12
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
term_def_boilerplate: |
|
2
|
+
<p>L'ISO et l'IEC tiennent à jour des bases de données terminologiques
|
3
|
+
destinées à être utilisées en normalisation, consultables aux adresses
|
4
|
+
suivantes:</p>
|
5
|
+
<ul>
|
6
|
+
<li> <p>IEC Electropedia: disponible à l'adresse
|
7
|
+
<link target="http://www.electropedia.org"/>
|
8
|
+
</p> </li>
|
9
|
+
<li> <p>ISO Online browsing platform: disponible à l'adresse
|
10
|
+
<link target="http://www.iso.org/obp"/></p> </li>
|
11
|
+
</ul>
|
@@ -37,8 +37,7 @@ RSpec.describe Asciidoctor::Iec do
|
|
37
37
|
#{BLANK_HDR}
|
38
38
|
<sections>
|
39
39
|
<formula id="_">
|
40
|
-
<stem type="
|
41
|
-
r = 1 %</stem>
|
40
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi><mo>=</mo><mn>1</mn><mi>%</mi><mi>r</mi><mo>=</mo><mn>1</mn><mi>%</mi></math></stem>
|
42
41
|
</formula>
|
43
42
|
|
44
43
|
<formula id="_">
|
@@ -135,53 +135,6 @@ RSpec.describe Asciidoctor::Iec do
|
|
135
135
|
OUTPUT
|
136
136
|
end
|
137
137
|
|
138
|
-
it "moves notes inside preceding blocks, if they are not at clause end, and the blocks are not delimited" do
|
139
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
140
|
-
#{ASCIIDOC_BLANK_HDR}
|
141
|
-
[stem]
|
142
|
-
++++
|
143
|
-
r = 1 %
|
144
|
-
r = 1 %
|
145
|
-
++++
|
146
|
-
|
147
|
-
NOTE: That formula does not do much
|
148
|
-
|
149
|
-
Indeed.
|
150
|
-
INPUT
|
151
|
-
#{BLANK_HDR}
|
152
|
-
<sections><formula id="_">
|
153
|
-
<stem type="AsciiMath">r = 1 %
|
154
|
-
r = 1 %</stem>
|
155
|
-
<note id="_">
|
156
|
-
<p id="_">That formula does not do much</p>
|
157
|
-
</note></formula>
|
158
|
-
|
159
|
-
<p id="_">Indeed.</p></sections>
|
160
|
-
</iso-standard>
|
161
|
-
OUTPUT
|
162
|
-
end
|
163
|
-
|
164
|
-
it "does not move notes inside preceding blocks, if they are at clause end" do
|
165
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
166
|
-
#{ASCIIDOC_BLANK_HDR}
|
167
|
-
[source,ruby]
|
168
|
-
[1...x].each do |y|
|
169
|
-
puts y
|
170
|
-
end
|
171
|
-
|
172
|
-
NOTE: That loop does not do much
|
173
|
-
INPUT
|
174
|
-
#{BLANK_HDR}
|
175
|
-
<sections><sourcecode lang="ruby" id="_">[1...x].each do |y|
|
176
|
-
puts y
|
177
|
-
end</sourcecode>
|
178
|
-
<note id="_">
|
179
|
-
<p id="_">That loop does not do much</p>
|
180
|
-
</note></sections>
|
181
|
-
</iso-standard>
|
182
|
-
OUTPUT
|
183
|
-
end
|
184
|
-
|
185
138
|
it "converts xrefs to references into erefs" do
|
186
139
|
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
187
140
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -675,7 +628,7 @@ r = 1 %</stem>
|
|
675
628
|
<p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
676
629
|
<bibitem id="iso123" type="standard">
|
677
630
|
<title format="text/plain">Standard</title>
|
678
|
-
<docidentifier>ISO 123
|
631
|
+
<docidentifier>ISO 123:–</docidentifier>
|
679
632
|
<date type="published">
|
680
633
|
<on>--</on>
|
681
634
|
</date>
|
@@ -22,7 +22,7 @@ RSpec.describe IsoDoc do
|
|
22
22
|
</iso-standard>
|
23
23
|
INPUT
|
24
24
|
expect(File.exist?("test.html")).to be true
|
25
|
-
html = File.read("test.html")
|
25
|
+
html = File.read("test.html", encoding: "UTF-8")
|
26
26
|
expect(html).to match(%r{<title>Cereals and pulses\ \— Specifications and test methods\ \— Rice</title>})
|
27
27
|
expect(html).to match(%r{cdnjs\.cloudflare\.com/ajax/libs/mathjax/})
|
28
28
|
expect(html).to match(/delimiters: \[\['\(#\(', '\)#\)'\]\]/)
|
@@ -48,7 +48,7 @@ RSpec.describe IsoDoc do
|
|
48
48
|
</iso-standard>
|
49
49
|
INPUT
|
50
50
|
expect(File.exist?("test.html")).to be true
|
51
|
-
html = File.read("test.html")
|
51
|
+
html = File.read("test.html", encoding: "UTF-8")
|
52
52
|
expect(html).to match(%r{<title>Cereals and pulses\ \— Specifications and test methods\ \— Rice</title>})
|
53
53
|
expect(html).to match(%r{cdnjs\.cloudflare\.com/ajax/libs/mathjax/})
|
54
54
|
expect(html).to match(/delimiters: \[\['\(#\(', '\)#\)'\]\]/)
|
@@ -67,7 +67,7 @@ RSpec.describe IsoDoc do
|
|
67
67
|
</iso-standard>
|
68
68
|
INPUT
|
69
69
|
expect(File.exist?("test.doc")).to be true
|
70
|
-
word = File.read("test.doc")
|
70
|
+
word = File.read("test.doc", encoding: "UTF-8")
|
71
71
|
expect(word).to match(/<style>/)
|
72
72
|
end
|
73
73
|
|
@@ -76,7 +76,7 @@ RSpec.describe IsoDoc do
|
|
76
76
|
FileUtils.rm_f "spec/assets/iso.html"
|
77
77
|
IsoDoc::Iec::HtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("spec/assets/iso.xml", nil, false)
|
78
78
|
expect(File.exist?("spec/assets/iso.html")).to be true
|
79
|
-
html = File.read("spec/assets/iso.html")
|
79
|
+
html = File.read("spec/assets/iso.html", encoding: "UTF-8")
|
80
80
|
expect(html).to match(/<style>/)
|
81
81
|
expect(html).to match(%r{https://use.fontawesome.com})
|
82
82
|
expect(html).to match(%r{libs/jquery})
|
@@ -86,7 +86,7 @@ RSpec.describe IsoDoc do
|
|
86
86
|
FileUtils.rm_f "spec/assets/iso.doc"
|
87
87
|
IsoDoc::Iec::WordConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("spec/assets/iso.xml", nil, false)
|
88
88
|
expect(File.exist?("spec/assets/iso.doc")).to be true
|
89
|
-
word = File.read("spec/assets/iso.doc")
|
89
|
+
word = File.read("spec/assets/iso.doc", encoding: "UTF-8")
|
90
90
|
expect(word).to match(/<w:WordDocument>/)
|
91
91
|
expect(word).to match(/<style>/)
|
92
92
|
end
|
@@ -107,7 +107,7 @@ RSpec.describe IsoDoc do
|
|
107
107
|
</annex>
|
108
108
|
</iso-standard>
|
109
109
|
INPUT
|
110
|
-
word = File.read("test.doc").sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">').
|
110
|
+
word = File.read("test.doc", encoding: "UTF-8").sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">').
|
111
111
|
sub(%r{<div style="mso-element:footnote-list"/>.*$}m, "")
|
112
112
|
expect(word).to be_equivalent_to <<~"OUTPUT"
|
113
113
|
<div class="WordSection3">
|
@@ -150,7 +150,7 @@ RSpec.describe IsoDoc do
|
|
150
150
|
</iso-standard>
|
151
151
|
|
152
152
|
INPUT
|
153
|
-
word = File.read("test.doc").sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">').
|
153
|
+
word = File.read("test.doc", encoding: "UTF-8").sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">').
|
154
154
|
sub(%r{<div style="mso-element:footnote-list"/>.*$}m, "")
|
155
155
|
expect(word).to be_equivalent_to <<~"OUTPUT"
|
156
156
|
<div class="WordSection3">
|
@@ -177,7 +177,7 @@ RSpec.describe IsoDoc do
|
|
177
177
|
</iso-standard>
|
178
178
|
|
179
179
|
INPUT
|
180
|
-
word = File.read("test.doc").sub(%r{^.*Content-Location: file:///C:/Doc/test_files/header.html}m, "Content-Location: file:///C:/Doc/test_files/header.html").
|
180
|
+
word = File.read("test.doc", encoding: "UTF-8").sub(%r{^.*Content-Location: file:///C:/Doc/test_files/header.html}m, "Content-Location: file:///C:/Doc/test_files/header.html").
|
181
181
|
sub(/------=_NextPart.*$/m, "")
|
182
182
|
#expect(word).to include(%{Content-Location: file:///C:/Doc/test_files/header.html\nContent-Transfer-Encoding: base64\nContent-Type: text/html charset="utf-8" })
|
183
183
|
expect(word).to include(%{Content-Location: file:///C:/Doc/test_files/header.html})
|
@@ -204,7 +204,7 @@ RSpec.describe IsoDoc do
|
|
204
204
|
</iso-standard>
|
205
205
|
|
206
206
|
INPUT
|
207
|
-
word = File.read("test.doc").sub(/^.*An empty word intro page\./m, '').
|
207
|
+
word = File.read("test.doc", encoding: "UTF-8").sub(/^.*An empty word intro page\./m, '').
|
208
208
|
sub(%r{<p class="zzSTDTitle1">.*$}m, "")
|
209
209
|
expect(word.gsub(/_Toc\d\d+/, "_Toc")).to be_equivalent_to <<~'OUTPUT'
|
210
210
|
<p class="MsoToc1"><span lang="EN-GB" xml:lang="EN-GB"><span style="mso-element:field-begin"></span><span style="mso-spacerun:yes"> </span>TOC
|
@@ -296,7 +296,7 @@ RSpec.describe IsoDoc do
|
|
296
296
|
</sections>
|
297
297
|
</iso-standard>
|
298
298
|
INPUT
|
299
|
-
html = File.read("test.html").sub(/^.*<main class="main-section">/m, '<main class="main-section">').
|
299
|
+
html = File.read("test.html", encoding: "UTF-8").sub(/^.*<main class="main-section">/m, '<main class="main-section">').
|
300
300
|
sub(%r{</main>.*$}m, "</main>")
|
301
301
|
expect(html).to be_equivalent_to <<~"OUTPUT"
|
302
302
|
<main class="main-section"><button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
|
@@ -350,7 +350,7 @@ RSpec.describe IsoDoc do
|
|
350
350
|
</foreword></preface>
|
351
351
|
</iso-standard>
|
352
352
|
INPUT
|
353
|
-
html = File.read("test.html").sub(/^.*<main class="main-section">/m, '<main class="main-section">').
|
353
|
+
html = File.read("test.html", encoding: "UTF-8").sub(/^.*<main class="main-section">/m, '<main class="main-section">').
|
354
354
|
sub(%r{</main>.*$}m, "</main>")
|
355
355
|
expect(`ls test_htmlimages`).to match(/\.png$/)
|
356
356
|
expect(html.gsub(/\/[0-9a-f-]+\.png/, "/_.png")).to be_equivalent_to <<~"OUTPUT"
|
@@ -426,7 +426,7 @@ RSpec.describe IsoDoc do
|
|
426
426
|
</iso-standard>
|
427
427
|
INPUT
|
428
428
|
expect(File.exist?("test.html")).to be true
|
429
|
-
html = File.read("test.html")
|
429
|
+
html = File.read("test.html", encoding: "UTF-8")
|
430
430
|
expect(html).to match(%r{<h2 class="TermNum" id="paddy1">1\.1</h2>})
|
431
431
|
expect(html).to match(%r{<h2 class="TermNum" id="paddy">1\.2</h2>})
|
432
432
|
end
|
@@ -446,7 +446,7 @@ RSpec.describe IsoDoc do
|
|
446
446
|
</annex>
|
447
447
|
</iso-standard>
|
448
448
|
INPUT
|
449
|
-
word = File.read("test.doc").sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">').
|
449
|
+
word = File.read("test.doc", encoding: "UTF-8").sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">').
|
450
450
|
sub(%r{<div style="mso-element:footnote-list"/>.*$}m, "")
|
451
451
|
expect(word).to be_equivalent_to <<~"OUTPUT"
|
452
452
|
<div class="WordSection3">
|
@@ -486,7 +486,7 @@ RSpec.describe IsoDoc do
|
|
486
486
|
</annex>
|
487
487
|
</iso-standard>
|
488
488
|
INPUT
|
489
|
-
word = File.read("test.doc").sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">').
|
489
|
+
word = File.read("test.doc", encoding: "UTF-8").sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">').
|
490
490
|
sub(%r{<div style="mso-element:footnote-list"/>.*$}m, "")
|
491
491
|
expect(word).to be_equivalent_to <<~"OUTPUT"
|
492
492
|
<div class="WordSection3">
|
@@ -525,11 +525,11 @@ RSpec.describe IsoDoc do
|
|
525
525
|
</annex>
|
526
526
|
</iso-standard>
|
527
527
|
INPUT
|
528
|
-
word = File.read("test.doc").sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">').
|
528
|
+
word = File.read("test.doc", encoding: "UTF-8").sub(/^.*<div class="WordSection3">/m, '<div class="WordSection3">').
|
529
529
|
sub(%r{<div style="mso-element:footnote-list"/>.*$}m, "")
|
530
530
|
expect(word).to be_equivalent_to <<~"OUTPUT"
|
531
531
|
<div class="WordSection3">
|
532
|
-
|
532
|
+
#{IEC_TITLE.gsub(/\ /, " ")}
|
533
533
|
<p class="MsoNormal">
|
534
534
|
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
|
535
535
|
</p>
|
@@ -537,7 +537,7 @@ RSpec.describe IsoDoc do
|
|
537
537
|
<p class="Sourcecode"><a name="A" id="A"></a>puts "Hello, world."</p>
|
538
538
|
<p class="TableTitle" style="text-align:center;">Table A.1</p>
|
539
539
|
<div align="center">
|
540
|
-
<table style="mso-table-lspace:15.0cm;margin-left:423.0pt;mso-table-rspace:15.0cm;margin-right:423.0pt;mso-table-bspace:14.2pt;mso-table-anchor-vertical:paragraph;mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;" class="MsoISOTable"><a name="samplecode" id="samplecode"></a>
|
540
|
+
<table style="mso-table-lspace:15.0cm;margin-left:423.0pt;mso-table-rspace:15.0cm;margin-right:423.0pt;mso-table-bspace:14.2pt;mso-table-anchor-vertical:paragraph;mso-table-anchor-horizontal:column;mso-table-overlap:never;border-spacing:0;border-width:1px;" class="MsoISOTable" summary=""><a name="samplecode" id="samplecode"></a>
|
541
541
|
<tbody>
|
542
542
|
<tr>
|
543
543
|
<td style="border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;" class="TABLE-cell">
|
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.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -244,12 +244,23 @@ executables: []
|
|
244
244
|
extensions: []
|
245
245
|
extra_rdoc_files: []
|
246
246
|
files:
|
247
|
+
- ".gitignore"
|
248
|
+
- ".hound.yml"
|
249
|
+
- ".rubocop.yml"
|
250
|
+
- ".travis.yml"
|
251
|
+
- CODE_OF_CONDUCT.md
|
247
252
|
- Gemfile
|
253
|
+
- LICENSE
|
248
254
|
- README.adoc
|
255
|
+
- Rakefile
|
256
|
+
- appveyor.yml
|
249
257
|
- bin/rspec
|
250
258
|
- lib/asciidoctor/iec/basicdoc.rng
|
251
259
|
- lib/asciidoctor/iec/biblio.rng
|
252
260
|
- lib/asciidoctor/iec/converter.rb
|
261
|
+
- lib/asciidoctor/iec/i18n-en.yaml
|
262
|
+
- lib/asciidoctor/iec/i18n-fr.yaml
|
263
|
+
- lib/asciidoctor/iec/i18n-zh-Hans.yaml
|
253
264
|
- lib/asciidoctor/iec/iec_intro_en.xml
|
254
265
|
- lib/asciidoctor/iec/iec_intro_fr.xml
|
255
266
|
- lib/asciidoctor/iec/isodoc.rng
|