metanorma-iec 1.3.0 → 1.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +12 -11
- data/.hound.yml +3 -1
- data/.rubocop.yml +4 -8
- data/lib/asciidoctor/iec/biblio.rng +1 -0
- data/lib/asciidoctor/iec/front.rb +11 -5
- data/lib/asciidoctor/iec/iec.rng +4 -0
- data/lib/asciidoctor/iec/iec_intro_en.xml +1 -1
- data/lib/asciidoctor/iec/isodoc.rng +191 -3
- data/lib/asciidoctor/iec/isostandard.rng +12 -0
- data/lib/isodoc/iec/base_convert.rb +20 -14
- data/lib/isodoc/iec/html_convert.rb +6 -6
- data/lib/isodoc/iec/iec.international-standard.xsl +533 -67
- data/lib/isodoc/iec/metadata.rb +1 -1
- data/lib/isodoc/iec/pdf_convert.rb +1 -1
- data/lib/isodoc/iec/presentation_xml_convert.rb +17 -17
- data/lib/isodoc/iec/word_convert.rb +69 -19
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +1 -1
- data/spec/asciidoctor/base_spec.rb +818 -801
- data/spec/asciidoctor/blocks_spec.rb +212 -154
- data/spec/asciidoctor/section_spec.rb +0 -38
- data/spec/isodoc/blocks_spec.rb +2 -2
- data/spec/isodoc/i18n_spec.rb +346 -432
- data/spec/isodoc/iev_spec.rb +508 -519
- data/spec/isodoc/inline_spec.rb +2 -2
- data/spec/isodoc/ref_spec.rb +6 -6
- data/spec/isodoc/section_spec.rb +334 -339
- data/spec/isodoc/terms_spec.rb +1 -1
- metadata +3 -3
data/lib/isodoc/iec/metadata.rb
CHANGED
@@ -7,8 +7,8 @@ module IsoDoc
|
|
7
7
|
def clause(docxml)
|
8
8
|
docxml.xpath(ns("//clause[not(ancestor::annex)] | "\
|
9
9
|
"//definitions | //references | "\
|
10
|
-
"//preface/introduction[clause]"))
|
11
|
-
|
10
|
+
"//preface/introduction[clause]"))
|
11
|
+
.each do |f|
|
12
12
|
clause1(f)
|
13
13
|
end
|
14
14
|
docxml.xpath(ns("//terms")).each do |f|
|
@@ -16,27 +16,28 @@ module IsoDoc
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
def termclause1(
|
20
|
-
return clause1(
|
21
|
-
return if @suppressheadingnumbers ||
|
22
|
-
|
23
|
-
|
19
|
+
def termclause1(elem)
|
20
|
+
return clause1(elem) unless @is_iev
|
21
|
+
return if @suppressheadingnumbers || elem["unnumbered"]
|
22
|
+
|
23
|
+
lbl = @xrefs.anchor(elem["id"], :label, true) or return
|
24
|
+
prefix_name(elem, " ", "#{lbl}#{clausedelim}", "title")
|
24
25
|
end
|
25
26
|
|
26
|
-
def clause1(
|
27
|
-
IsoDoc::PresentationXMLConvert.instance_method(:clause1).bind(self)
|
28
|
-
call(
|
27
|
+
def clause1(elem)
|
28
|
+
IsoDoc::PresentationXMLConvert.instance_method(:clause1).bind(self)
|
29
|
+
.call(elem)
|
29
30
|
end
|
30
31
|
|
31
|
-
def bibdata_i18n(
|
32
|
+
def bibdata_i18n(bib)
|
32
33
|
fr = IsoDoc::Iec::I18n.new("fr", "Latn")
|
33
34
|
en = IsoDoc::Iec::I18n.new("en", "Latn")
|
34
35
|
[{ lang: "en", i18n: en }, { lang: "fr", i18n: fr }].each do |v|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
{ doctype_dict: "./ext/doctype", stage_dict: "./status/stage",
|
37
|
+
substage_dict: "./status/substage", function_dict: "./ext/function",
|
38
|
+
horizontal_dict: "./ext/horizontal" }.each do |lbl, xpath|
|
39
|
+
hash_translate(bib, v[:i18n].get[lbl.to_s], xpath, v[:lang])
|
40
|
+
end
|
40
41
|
end
|
41
42
|
end
|
42
43
|
|
@@ -44,4 +45,3 @@ module IsoDoc
|
|
44
45
|
end
|
45
46
|
end
|
46
47
|
end
|
47
|
-
|
@@ -11,10 +11,16 @@ module IsoDoc
|
|
11
11
|
@libdir = File.dirname(__FILE__)
|
12
12
|
end
|
13
13
|
|
14
|
+
def font_choice(options)
|
15
|
+
if options[:script] == "Hans" then '"Source Han Sans",serif'
|
16
|
+
else '"Arial",sans-serif'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
14
20
|
def default_fonts(options)
|
15
21
|
{
|
16
|
-
bodyfont: (options
|
17
|
-
headerfont: (options
|
22
|
+
bodyfont: font_choice(options),
|
23
|
+
headerfont: font_choice(options),
|
18
24
|
monospacefont: '"Courier New",monospace',
|
19
25
|
normalfontsize: "10.0pt",
|
20
26
|
footnotefontsize: "8.0pt",
|
@@ -23,7 +29,7 @@ module IsoDoc
|
|
23
29
|
}
|
24
30
|
end
|
25
31
|
|
26
|
-
def default_file_locations(
|
32
|
+
def default_file_locations(_options)
|
27
33
|
@libdir = File.dirname(__FILE__)
|
28
34
|
{
|
29
35
|
wordstylesheet: html_doc_path("wordstyle.scss"),
|
@@ -70,7 +76,7 @@ module IsoDoc
|
|
70
76
|
toc += word_toc_entry(1, header_strip(h))
|
71
77
|
end
|
72
78
|
toc.sub(/(<p class="MsoToc1">)/,
|
73
|
-
%{\\1#{WORD_TOC_TABLE_PREFACE1}}) +
|
79
|
+
%{\\1#{WORD_TOC_TABLE_PREFACE1}}) + WORD_TOC_SUFFIX1
|
74
80
|
end
|
75
81
|
|
76
82
|
def make_FigureWordToC(docxml)
|
@@ -79,11 +85,21 @@ module IsoDoc
|
|
79
85
|
toc += word_toc_entry(1, header_strip(h))
|
80
86
|
end
|
81
87
|
toc.sub(/(<p class="MsoToc1">)/,
|
82
|
-
%{\\1#{WORD_TOC_FIGURE_PREFACE1}}) +
|
88
|
+
%{\\1#{WORD_TOC_FIGURE_PREFACE1}}) + WORD_TOC_SUFFIX1
|
89
|
+
end
|
90
|
+
|
91
|
+
def word_toc_preface(level)
|
92
|
+
<<~TOC.freeze
|
93
|
+
<span lang="EN-GB"><span
|
94
|
+
style='mso-element:field-begin'></span><span
|
95
|
+
style='mso-spacerun:yes'> </span>TOC
|
96
|
+
\\o "1-#{level}" \\h \\z \\u <span
|
97
|
+
style='mso-element:field-separator'></span></span>
|
98
|
+
TOC
|
83
99
|
end
|
84
100
|
|
85
|
-
def header_strip(
|
86
|
-
|
101
|
+
def header_strip(hdr)
|
102
|
+
hdr = hdr.to_s.gsub(/<\/?p[^>]*>/, "")
|
87
103
|
super
|
88
104
|
end
|
89
105
|
|
@@ -93,10 +109,11 @@ module IsoDoc
|
|
93
109
|
super
|
94
110
|
end
|
95
111
|
|
96
|
-
def make_tr_attr(
|
112
|
+
def make_tr_attr(cell, row, totalrows, header)
|
97
113
|
ret = super
|
98
|
-
css_class =
|
99
|
-
|
114
|
+
css_class =
|
115
|
+
cell.name == "th" || header ? "TABLE-col-heading" : "TABLE-cell"
|
116
|
+
ret.merge("class": css_class)
|
100
117
|
end
|
101
118
|
|
102
119
|
def tr_parse(node, out, ord, totalrows, header)
|
@@ -122,7 +139,8 @@ module IsoDoc
|
|
122
139
|
|
123
140
|
def word_table_cleanup1(docxml, style)
|
124
141
|
%w(td th).each do |tdh|
|
125
|
-
docxml.xpath("//#{tdh}[@class = '#{style}'][not(descendant::p)]")
|
142
|
+
docxml.xpath("//#{tdh}[@class = '#{style}'][not(descendant::p)]")
|
143
|
+
.each do |td|
|
126
144
|
p = Nokogiri::XML::Element.new("p", docxml)
|
127
145
|
td.children.each { |c| c.parent = p }
|
128
146
|
p.parent = td
|
@@ -148,7 +166,7 @@ module IsoDoc
|
|
148
166
|
end
|
149
167
|
|
150
168
|
# Incredibly, the numbered boilerplate list in IEC is NOT A LIST,
|
151
|
-
# and it violates numbering conventions for ordered lists
|
169
|
+
# and it violates numbering conventions for ordered lists
|
152
170
|
# (arabic not alpha)
|
153
171
|
BOILERPLATE_PARAS = "//div[@class = 'boilerplate_legal']//li/p".freeze
|
154
172
|
|
@@ -156,7 +174,8 @@ module IsoDoc
|
|
156
174
|
docxml.xpath(BOILERPLATE_PARAS).each_with_index do |l, i|
|
157
175
|
l["class"] = "FOREWORD"
|
158
176
|
l.children.first.add_previous_sibling(
|
159
|
-
%{#{i+1})<span style="mso-tab-count:1">  </span>}
|
177
|
+
%{#{i + 1})<span style="mso-tab-count:1">  </span>},
|
178
|
+
)
|
160
179
|
end
|
161
180
|
docxml.xpath("//div[@class = 'boilerplate_legal']//li").each do |l|
|
162
181
|
l.replace(l.children)
|
@@ -166,24 +185,55 @@ module IsoDoc
|
|
166
185
|
end
|
167
186
|
|
168
187
|
def authority_cleanup(docxml)
|
169
|
-
auth = docxml.at("//div[@id = 'boilerplate-feedback' or
|
188
|
+
auth = docxml.at("//div[@id = 'boilerplate-feedback' or "\
|
189
|
+
"@class = 'boilerplate-feedback']")
|
170
190
|
auth&.remove
|
171
191
|
super
|
172
192
|
end
|
173
193
|
|
174
|
-
def make_body1(body, _docxml)
|
194
|
+
def make_body1(body, _docxml); end
|
195
|
+
|
196
|
+
def word_cover(docxml); end
|
197
|
+
|
198
|
+
def style_cleanup(docxml); end
|
199
|
+
|
200
|
+
def bibliography_attrs
|
201
|
+
{ class: "Section3" }
|
202
|
+
end
|
203
|
+
|
204
|
+
def termref_attrs
|
205
|
+
{}
|
206
|
+
end
|
207
|
+
|
208
|
+
def figure_name_attrs(_node)
|
209
|
+
{ class: "FigureTitle", style: "text-align:center;" }
|
210
|
+
end
|
211
|
+
|
212
|
+
def table_title_attrs(_node)
|
213
|
+
{ class: "TableTitle", style: "text-align:center;" }
|
175
214
|
end
|
176
215
|
|
177
|
-
def
|
216
|
+
def para_class(_node)
|
217
|
+
classtype = nil
|
218
|
+
classtype = "MsoCommentText" if in_comment
|
219
|
+
classtype = "Sourcecode" if @annotation
|
220
|
+
classtype
|
221
|
+
end
|
222
|
+
|
223
|
+
def annex_name(_annex, name, div)
|
224
|
+
return if name.nil?
|
225
|
+
|
226
|
+
div.h1 **{ class: "Annex" } do |t|
|
227
|
+
name.children.each { |c2| parse(c2, t) }
|
228
|
+
end
|
178
229
|
end
|
179
230
|
|
180
231
|
def formula_parse1(node, out)
|
181
232
|
out.div **attr_code(class: "formula") do |div|
|
182
|
-
div.p **attr_code(class: "formula") do |
|
233
|
+
div.p **attr_code(class: "formula") do |_p|
|
183
234
|
insert_tab(div, 1)
|
184
235
|
parse(node.at(ns("./stem")), div)
|
185
|
-
lbl = node&.at(ns("./name"))&.text
|
186
|
-
unless lbl.nil?
|
236
|
+
if lbl = node&.at(ns("./name"))&.text
|
187
237
|
insert_tab(div, 1)
|
188
238
|
div << "(#{lbl})"
|
189
239
|
end
|
data/metanorma-iec.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.require_paths = ["lib"]
|
26
26
|
spec.files = `git ls-files`.split("\n")
|
27
27
|
spec.test_files = `git ls-files -- {spec}/*`.split("\n")
|
28
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 2.
|
28
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
|
29
29
|
|
30
30
|
spec.add_dependency "metanorma-iso", "~> 1.8.0"
|
31
31
|
spec.add_dependency "ruby-jing"
|
@@ -1,52 +1,48 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
require "fileutils"
|
3
3
|
|
4
|
-
|
5
|
-
before(:all) do
|
6
|
-
@blank_hdr = blank_hdr_gen
|
7
|
-
end
|
4
|
+
OPTIONS = [backend: :iec, header_footer: true].freeze
|
8
5
|
|
6
|
+
RSpec.describe Asciidoctor::Iec do
|
7
|
+
before(:all) do
|
8
|
+
@blank_hdr = blank_hdr_gen
|
9
|
+
end
|
9
10
|
|
10
11
|
it "has a version number" do
|
11
12
|
expect(Metanorma::Iec::VERSION).not_to be nil
|
12
13
|
end
|
13
14
|
|
14
|
-
#it "generates output for the Rice document" do
|
15
|
-
#FileUtils.rm_f %w(spec/examples/rice.xml spec/examples/rice.doc spec/examples/rice.html spec/examples/rice_alt.html)
|
16
|
-
#FileUtils.cd "spec/examples"
|
17
|
-
#Asciidoctor.convert_file "rice.adoc", {:attributes=>{"backend"=>"iso"}, :safe=>0, :header_footer=>true, :requires=>["metanorma-iso"], :failure_level=>4, :mkdirs=>true, :to_file=>nil}
|
18
|
-
#FileUtils.cd "../.."
|
19
|
-
#expect(File.exist?("spec/examples/rice.xml")).to be true
|
20
|
-
#expect(File.exist?("spec/examples/rice.doc")).to be true
|
21
|
-
#expect(File.exist?("spec/examples/rice.html")).to be true
|
22
|
-
#expect(File.exist?("spec/examples/rice_alt.html")).to be true
|
23
|
-
#end
|
24
|
-
|
25
15
|
it "processes a blank document" do
|
26
|
-
|
27
|
-
|
16
|
+
input = <<~INPUT
|
17
|
+
#{ASCIIDOC_BLANK_HDR}
|
28
18
|
INPUT
|
29
|
-
|
30
|
-
|
31
|
-
|
19
|
+
output = <<~OUTPUT
|
20
|
+
#{@blank_hdr}
|
21
|
+
<sections/>
|
22
|
+
</iec-standard>
|
32
23
|
OUTPUT
|
24
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
25
|
+
.to be_equivalent_to xmlpp(output)
|
33
26
|
end
|
34
27
|
|
35
28
|
it "converts a blank document" do
|
36
29
|
FileUtils.rm_f "test.doc"
|
37
30
|
FileUtils.rm_f "test.html"
|
38
31
|
FileUtils.rm_f "test.pdf"
|
39
|
-
|
32
|
+
input = <<~INPUT
|
40
33
|
= Document title
|
41
34
|
Author
|
42
35
|
:docfile: test.adoc
|
43
36
|
:novalid:
|
44
37
|
:no-isobib:
|
45
38
|
INPUT
|
46
|
-
|
47
|
-
|
48
|
-
|
39
|
+
output = <<~OUTPUT
|
40
|
+
#{@blank_hdr}
|
41
|
+
<sections/>
|
42
|
+
</iec-standard>
|
49
43
|
OUTPUT
|
44
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
45
|
+
.to be_equivalent_to xmlpp(output)
|
50
46
|
expect(File.exist?("test.pdf")).to be true
|
51
47
|
expect(File.exist?("test.html")).to be true
|
52
48
|
expect(File.exist?("test.doc")).to be true
|
@@ -54,7 +50,7 @@ end
|
|
54
50
|
end
|
55
51
|
|
56
52
|
it "processes default metadata" do
|
57
|
-
|
53
|
+
input = <<~INPUT
|
58
54
|
= Document title
|
59
55
|
Author
|
60
56
|
:docfile: test.adoc
|
@@ -103,237 +99,245 @@ end
|
|
103
99
|
:interest-to-committees: TC 6121, SC 12
|
104
100
|
:obsoletes: ABC; DEF
|
105
101
|
INPUT
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
<
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
</
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
</
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
</
|
181
|
-
<
|
182
|
-
|
183
|
-
</
|
184
|
-
|
185
|
-
|
186
|
-
</
|
187
|
-
|
188
|
-
|
189
|
-
</
|
190
|
-
|
191
|
-
<
|
192
|
-
<
|
193
|
-
|
194
|
-
<
|
195
|
-
<
|
196
|
-
|
197
|
-
|
198
|
-
<
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
102
|
+
output = <<~OUTPUT
|
103
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
104
|
+
<iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
|
105
|
+
<bibdata type='standard'>
|
106
|
+
<title language='en' format='text/plain' type='main'>
|
107
|
+
Introduction — Main
|
108
|
+
Title — Title — Title Part
|
109
|
+
</title>
|
110
|
+
<title language='en' format='text/plain' type='title-intro'>Introduction</title>
|
111
|
+
<title language='en' format='text/plain' type='title-main'>Main Title — Title</title>
|
112
|
+
<title language='en' format='text/plain' type='title-part'>Title Part</title>
|
113
|
+
<title language='fr' format='text/plain' type='main'>
|
114
|
+
Introduction Française — Titre
|
115
|
+
Principal — Part du Titre
|
116
|
+
</title>
|
117
|
+
<title language='fr' format='text/plain' type='title-intro'>Introduction Française</title>
|
118
|
+
<title language='fr' format='text/plain' type='title-main'>Titre Principal</title>
|
119
|
+
<title language='fr' format='text/plain' type='title-part'>Part du Titre</title>
|
120
|
+
<docidentifier type='ISO'>IEC/3NWIP 1000-1 ED 2</docidentifier>
|
121
|
+
<docnumber>1000</docnumber>
|
122
|
+
<contributor>
|
123
|
+
<role type='author'/>
|
124
|
+
<organization>
|
125
|
+
<name>International Electrotechnical Commission</name>
|
126
|
+
<abbreviation>IEC</abbreviation>
|
127
|
+
</organization>
|
128
|
+
</contributor>
|
129
|
+
<contributor>
|
130
|
+
<role type='publisher'/>
|
131
|
+
<organization>
|
132
|
+
<name>International Electrotechnical Commission</name>
|
133
|
+
<abbreviation>IEC</abbreviation>
|
134
|
+
</organization>
|
135
|
+
</contributor>
|
136
|
+
<edition>2</edition>
|
137
|
+
<version>
|
138
|
+
<revision-date>2000-01-01</revision-date>
|
139
|
+
<draft>0.3.4</draft>
|
140
|
+
</version>
|
141
|
+
<language>en</language>
|
142
|
+
<script>Latn</script>
|
143
|
+
<status>
|
144
|
+
<stage abbreviation='NWIP'>10</stage>
|
145
|
+
<substage abbreviation='??'>20</substage>
|
146
|
+
<iteration>3</iteration>
|
147
|
+
</status>
|
148
|
+
<copyright>
|
149
|
+
<from>#{Date.today.year}</from>
|
150
|
+
<owner>
|
151
|
+
<organization>
|
152
|
+
<name>International Electrotechnical Commission</name>
|
153
|
+
<abbreviation>IEC</abbreviation>
|
154
|
+
</organization>
|
155
|
+
</owner>
|
156
|
+
</copyright>
|
157
|
+
<relation type='obsoletes'>
|
158
|
+
<bibitem>
|
159
|
+
<title>--</title>
|
160
|
+
<docidentifier>ABC</docidentifier>
|
161
|
+
</bibitem>
|
162
|
+
</relation>
|
163
|
+
<relation type='obsoletes'>
|
164
|
+
<bibitem>
|
165
|
+
<title>--</title>
|
166
|
+
<docidentifier>DEF</docidentifier>
|
167
|
+
</bibitem>
|
168
|
+
</relation>
|
169
|
+
<ext>
|
170
|
+
<doctype>article</doctype>
|
171
|
+
<horizontal>false</horizontal>
|
172
|
+
<editorialgroup>
|
173
|
+
<technical-committee number='1' type='A'>TC</technical-committee>
|
174
|
+
<technical-committee number='11' type='A1'>TC1</technical-committee>
|
175
|
+
<subcommittee number='2' type='B'>SC</subcommittee>
|
176
|
+
<subcommittee number='21' type='B1'>SC1</subcommittee>
|
177
|
+
<workgroup number='3' type='C'>WG</workgroup>
|
178
|
+
<workgroup number='31' type='C1'>WG1</workgroup>
|
179
|
+
<secretariat>SECRETARIAT</secretariat>
|
180
|
+
</editorialgroup>
|
181
|
+
<ics>
|
182
|
+
<code>1</code>
|
183
|
+
</ics>
|
184
|
+
<ics>
|
185
|
+
<code>2</code>
|
186
|
+
</ics>
|
187
|
+
<ics>
|
188
|
+
<code>3</code>
|
189
|
+
</ics>
|
190
|
+
<structuredidentifier>
|
191
|
+
<project-number part='1'>IEC 1000</project-number>
|
192
|
+
</structuredidentifier>
|
193
|
+
<stagename>New work item proposal</stagename>
|
194
|
+
<accessibility-color-inside>true</accessibility-color-inside>
|
195
|
+
<price-code>XC</price-code>
|
196
|
+
<cen-processing>true</cen-processing>
|
197
|
+
<secretary>Fred Nerk</secretary>
|
198
|
+
<interest-to-committees>TC 6121, SC 12</interest-to-committees>
|
199
|
+
</ext>
|
200
|
+
</bibdata>
|
201
|
+
<boilerplate>
|
202
|
+
<copyright-statement>
|
203
|
+
<clause>
|
204
|
+
<p id='_'>
|
205
|
+
<strong>Copyright © #{Date.today.year} International Electrotechnical Commission, IEC.</strong>
|
206
|
+
All rights reserved. It is permitted to download this electronic
|
207
|
+
file, to make a copy and to print out the content for the sole purpose
|
208
|
+
of preparing National Committee positions. You may not copy or
|
209
|
+
“mirror” the file or printed version of the document, or
|
210
|
+
any part of it, for any other purpose without permission in writing
|
211
|
+
from IEC.
|
212
|
+
</p>
|
213
|
+
</clause>
|
214
|
+
</copyright-statement>
|
215
|
+
<legal-statement>
|
216
|
+
<clause>
|
217
|
+
<ol id='_'>
|
218
|
+
<li>
|
219
|
+
<p id='_'>
|
220
|
+
The International Electrotechnical Commission (IEC) is a worldwide
|
221
|
+
organization for standardization comprising all national
|
222
|
+
electrotechnical committees (IEC National Committees). The object
|
223
|
+
of IEC is to promote international co-operation on all questions
|
224
|
+
concerning standardization in the electrical and electronic
|
225
|
+
fields. To this end and in addition to other activities, IEC
|
226
|
+
publishes International Standards, Technical Specifications,
|
227
|
+
Technical Reports, Publicly Available Specifications (PAS) and
|
228
|
+
Guides (hereafter referred to as “IEC
|
229
|
+
Publication(s)”). Their preparation is entrusted to
|
230
|
+
technical committees; any IEC National Committee interested in the
|
231
|
+
subject dealt with may participate in this preparatory work.
|
232
|
+
International, governmental and non-governmental organizations
|
233
|
+
liaising with the IEC also participate in this preparation. IEC
|
234
|
+
collaborates closely with the International Organization for
|
235
|
+
Standardization (ISO) in accordance with conditions determined by
|
236
|
+
agreement between the two organizations.
|
237
|
+
</p>
|
238
|
+
</li>
|
239
|
+
<li>
|
240
|
+
<p id='_'>
|
241
|
+
The formal decisions or agreements of IEC on technical matters
|
242
|
+
express, as nearly as possible, an international consensus of
|
243
|
+
opinion on the relevant subjects since each technical committee
|
244
|
+
has representation from all interested IEC National Committees.
|
245
|
+
</p>
|
246
|
+
</li>
|
247
|
+
<li>
|
248
|
+
<p id='_'>
|
249
|
+
IEC Publications have the form of recommendations for
|
250
|
+
international use and are accepted by IEC National Committees in
|
251
|
+
that sense. While all reasonable efforts are made to ensure that
|
252
|
+
the technical content of IEC Publications is accurate, IEC cannot
|
253
|
+
be held responsible for the way in which they are used or for any
|
254
|
+
misinterpretation by any end user.
|
255
|
+
</p>
|
256
|
+
</li>
|
257
|
+
<li>
|
258
|
+
<p id='_'>
|
259
|
+
In order to promote international uniformity, IEC National
|
260
|
+
Committees undertake to apply IEC Publications transparently to
|
261
|
+
the maximum extent possible in their national and regional
|
262
|
+
publications. Any divergence between any IEC Publication and the
|
263
|
+
corresponding national or regional publication shall be clearly
|
264
|
+
indicated in the latter.
|
265
|
+
</p>
|
266
|
+
</li>
|
267
|
+
<li>
|
268
|
+
<p id='_'>
|
269
|
+
IEC itself does not provide any attestation of conformity.
|
270
|
+
Independent certification bodies provide conformity assessment
|
271
|
+
services and, in some areas, access to IEC marks of conformity.
|
272
|
+
IEC is not responsible for any services carried out by independent
|
273
|
+
certification bodies.
|
274
|
+
</p>
|
275
|
+
</li>
|
276
|
+
<li>
|
277
|
+
<p id='_'>All users should ensure that they have the latest edition of this publication.</p>
|
278
|
+
</li>
|
279
|
+
<li>
|
280
|
+
<p id='_'>
|
281
|
+
No liability shall attach to IEC or its directors, employees,
|
282
|
+
servants or agents including individual experts and members of its
|
283
|
+
technical committees and IEC National Committees for any personal
|
284
|
+
injury, property damage or other damage of any nature whatsoever,
|
285
|
+
whether direct or indirect, or for costs (including legal fees)
|
286
|
+
and expenses arising out of the publication, use of, or reliance
|
287
|
+
upon, this IEC Publication or any other IEC Publications.
|
288
|
+
</p>
|
289
|
+
</li>
|
290
|
+
<li>
|
291
|
+
<p id='_'>
|
292
|
+
Attention is drawn to the Normative references cited in this
|
293
|
+
publication. Use of the referenced publications is indispensable
|
294
|
+
for the correct application of this publication.
|
295
|
+
</p>
|
296
|
+
</li>
|
297
|
+
<li>
|
298
|
+
<p id='_'>
|
299
|
+
Attention is drawn to the possibility that some of the elements of
|
300
|
+
this IEC Publication may be the subject of patent rights. IEC
|
301
|
+
shall not be held responsible for identifying any or all such
|
302
|
+
patent rights.
|
303
|
+
</p>
|
304
|
+
</li>
|
305
|
+
</ol>
|
306
|
+
</clause>
|
307
|
+
</legal-statement>
|
308
|
+
<license-statement>
|
309
|
+
<clause>
|
310
|
+
<p id='_'>
|
311
|
+
This document is still under study and subject to change. It should
|
312
|
+
not be used for reference purposes. until published as such.
|
313
|
+
</p>
|
314
|
+
<p id='_'>
|
315
|
+
Recipients of this document are invited to submit, with their
|
316
|
+
comments, notification of any relevant patent rights of which they are
|
317
|
+
aware and to provide supporting documentation.
|
318
|
+
</p>
|
319
|
+
</clause>
|
320
|
+
</license-statement>
|
321
|
+
<feedback-statement>
|
322
|
+
<clause id='boilerplate-cenelec-attention'>
|
323
|
+
<title>Attention IEC-CENELEC parallel voting</title>
|
324
|
+
<p id='_'>
|
325
|
+
The attention of IEC National Committees, members of CENELEC, is drawn
|
326
|
+
to the fact that this (NWIP) is submitted for parallel voting.
|
327
|
+
</p>
|
328
|
+
<p id='_'>The CENELEC members are invited to vote through the CENELEC voting system.</p>
|
329
|
+
</clause>
|
330
|
+
</feedback-statement>
|
331
|
+
</boilerplate>
|
332
|
+
<sections> </sections>
|
333
|
+
</iec-standard>
|
331
334
|
OUTPUT
|
335
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
336
|
+
.to be_equivalent_to xmlpp(output)
|
332
337
|
end
|
333
338
|
|
334
|
-
|
335
339
|
it "processes complex metadata" do
|
336
|
-
|
340
|
+
input = <<~INPUT
|
337
341
|
= Document title
|
338
342
|
Author
|
339
343
|
:docfile: test.adoc
|
@@ -352,239 +356,242 @@ end
|
|
352
356
|
:function: emc
|
353
357
|
:horizontal: true
|
354
358
|
INPUT
|
359
|
+
output = <<~OUTPUT
|
355
360
|
<?xml version="1.0" encoding="UTF-8"?>
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
<boilerplate>
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
361
|
+
<iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
|
362
|
+
<bibdata type='standard'>
|
363
|
+
<docidentifier type='ISO'>ISO/IEC/IETF/2CDTS 1000-1-1 ED 1</docidentifier>
|
364
|
+
<docidentifier type='iso-tc'>2000</docidentifier>
|
365
|
+
<docnumber>1000</docnumber>
|
366
|
+
<contributor>
|
367
|
+
<role type='author'/>
|
368
|
+
<organization>
|
369
|
+
<name>International Electrotechnical Commission</name>
|
370
|
+
<abbreviation>IEC</abbreviation>
|
371
|
+
</organization>
|
372
|
+
</contributor>
|
373
|
+
<contributor>
|
374
|
+
<role type='author'/>
|
375
|
+
<organization>
|
376
|
+
<name>IETF</name>
|
377
|
+
</organization>
|
378
|
+
</contributor>
|
379
|
+
<contributor>
|
380
|
+
<role type='author'/>
|
381
|
+
<organization>
|
382
|
+
<name>International Organization for Standardization</name>
|
383
|
+
<abbreviation>ISO</abbreviation>
|
384
|
+
</organization>
|
385
|
+
</contributor>
|
386
|
+
<contributor>
|
387
|
+
<role type='publisher'/>
|
388
|
+
<organization>
|
389
|
+
<name>International Electrotechnical Commission</name>
|
390
|
+
<abbreviation>IEC</abbreviation>
|
391
|
+
</organization>
|
392
|
+
</contributor>
|
393
|
+
<contributor>
|
394
|
+
<role type='publisher'/>
|
395
|
+
<organization>
|
396
|
+
<name>IETF</name>
|
397
|
+
</organization>
|
398
|
+
</contributor>
|
399
|
+
<contributor>
|
400
|
+
<role type='publisher'/>
|
401
|
+
<organization>
|
402
|
+
<name>International Organization for Standardization</name>
|
403
|
+
<abbreviation>ISO</abbreviation>
|
404
|
+
</organization>
|
405
|
+
</contributor>
|
406
|
+
<language>el</language>
|
407
|
+
<script>Grek</script>
|
408
|
+
<status>
|
409
|
+
<stage abbreviation='CD'>30</stage>
|
410
|
+
<substage abbreviation='A22CD'>99</substage>
|
411
|
+
<iteration>2</iteration>
|
412
|
+
</status>
|
413
|
+
<copyright>
|
414
|
+
<from>2001</from>
|
415
|
+
<owner>
|
416
|
+
<organization>
|
417
|
+
<name>International Electrotechnical Commission</name>
|
418
|
+
<abbreviation>IEC</abbreviation>
|
419
|
+
</organization>
|
420
|
+
</owner>
|
421
|
+
</copyright>
|
422
|
+
<copyright>
|
423
|
+
<from>2001</from>
|
424
|
+
<owner>
|
425
|
+
<organization>
|
426
|
+
<name>IETF</name>
|
427
|
+
</organization>
|
428
|
+
</owner>
|
429
|
+
</copyright>
|
430
|
+
<copyright>
|
431
|
+
<from>2001</from>
|
432
|
+
<owner>
|
433
|
+
<organization>
|
434
|
+
<name>International Organization for Standardization</name>
|
435
|
+
<abbreviation>ISO</abbreviation>
|
436
|
+
</organization>
|
437
|
+
</owner>
|
438
|
+
</copyright>
|
439
|
+
<ext>
|
440
|
+
<doctype>technical-specification</doctype>
|
441
|
+
<horizontal>true</horizontal>
|
442
|
+
<function>emc</function>
|
443
|
+
<editorialgroup>
|
444
|
+
<technical-committee/>
|
445
|
+
<subcommittee/>
|
446
|
+
<workgroup/>
|
447
|
+
</editorialgroup>
|
448
|
+
<structuredidentifier>
|
449
|
+
<project-number part='1' subpart='1'>ISO/IEC/IETF 1000</project-number>
|
450
|
+
</structuredidentifier>
|
451
|
+
<stagename>Committee draft</stagename>
|
452
|
+
</ext>
|
453
|
+
</bibdata>
|
454
|
+
<boilerplate>
|
455
|
+
<copyright-statement>
|
456
|
+
<clause>
|
457
|
+
<p id='_'>
|
458
|
+
<strong>Copyright © 2001 International Electrotechnical Commission, IEC.</strong>
|
459
|
+
All rights reserved. It is permitted to download this electronic
|
460
|
+
file, to make a copy and to print out the content for the sole purpose
|
461
|
+
of preparing National Committee positions. You may not copy or
|
462
|
+
“mirror” the file or printed version of the document, or
|
463
|
+
any part of it, for any other purpose without permission in writing
|
464
|
+
from IEC.
|
465
|
+
</p>
|
466
|
+
</clause>
|
467
|
+
</copyright-statement>
|
468
|
+
<legal-statement>
|
469
|
+
<clause>
|
470
|
+
<ol id='_'>
|
471
|
+
<li>
|
472
|
+
<p id='_'>
|
473
|
+
The International Electrotechnical Commission (IEC) is a worldwide
|
474
|
+
organization for standardization comprising all national
|
475
|
+
electrotechnical committees (IEC National Committees). The object
|
476
|
+
of IEC is to promote international co-operation on all questions
|
477
|
+
concerning standardization in the electrical and electronic
|
478
|
+
fields. To this end and in addition to other activities, IEC
|
479
|
+
publishes International Standards, Technical Specifications,
|
480
|
+
Technical Reports, Publicly Available Specifications (PAS) and
|
481
|
+
Guides (hereafter referred to as “IEC
|
482
|
+
Publication(s)”). Their preparation is entrusted to
|
483
|
+
technical committees; any IEC National Committee interested in the
|
484
|
+
subject dealt with may participate in this preparatory work.
|
485
|
+
International, governmental and non-governmental organizations
|
486
|
+
liaising with the IEC also participate in this preparation. IEC
|
487
|
+
collaborates closely with the International Organization for
|
488
|
+
Standardization (ISO) in accordance with conditions determined by
|
489
|
+
agreement between the two organizations.
|
490
|
+
</p>
|
491
|
+
</li>
|
492
|
+
<li>
|
493
|
+
<p id='_'>
|
494
|
+
The formal decisions or agreements of IEC on technical matters
|
495
|
+
express, as nearly as possible, an international consensus of
|
496
|
+
opinion on the relevant subjects since each technical committee
|
497
|
+
has representation from all interested IEC National Committees.
|
498
|
+
</p>
|
499
|
+
</li>
|
500
|
+
<li>
|
501
|
+
<p id='_'>
|
502
|
+
IEC Publications have the form of recommendations for
|
503
|
+
international use and are accepted by IEC National Committees in
|
504
|
+
that sense. While all reasonable efforts are made to ensure that
|
505
|
+
the technical content of IEC Publications is accurate, IEC cannot
|
506
|
+
be held responsible for the way in which they are used or for any
|
507
|
+
misinterpretation by any end user.
|
508
|
+
</p>
|
509
|
+
</li>
|
510
|
+
<li>
|
511
|
+
<p id='_'>
|
512
|
+
In order to promote international uniformity, IEC National
|
513
|
+
Committees undertake to apply IEC Publications transparently to
|
514
|
+
the maximum extent possible in their national and regional
|
515
|
+
publications. Any divergence between any IEC Publication and the
|
516
|
+
corresponding national or regional publication shall be clearly
|
517
|
+
indicated in the latter.
|
518
|
+
</p>
|
519
|
+
</li>
|
520
|
+
<li>
|
521
|
+
<p id='_'>
|
522
|
+
IEC itself does not provide any attestation of conformity.
|
523
|
+
Independent certification bodies provide conformity assessment
|
524
|
+
services and, in some areas, access to IEC marks of conformity.
|
525
|
+
IEC is not responsible for any services carried out by independent
|
526
|
+
certification bodies.
|
527
|
+
</p>
|
528
|
+
</li>
|
529
|
+
<li>
|
530
|
+
<p id='_'>All users should ensure that they have the latest edition of this publication.</p>
|
531
|
+
</li>
|
532
|
+
<li>
|
533
|
+
<p id='_'>
|
534
|
+
No liability shall attach to IEC or its directors, employees,
|
535
|
+
servants or agents including individual experts and members of its
|
536
|
+
technical committees and IEC National Committees for any personal
|
537
|
+
injury, property damage or other damage of any nature whatsoever,
|
538
|
+
whether direct or indirect, or for costs (including legal fees)
|
539
|
+
and expenses arising out of the publication, use of, or reliance
|
540
|
+
upon, this IEC Publication or any other IEC Publications.
|
541
|
+
</p>
|
542
|
+
</li>
|
543
|
+
<li>
|
544
|
+
<p id='_'>
|
545
|
+
Attention is drawn to the Normative references cited in this
|
546
|
+
publication. Use of the referenced publications is indispensable
|
547
|
+
for the correct application of this publication.
|
548
|
+
</p>
|
549
|
+
</li>
|
550
|
+
<li>
|
551
|
+
<p id='_'>
|
552
|
+
Attention is drawn to the possibility that some of the elements of
|
553
|
+
this IEC Publication may be the subject of patent rights. IEC
|
554
|
+
shall not be held responsible for identifying any or all such
|
555
|
+
patent rights.
|
556
|
+
</p>
|
557
|
+
</li>
|
558
|
+
</ol>
|
559
|
+
</clause>
|
560
|
+
</legal-statement>
|
561
|
+
<license-statement>
|
562
|
+
<clause>
|
563
|
+
<p id='_'>
|
564
|
+
This document is still under study and subject to change. It should
|
565
|
+
not be used for reference purposes. until published as such.
|
566
|
+
</p>
|
567
|
+
<p id='_'>
|
568
|
+
Recipients of this document are invited to submit, with their
|
569
|
+
comments, notification of any relevant patent rights of which they are
|
570
|
+
aware and to provide supporting documentation.
|
571
|
+
</p>
|
572
|
+
</clause>
|
573
|
+
</license-statement>
|
574
|
+
<feedback-statement>
|
575
|
+
<clause id='boilerplate-cenelec-attention'>
|
576
|
+
<title>Attention IEC-CENELEC parallel voting</title>
|
577
|
+
<p id='_'>
|
578
|
+
The attention of IEC National Committees, members of CENELEC, is drawn
|
579
|
+
to the fact that this Committee Draft (CD) is submitted for parallel
|
580
|
+
voting.
|
581
|
+
</p>
|
582
|
+
<p id='_'>The CENELEC members are invited to vote through the CENELEC voting system.</p>
|
583
|
+
</clause>
|
584
|
+
</feedback-statement>
|
585
|
+
</boilerplate>
|
586
|
+
<sections> </sections>
|
587
|
+
</iec-standard>
|
583
588
|
OUTPUT
|
589
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
590
|
+
.to be_equivalent_to xmlpp(output)
|
584
591
|
end
|
585
592
|
|
586
|
-
|
587
|
-
doc =
|
593
|
+
it "processes boilerplate in English" do
|
594
|
+
doc = strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS))
|
588
595
|
= Document title
|
589
596
|
Author
|
590
597
|
:docfile: test.adoc
|
@@ -601,10 +608,10 @@ end
|
|
601
608
|
INPUT
|
602
609
|
expect(doc).to include "including individual experts"
|
603
610
|
expect(doc).not_to include "y compris ses experts particuliers"
|
604
|
-
|
611
|
+
end
|
605
612
|
|
606
|
-
|
607
|
-
doc =
|
613
|
+
it "processes boilerplate in French" do
|
614
|
+
doc = strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS))
|
608
615
|
= Document title
|
609
616
|
Author
|
610
617
|
:docfile: test.adoc
|
@@ -621,10 +628,10 @@ end
|
|
621
628
|
INPUT
|
622
629
|
expect(doc).not_to include "including individual experts"
|
623
630
|
expect(doc).to include "y compris ses experts particuliers"
|
624
|
-
|
631
|
+
end
|
625
632
|
|
626
|
-
|
627
|
-
|
633
|
+
it "defaults substage" do
|
634
|
+
input = <<~INPUT
|
628
635
|
= Document title
|
629
636
|
Author
|
630
637
|
:docfile: test.adoc
|
@@ -634,199 +641,201 @@ end
|
|
634
641
|
:docnumber: 1000
|
635
642
|
:docstage: 50
|
636
643
|
INPUT
|
637
|
-
|
638
|
-
<
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
</bibdata>
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
<sections/>
|
824
|
-
</iec-standard>
|
825
|
-
OUTPUT
|
826
|
-
|
644
|
+
output = <<~OUTPUT
|
645
|
+
<iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
|
646
|
+
<bibdata type="standard">
|
647
|
+
<docidentifier type="ISO">IEC/FDIS 1000 ED 1</docidentifier>
|
648
|
+
<docnumber>1000</docnumber>
|
649
|
+
<contributor>
|
650
|
+
<role type="author"/>
|
651
|
+
<organization>
|
652
|
+
<name>International Electrotechnical Commission</name>
|
653
|
+
<abbreviation>IEC</abbreviation>
|
654
|
+
</organization>
|
655
|
+
</contributor>
|
656
|
+
<contributor>
|
657
|
+
<role type="publisher"/>
|
658
|
+
<organization>
|
659
|
+
<name>International Electrotechnical Commission</name>
|
660
|
+
<abbreviation>IEC</abbreviation>
|
661
|
+
</organization>
|
662
|
+
</contributor>
|
663
|
+
<language>en</language>
|
664
|
+
<script>Latn</script>
|
665
|
+
<status>
|
666
|
+
<stage abbreviation="FDIS">50</stage>
|
667
|
+
<substage abbreviation="RFDIS">00</substage>
|
668
|
+
</status>
|
669
|
+
<copyright>
|
670
|
+
<from>#{Date.today.year}</from>
|
671
|
+
<owner>
|
672
|
+
<organization>
|
673
|
+
<name>International Electrotechnical Commission</name>
|
674
|
+
<abbreviation>IEC</abbreviation>
|
675
|
+
</organization>
|
676
|
+
</owner>
|
677
|
+
</copyright>
|
678
|
+
<ext>
|
679
|
+
<doctype>article</doctype>
|
680
|
+
<horizontal>false</horizontal>
|
681
|
+
<editorialgroup>
|
682
|
+
<technical-committee/>
|
683
|
+
<subcommittee/>
|
684
|
+
<workgroup/>
|
685
|
+
</editorialgroup>
|
686
|
+
<structuredidentifier>
|
687
|
+
<project-number>IEC 1000</project-number>
|
688
|
+
</structuredidentifier>
|
689
|
+
<stagename>Final draft international standard</stagename>
|
690
|
+
</ext>
|
691
|
+
</bibdata>
|
692
|
+
<boilerplate>
|
693
|
+
<copyright-statement>
|
694
|
+
<clause>
|
695
|
+
<p id='_'>
|
696
|
+
<strong>Copyright © #{Time.now.year} International Electrotechnical Commission, IEC.</strong>
|
697
|
+
All rights reserved. It is permitted to download this electronic
|
698
|
+
file, to make a copy and to print out the content for the sole purpose
|
699
|
+
of preparing National Committee positions. You may not copy or
|
700
|
+
“mirror” the file or printed version of the document, or any part of
|
701
|
+
it, for any other purpose without permission in writing from IEC.
|
702
|
+
</p>
|
703
|
+
</clause>
|
704
|
+
</copyright-statement>
|
705
|
+
<legal-statement>
|
706
|
+
<clause>
|
707
|
+
<ol id='_'>
|
708
|
+
<li>
|
709
|
+
<p id='_'>
|
710
|
+
The International Electrotechnical Commission (IEC) is a worldwide
|
711
|
+
organization for standardization comprising all national
|
712
|
+
electrotechnical committees (IEC National Committees). The object
|
713
|
+
of IEC is to promote international co-operation on all questions
|
714
|
+
concerning standardization in the electrical and electronic
|
715
|
+
fields. To this end and in addition to other activities, IEC
|
716
|
+
publishes International Standards, Technical Specifications,
|
717
|
+
Technical Reports, Publicly Available Specifications (PAS) and
|
718
|
+
Guides (hereafter referred to as “IEC Publication(s)”). Their
|
719
|
+
preparation is entrusted to technical committees; any IEC National
|
720
|
+
Committee interested in the subject dealt with may participate in
|
721
|
+
this preparatory work. International, governmental and
|
722
|
+
non-governmental organizations liaising with the IEC also
|
723
|
+
participate in this preparation. IEC collaborates closely with the
|
724
|
+
International Organization for Standardization (ISO) in accordance
|
725
|
+
with conditions determined by agreement between the two
|
726
|
+
organizations.
|
727
|
+
</p>
|
728
|
+
</li>
|
729
|
+
<li>
|
730
|
+
<p id='_'>
|
731
|
+
The formal decisions or agreements of IEC on technical matters
|
732
|
+
express, as nearly as possible, an international consensus of
|
733
|
+
opinion on the relevant subjects since each technical committee
|
734
|
+
has representation from all interested IEC National Committees.
|
735
|
+
</p>
|
736
|
+
</li>
|
737
|
+
<li>
|
738
|
+
<p id='_'>
|
739
|
+
IEC Publications have the form of recommendations for
|
740
|
+
international use and are accepted by IEC National Committees in
|
741
|
+
that sense. While all reasonable efforts are made to ensure that
|
742
|
+
the technical content of IEC Publications is accurate, IEC cannot
|
743
|
+
be held responsible for the way in which they are used or for any
|
744
|
+
misinterpretation by any end user.
|
745
|
+
</p>
|
746
|
+
</li>
|
747
|
+
<li>
|
748
|
+
<p id='_'>
|
749
|
+
In order to promote international uniformity, IEC National
|
750
|
+
Committees undertake to apply IEC Publications transparently to
|
751
|
+
the maximum extent possible in their national and regional
|
752
|
+
publications. Any divergence between any IEC Publication and the
|
753
|
+
corresponding national or regional publication shall be clearly
|
754
|
+
indicated in the latter.
|
755
|
+
</p>
|
756
|
+
</li>
|
757
|
+
<li>
|
758
|
+
<p id='_'>
|
759
|
+
IEC itself does not provide any attestation of conformity.
|
760
|
+
Independent certification bodies provide conformity assessment
|
761
|
+
services and, in some areas, access to IEC marks of conformity.
|
762
|
+
IEC is not responsible for any services carried out by independent
|
763
|
+
certification bodies.
|
764
|
+
</p>
|
765
|
+
</li>
|
766
|
+
<li>
|
767
|
+
<p id='_'>All users should ensure that they have the latest edition of this publication.</p>
|
768
|
+
</li>
|
769
|
+
<li>
|
770
|
+
<p id='_'>
|
771
|
+
No liability shall attach to IEC or its directors, employees,
|
772
|
+
servants or agents including individual experts and members of its
|
773
|
+
technical committees and IEC National Committees for any personal
|
774
|
+
injury, property damage or other damage of any nature whatsoever,
|
775
|
+
whether direct or indirect, or for costs (including legal fees)
|
776
|
+
and expenses arising out of the publication, use of, or reliance
|
777
|
+
upon, this IEC Publication or any other IEC Publications.
|
778
|
+
</p>
|
779
|
+
</li>
|
780
|
+
<li>
|
781
|
+
<p id='_'>
|
782
|
+
Attention is drawn to the Normative references cited in this
|
783
|
+
publication. Use of the referenced publications is indispensable
|
784
|
+
for the correct application of this publication.
|
785
|
+
</p>
|
786
|
+
</li>
|
787
|
+
<li>
|
788
|
+
<p id='_'>
|
789
|
+
Attention is drawn to the possibility that some of the elements of
|
790
|
+
this IEC Publication may be the subject of patent rights. IEC
|
791
|
+
shall not be held responsible for identifying any or all such
|
792
|
+
patent rights.
|
793
|
+
</p>
|
794
|
+
</li>
|
795
|
+
</ol>
|
796
|
+
</clause>
|
797
|
+
</legal-statement>
|
798
|
+
<license-statement>
|
799
|
+
<clause>
|
800
|
+
<p id='_'>
|
801
|
+
This document is a draft distributed for approval. It may not be
|
802
|
+
referred to as an International Standard until published as such.
|
803
|
+
</p>
|
804
|
+
<p id='_'>
|
805
|
+
In addition to their evaluation as being acceptable for industrial,
|
806
|
+
technological, commercial and user purposes, Final Draft International
|
807
|
+
Standards may on occasion have to be considered in the light of their
|
808
|
+
potential to become standards to which reference may be made in
|
809
|
+
national regulations.
|
810
|
+
</p>
|
811
|
+
<p id='_'>
|
812
|
+
Recipients of this document are invited to submit, with their
|
813
|
+
comments, notification of any relevant patent rights of which they are
|
814
|
+
aware and to provide supporting documentation.
|
815
|
+
</p>
|
816
|
+
</clause>
|
817
|
+
</license-statement>
|
818
|
+
<feedback-statement>
|
819
|
+
<clause id='boilerplate-cenelec-attention'>
|
820
|
+
<title>Attention IEC-CENELEC parallel voting</title>
|
821
|
+
<p id='_'>
|
822
|
+
The attention of IEC National Committees, members of CENELEC, is drawn
|
823
|
+
to the fact that this Final Draft International Standard (FDIS) is
|
824
|
+
submitted for parallel voting.
|
825
|
+
</p>
|
826
|
+
<p id='_'>The CENELEC members are invited to vote through the CENELEC voting system.</p>
|
827
|
+
</clause>
|
828
|
+
</feedback-statement>
|
829
|
+
</boilerplate>
|
830
|
+
<sections/>
|
831
|
+
</iec-standard>
|
832
|
+
OUTPUT
|
833
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
834
|
+
.to be_equivalent_to xmlpp(output)
|
835
|
+
end
|
827
836
|
|
828
|
-
|
829
|
-
|
837
|
+
it "defaults substage for stage 60" do
|
838
|
+
input = <<~INPUT
|
830
839
|
= Document title
|
831
840
|
Author
|
832
841
|
:docfile: test.adoc
|
@@ -836,62 +845,64 @@ OUTPUT
|
|
836
845
|
:docnumber: 1000
|
837
846
|
:docstage: 60
|
838
847
|
INPUT
|
839
|
-
|
840
|
-
<
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
</bibdata>
|
887
|
-
#{boilerplate(Nokogiri::XML(BLANK_HDR +
|
888
|
-
<sections/>
|
889
|
-
</iec-standard>
|
890
|
-
OUTPUT
|
891
|
-
|
848
|
+
output = <<~OUTPUT
|
849
|
+
<iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
|
850
|
+
<bibdata type="standard">
|
851
|
+
<docidentifier type="ISO">IEC 1000 ED 1</docidentifier>
|
852
|
+
<docnumber>1000</docnumber>
|
853
|
+
<contributor>
|
854
|
+
<role type="author"/>
|
855
|
+
<organization>
|
856
|
+
<name>International Electrotechnical Commission</name>
|
857
|
+
<abbreviation>IEC</abbreviation>
|
858
|
+
</organization>
|
859
|
+
</contributor>
|
860
|
+
<contributor>
|
861
|
+
<role type="publisher"/>
|
862
|
+
<organization>
|
863
|
+
<name>International Electrotechnical Commission</name>
|
864
|
+
<abbreviation>IEC</abbreviation>
|
865
|
+
</organization>
|
866
|
+
</contributor>
|
867
|
+
<language>en</language>
|
868
|
+
<script>Latn</script>
|
869
|
+
<status>
|
870
|
+
<stage abbreviation="PPUB">60</stage>
|
871
|
+
<substage abbreviation="PPUB">60</substage>
|
872
|
+
</status>
|
873
|
+
<copyright>
|
874
|
+
<from>#{Date.today.year}</from>
|
875
|
+
<owner>
|
876
|
+
<organization>
|
877
|
+
<name>International Electrotechnical Commission</name>
|
878
|
+
<abbreviation>IEC</abbreviation>
|
879
|
+
</organization>
|
880
|
+
</owner>
|
881
|
+
</copyright>
|
882
|
+
<ext>
|
883
|
+
<doctype>article</doctype>
|
884
|
+
<horizontal>false</horizontal>
|
885
|
+
<editorialgroup>
|
886
|
+
<technical-committee/>
|
887
|
+
<subcommittee/>
|
888
|
+
<workgroup/>
|
889
|
+
</editorialgroup>
|
890
|
+
<structuredidentifier>
|
891
|
+
<project-number>IEC 1000</project-number>
|
892
|
+
</structuredidentifier>
|
893
|
+
<stagename>International standard</stagename>
|
894
|
+
</ext>
|
895
|
+
</bibdata>
|
896
|
+
#{boilerplate(Nokogiri::XML(BLANK_HDR + '</iec-standard>'))}
|
897
|
+
<sections/>
|
898
|
+
</iec-standard>
|
899
|
+
OUTPUT
|
900
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
901
|
+
.to be_equivalent_to xmlpp(output)
|
902
|
+
end
|
892
903
|
|
893
904
|
it "populates metadata for PRF" do
|
894
|
-
|
905
|
+
input = <<~INPUT
|
895
906
|
= Document title
|
896
907
|
Author
|
897
908
|
:docfile: test.adoc
|
@@ -902,64 +913,65 @@ OUTPUT
|
|
902
913
|
:docstage: 60
|
903
914
|
:docsubstage: 00
|
904
915
|
INPUT
|
905
|
-
|
906
|
-
<
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
</bibdata>
|
953
|
-
#{boilerplate(Nokogiri::XML(BLANK_HDR +
|
954
|
-
<sections/>
|
955
|
-
</iec-standard>
|
956
|
-
OUTPUT
|
957
|
-
|
958
|
-
|
916
|
+
output = <<~OUTPUT
|
917
|
+
<iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
|
918
|
+
<bibdata type="standard">
|
919
|
+
<docidentifier type="ISO">IEC 1000 ED 1</docidentifier>
|
920
|
+
<docnumber>1000</docnumber>
|
921
|
+
<contributor>
|
922
|
+
<role type="author"/>
|
923
|
+
<organization>
|
924
|
+
<name>International Electrotechnical Commission</name>
|
925
|
+
<abbreviation>IEC</abbreviation>
|
926
|
+
</organization>
|
927
|
+
</contributor>
|
928
|
+
<contributor>
|
929
|
+
<role type="publisher"/>
|
930
|
+
<organization>
|
931
|
+
<name>International Electrotechnical Commission</name>
|
932
|
+
<abbreviation>IEC</abbreviation>
|
933
|
+
</organization>
|
934
|
+
</contributor>
|
935
|
+
<language>en</language>
|
936
|
+
<script>Latn</script>
|
937
|
+
<status>
|
938
|
+
<stage abbreviation="PPUB">60</stage>
|
939
|
+
<substage abbreviation="BPUB">00</substage>
|
940
|
+
</status>
|
941
|
+
<copyright>
|
942
|
+
<from>#{Date.today.year}</from>
|
943
|
+
<owner>
|
944
|
+
<organization>
|
945
|
+
<name>International Electrotechnical Commission</name>
|
946
|
+
<abbreviation>IEC</abbreviation>
|
947
|
+
</organization>
|
948
|
+
</owner>
|
949
|
+
</copyright>
|
950
|
+
<ext>
|
951
|
+
<doctype>article</doctype>
|
952
|
+
<horizontal>false</horizontal>
|
953
|
+
<editorialgroup>
|
954
|
+
<technical-committee/>
|
955
|
+
<subcommittee/>
|
956
|
+
<workgroup/>
|
957
|
+
</editorialgroup>
|
958
|
+
<structuredidentifier>
|
959
|
+
<project-number>IEC 1000</project-number>
|
960
|
+
</structuredidentifier>
|
961
|
+
<stagename>International standard</stagename>
|
962
|
+
</ext>
|
963
|
+
</bibdata>
|
964
|
+
#{boilerplate(Nokogiri::XML(BLANK_HDR + '</iec-standard>'))}
|
965
|
+
<sections/>
|
966
|
+
</iec-standard>
|
967
|
+
OUTPUT
|
968
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
969
|
+
.to be_equivalent_to xmlpp(output)
|
970
|
+
end
|
959
971
|
|
960
972
|
it "reads scripts into blank HTML document" do
|
961
973
|
FileUtils.rm_f "test.html"
|
962
|
-
Asciidoctor.convert(<<~"INPUT",
|
974
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
963
975
|
= Document title
|
964
976
|
Author
|
965
977
|
:docfile: test.adoc
|
@@ -973,7 +985,7 @@ OUTPUT
|
|
973
985
|
|
974
986
|
it "uses default fonts" do
|
975
987
|
FileUtils.rm_f "test.html"
|
976
|
-
Asciidoctor.convert(<<~"INPUT",
|
988
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
977
989
|
= Document title
|
978
990
|
Author
|
979
991
|
:docfile: test.adoc
|
@@ -982,14 +994,17 @@ OUTPUT
|
|
982
994
|
:no-pdf:
|
983
995
|
INPUT
|
984
996
|
html = File.read("test.html", encoding: "utf-8")
|
985
|
-
expect(html)
|
986
|
-
|
987
|
-
expect(html)
|
997
|
+
expect(html)
|
998
|
+
.to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
|
999
|
+
expect(html)
|
1000
|
+
.to match(%r[blockquote[^{]+\{[^{]+font-family: "Arial", sans-serif;]m)
|
1001
|
+
expect(html)
|
1002
|
+
.to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Arial", sans-serif;]m)
|
988
1003
|
end
|
989
1004
|
|
990
1005
|
it "uses Chinese fonts" do
|
991
1006
|
FileUtils.rm_f "test.html"
|
992
|
-
Asciidoctor.convert(<<~"INPUT",
|
1007
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
993
1008
|
= Document title
|
994
1009
|
Author
|
995
1010
|
:docfile: test.adoc
|
@@ -999,14 +1014,17 @@ OUTPUT
|
|
999
1014
|
:no-pdf:
|
1000
1015
|
INPUT
|
1001
1016
|
html = File.read("test.html", encoding: "utf-8")
|
1002
|
-
expect(html)
|
1003
|
-
|
1004
|
-
expect(html)
|
1017
|
+
expect(html)
|
1018
|
+
.to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
|
1019
|
+
expect(html)
|
1020
|
+
.to match(%r[blockquote[^{]+\{[^{]+font-family: "Source Han Sans", serif;]m)
|
1021
|
+
expect(html)
|
1022
|
+
.to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Source Han Sans", sans-serif;]m)
|
1005
1023
|
end
|
1006
1024
|
|
1007
1025
|
it "uses specified fonts" do
|
1008
1026
|
FileUtils.rm_f "test.html"
|
1009
|
-
Asciidoctor.convert(<<~"INPUT",
|
1027
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1010
1028
|
= Document title
|
1011
1029
|
Author
|
1012
1030
|
:docfile: test.adoc
|
@@ -1020,14 +1038,15 @@ OUTPUT
|
|
1020
1038
|
INPUT
|
1021
1039
|
html = File.read("test.html", encoding: "utf-8")
|
1022
1040
|
expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: Andale Mono;]m)
|
1023
|
-
expect(html)
|
1041
|
+
expect(html)
|
1042
|
+
.to match(%r[blockquote[^{]+\{[^{]+font-family: Zapf Chancery;]m)
|
1024
1043
|
expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: Comic Sans;]m)
|
1025
1044
|
end
|
1026
1045
|
|
1027
1046
|
it "strips MS-specific CSS" do
|
1028
1047
|
FileUtils.rm_f "test.html"
|
1029
1048
|
FileUtils.rm_f "test.doc"
|
1030
|
-
Asciidoctor.convert(<<~"INPUT",
|
1049
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1031
1050
|
= Document title
|
1032
1051
|
Author
|
1033
1052
|
:docfile: test.adoc
|
@@ -1040,6 +1059,4 @@ OUTPUT
|
|
1040
1059
|
expect(word).to match(%r[mso-style-name: "Intro Title";]m)
|
1041
1060
|
expect(html).not_to match(%r[mso-style-name: "Intro Title";]m)
|
1042
1061
|
end
|
1043
|
-
|
1044
|
-
|
1045
1062
|
end
|