metanorma-iec 1.3.0 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,7 +16,7 @@ module IsoDoc
16
16
  unpublished(docstatus.text) and
17
17
  set(:stageabbr, docstatus["abbreviation"])
18
18
  end
19
- revdate = isoxml.at(ns("//version/revision-date"))
19
+ revdate = isoxml.at(ns("//bibdata/version/revision-date"))
20
20
  set(:revdate, revdate&.text)
21
21
  end
22
22
 
@@ -13,7 +13,7 @@ module IsoDoc
13
13
  super
14
14
  end
15
15
 
16
- def pdf_stylesheet(docxml)
16
+ def pdf_stylesheet(_docxml)
17
17
  "iec.international-standard.xsl"
18
18
  end
19
19
  end
@@ -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
- each do |f|
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(f)
20
- return clause1(f) unless @is_iev
21
- return if @suppressheadingnumbers || f["unnumbered"]
22
- lbl = @xrefs.anchor(f['id'], :label, true) or return
23
- prefix_name(f, " ", "#{lbl}#{clausedelim}", "title")
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(f)
27
- IsoDoc::PresentationXMLConvert.instance_method(:clause1).bind(self).
28
- call(f)
27
+ def clause1(elem)
28
+ IsoDoc::PresentationXMLConvert.instance_method(:clause1).bind(self)
29
+ .call(elem)
29
30
  end
30
31
 
31
- def bibdata_i18n(b)
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
- hash_translate(b, v[:i18n].get["doctype_dict"], "./ext/doctype", v[:lang])
36
- hash_translate(b, v[:i18n].get["stage_dict"], "./status/stage", v[:lang])
37
- hash_translate(b, v[:i18n].get["substage_dict"], "./status/substage", v[:lang])
38
- hash_translate(b, v[:i18n].get["function_dict"], "./ext/function", v[:lang])
39
- hash_translate(b, v[:i18n].get["horizontal_dict"], "./ext/horizontal", v[:lang])
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[:script] == "Hans" ? '"Source Han Sans",serif' : '"Arial",sans-serif'),
17
- headerfont: (options[:script] == "Hans" ? '"Source Han Sans",sans-serif' : '"Arial",sans-serif'),
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(options)
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}}) + WORD_TOC_SUFFIX1
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}}) + WORD_TOC_SUFFIX1
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'>&#xA0;</span>TOC
96
+ \\o &quot;1-#{level}&quot; \\h \\z \\u <span
97
+ style='mso-element:field-separator'></span></span>
98
+ TOC
83
99
  end
84
100
 
85
- def header_strip(h)
86
- h = h.to_s.gsub(/<\/?p[^>]*>/, "")
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(td, row, totalrows, header)
112
+ def make_tr_attr(cell, row, totalrows, header)
97
113
  ret = super
98
- css_class = (td.name == "th" || header) ? "TABLE-col-heading" : "TABLE-cell"
99
- ret.merge( "class": css_class )
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)]").each do |td|
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">&#xA0; </span>})
177
+ %{#{i + 1})<span style="mso-tab-count:1">&#xA0; </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 @class = 'boilerplate-feedback']")
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 word_cover(docxml)
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 |p|
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
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "1.3.0".freeze
3
+ VERSION = "1.3.5".freeze
4
4
  end
5
5
  end
6
6
 
@@ -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.4.0")
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
- RSpec.describe Asciidoctor::Iec do
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
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
27
- #{ASCIIDOC_BLANK_HDR}
16
+ input = <<~INPUT
17
+ #{ASCIIDOC_BLANK_HDR}
28
18
  INPUT
29
- #{@blank_hdr}
30
- <sections/>
31
- </iec-standard>
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
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
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
- #{@blank_hdr}
47
- <sections/>
48
- </iec-standard>
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
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
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
- <?xml version="1.0" encoding="UTF-8"?>
107
- <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
108
- <bibdata type="standard">
109
- <title language="en" format="text/plain" type="main">Introduction — Main Title — Title — Title Part</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">Introduction Française — Titre Principal — Part du Titre</title>
114
- <title language="fr" format="text/plain" type="title-intro">Introduction Française</title>
115
- <title language="fr" format="text/plain" type="title-main">Titre Principal</title>
116
- <title language="fr" format="text/plain" type="title-part">Part du Titre</title>
117
- <docidentifier type="ISO">IEC/3NWIP 1000-1 ED 2</docidentifier>
118
- <docnumber>1000</docnumber>
119
- <contributor>
120
- <role type="author"/>
121
- <organization>
122
- <name>International Electrotechnical Commission</name>
123
- <abbreviation>IEC</abbreviation>
124
- </organization>
125
- </contributor>
126
- <contributor>
127
- <role type="publisher"/>
128
- <organization>
129
- <name>International Electrotechnical Commission</name>
130
- <abbreviation>IEC</abbreviation>
131
- </organization>
132
- </contributor>
133
- <edition>2</edition>
134
- <version>
135
- <revision-date>2000-01-01</revision-date>
136
- <draft>0.3.4</draft>
137
- </version>
138
- <language>en</language>
139
- <script>Latn</script>
140
- <status>
141
- <stage abbreviation="NWIP">10</stage>
142
- <substage abbreviation="??">20</substage>
143
- <iteration>3</iteration>
144
- </status>
145
- <copyright>
146
- <from>#{Date.today.year}</from>
147
- <owner>
148
- <organization>
149
- <name>International Electrotechnical Commission</name>
150
- <abbreviation>IEC</abbreviation>
151
- </organization>
152
- </owner>
153
- </copyright>
154
- <relation type='obsoletes'>
155
- <bibitem>
156
- <title>--</title>
157
- <docidentifier>ABC</docidentifier>
158
- </bibitem>
159
- </relation>
160
- <relation type='obsoletes'>
161
- <bibitem>
162
- <title>--</title>
163
- <docidentifier>DEF</docidentifier>
164
- </bibitem>
165
- </relation>
166
- <ext>
167
- <doctype>article</doctype>
168
- <horizontal>false</horizontal>
169
- <editorialgroup>
170
- <technical-committee number="1" type="A">TC</technical-committee>
171
- <technical-committee number="11" type="A1">TC1</technical-committee>
172
- <subcommittee number="2" type="B">SC</subcommittee>
173
- <subcommittee number="21" type="B1">SC1</subcommittee>
174
- <workgroup number="3" type="C">WG</workgroup>
175
- <workgroup number="31" type="C1">WG1</workgroup>
176
- <secretariat>SECRETARIAT</secretariat>
177
- </editorialgroup>
178
- <ics>
179
- <code>1</code>
180
- </ics>
181
- <ics>
182
- <code>2</code>
183
- </ics>
184
- <ics>
185
- <code>3</code>
186
- </ics>
187
- <structuredidentifier>
188
- <project-number part="1">IEC 1000</project-number>
189
- </structuredidentifier>
190
- <stagename>New work item proposal</stagename>
191
- <accessibility-color-inside>true</accessibility-color-inside>
192
- <price-code>XC</price-code>
193
- <cen-processing>true</cen-processing>
194
- <secretary>Fred Nerk</secretary>
195
- <interest-to-committees>TC 6121, SC 12</interest-to-committees>
196
- </ext>
197
- </bibdata>
198
- <boilerplate>
199
- <copyright-statement>
200
- <clause>
201
- <p id='_'>
202
- <strong>Copyright © #{Time.now.year} International Electrotechnical Commission, IEC.</strong>
203
- All rights reserved. It is permitted to download this electronic
204
- file, to make a copy and to print out the content for the sole purpose
205
- of preparing National Committee positions. You may not copy or
206
- “mirror” the file or printed version of the document, or any part of
207
- it, for any other purpose without permission in writing from IEC.
208
- </p>
209
- </clause>
210
- </copyright-statement>
211
- <legal-statement>
212
- <clause>
213
- <ol id='_'>
214
- <li>
215
- <p id='_'>
216
- The International Electrotechnical Commission (IEC) is a worldwide
217
- organization for standardization comprising all national
218
- electrotechnical committees (IEC National Committees). The object
219
- of IEC is to promote international co-operation on all questions
220
- concerning standardization in the electrical and electronic
221
- fields. To this end and in addition to other activities, IEC
222
- publishes International Standards, Technical Specifications,
223
- Technical Reports, Publicly Available Specifications (PAS) and
224
- Guides (hereafter referred to as “IEC Publication(s)”). Their
225
- preparation is entrusted to technical committees; any IEC National
226
- Committee interested in the subject dealt with may participate in
227
- this preparatory work. International, governmental and
228
- non-governmental organizations liaising with the IEC also
229
- participate in this preparation. IEC collaborates closely with the
230
- International Organization for Standardization (ISO) in accordance
231
- with conditions determined by agreement between the two
232
- organizations.
233
- </p>
234
- </li>
235
- <li>
236
- <p id='_'>
237
- The formal decisions or agreements of IEC on technical matters
238
- express, as nearly as possible, an international consensus of
239
- opinion on the relevant subjects since each technical committee
240
- has representation from all interested IEC National Committees.
241
- </p>
242
- </li>
243
- <li>
244
- <p id='_'>
245
- IEC Publications have the form of recommendations for
246
- international use and are accepted by IEC National Committees in
247
- that sense. While all reasonable efforts are made to ensure that
248
- the technical content of IEC Publications is accurate, IEC cannot
249
- be held responsible for the way in which they are used or for any
250
- misinterpretation by any end user.
251
- </p>
252
- </li>
253
- <li>
254
- <p id='_'>
255
- In order to promote international uniformity, IEC National
256
- Committees undertake to apply IEC Publications transparently to
257
- the maximum extent possible in their national and regional
258
- publications. Any divergence between any IEC Publication and the
259
- corresponding national or regional publication shall be clearly
260
- indicated in the latter.
261
- </p>
262
- </li>
263
- <li>
264
- <p id='_'>
265
- IEC itself does not provide any attestation of conformity.
266
- Independent certification bodies provide conformity assessment
267
- services and, in some areas, access to IEC marks of conformity.
268
- IEC is not responsible for any services carried out by independent
269
- certification bodies.
270
- </p>
271
- </li>
272
- <li>
273
- <p id='_'>All users should ensure that they have the latest edition of this publication.</p>
274
- </li>
275
- <li>
276
- <p id='_'>
277
- No liability shall attach to IEC or its directors, employees,
278
- servants or agents including individual experts and members of its
279
- technical committees and IEC National Committees for any personal
280
- injury, property damage or other damage of any nature whatsoever,
281
- whether direct or indirect, or for costs (including legal fees)
282
- and expenses arising out of the publication, use of, or reliance
283
- upon, this IEC Publication or any other IEC Publications.
284
- </p>
285
- </li>
286
- <li>
287
- <p id='_'>
288
- Attention is drawn to the Normative references cited in this
289
- publication. Use of the referenced publications is indispensable
290
- for the correct application of this publication.
291
- </p>
292
- </li>
293
- <li>
294
- <p id='_'>
295
- Attention is drawn to the possibility that some of the elements of
296
- this IEC Publication may be the subject of patent rights. IEC
297
- shall not be held responsible for identifying any or all such
298
- patent rights.
299
- </p>
300
- </li>
301
- </ol>
302
- </clause>
303
- </legal-statement>
304
- <license-statement>
305
- <clause>
306
- <p id='_'>
307
- This document is still under study and subject to change. It should
308
- not be used for reference purposes.
309
- </p>
310
- until published as such.
311
- <p id='_'>
312
- Recipients of this document are invited to submit, with their
313
- comments, notification of any relevant patent rights of which they are
314
- aware and to provide supporting documentation.
315
- </p>
316
- </clause>
317
- </license-statement>
318
- <feedback-statement>
319
- <clause id='boilerplate-cenelec-attention'>
320
- <title>Attention IEC-CENELEC parallel voting</title>
321
- <p id='_'>
322
- The attention of IEC National Committees, members of CENELEC, is drawn
323
- to the fact that this (NWIP) is submitted for parallel voting.
324
- </p>
325
- <p id='_'>The CENELEC members are invited to vote through the CENELEC voting system.</p>
326
- </clause>
327
- </feedback-statement>
328
- </boilerplate>
329
- <sections/>
330
- </iec-standard>
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&#8201;&#8212;&#8201;Main
108
+ Title&#8201;&#8212;&#8201;Title&#8201;&#8212;&#8201;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&#8201;&#8212;&#8201;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&#231;aise&#8201;&#8212;&#8201;Titre
115
+ Principal&#8201;&#8212;&#8201;Part du Titre
116
+ </title>
117
+ <title language='fr' format='text/plain' type='title-intro'>Introduction Fran&#231;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 &#169; #{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
+ &#8220;mirror&#8221; 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 &#8220;IEC
229
+ Publication(s)&#8221;). 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
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
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
- <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
357
- <bibdata type="standard">
358
- <docidentifier type="ISO">ISO/IEC/IETF/2CDTS 1000-1-1 ED 1</docidentifier>
359
- <docidentifier type="iso-tc">2000</docidentifier>
360
- <docnumber>1000</docnumber>
361
- <contributor>
362
- <role type="author"/>
363
- <organization>
364
- <name>International Electrotechnical Commission</name>
365
- <abbreviation>IEC</abbreviation>
366
- </organization>
367
- </contributor>
368
- <contributor>
369
- <role type="author"/>
370
- <organization>
371
- <name>IETF</name>
372
- </organization>
373
- </contributor>
374
- <contributor>
375
- <role type="author"/>
376
- <organization>
377
- <name>International Organization for Standardization</name>
378
- <abbreviation>ISO</abbreviation>
379
- </organization>
380
- </contributor>
381
- <contributor>
382
- <role type="publisher"/>
383
- <organization>
384
- <name>International Electrotechnical Commission</name>
385
- <abbreviation>IEC</abbreviation>
386
- </organization>
387
- </contributor>
388
- <contributor>
389
- <role type="publisher"/>
390
- <organization>
391
- <name>IETF</name>
392
- </organization>
393
- </contributor>
394
- <contributor>
395
- <role type="publisher"/>
396
- <organization>
397
- <name>International Organization for Standardization</name>
398
- <abbreviation>ISO</abbreviation>
399
- </organization>
400
- </contributor>
401
- <language>el</language>
402
- <script>Grek</script>
403
- <status>
404
- <stage abbreviation="CD">30</stage>
405
- <substage abbreviation="A22CD">99</substage>
406
- <iteration>2</iteration>
407
- </status>
408
- <copyright>
409
- <from>2001</from>
410
- <owner>
411
- <organization>
412
- <name>International Electrotechnical Commission</name>
413
- <abbreviation>IEC</abbreviation>
414
- </organization>
415
- </owner>
416
- </copyright>
417
- <copyright>
418
- <from>2001</from>
419
- <owner>
420
- <organization>
421
- <name>IETF</name>
422
- </organization>
423
- </owner>
424
- </copyright>
425
- <copyright>
426
- <from>2001</from>
427
- <owner>
428
- <organization>
429
- <name>International Organization for Standardization</name>
430
- <abbreviation>ISO</abbreviation>
431
- </organization>
432
- </owner>
433
- </copyright>
434
- <ext>
435
- <doctype>technical-specification</doctype>
436
- <horizontal>true</horizontal>
437
- <function>emc</function>
438
- <editorialgroup>
439
- <technical-committee/>
440
- <subcommittee/>
441
- <workgroup/>
442
- </editorialgroup>
443
- <structuredidentifier>
444
- <project-number part="1" subpart="1">ISO/IEC/IETF 1000</project-number>
445
- </structuredidentifier>
446
- <stagename>Committee draft</stagename>
447
- </ext>
448
- </bibdata>
449
- <boilerplate>
450
- <copyright-statement>
451
- <clause>
452
- <p id='_'>
453
- <strong>Copyright © 2001 International Electrotechnical Commission, IEC.</strong>
454
- All rights reserved. It is permitted to download this electronic
455
- file, to make a copy and to print out the content for the sole purpose
456
- of preparing National Committee positions. You may not copy or
457
- mirror the file or printed version of the document, or any part of
458
- it, for any other purpose without permission in writing from IEC.
459
- </p>
460
- </clause>
461
- </copyright-statement>
462
- <legal-statement>
463
- <clause>
464
- <ol id='_'>
465
- <li>
466
- <p id='_'>
467
- The International Electrotechnical Commission (IEC) is a worldwide
468
- organization for standardization comprising all national
469
- electrotechnical committees (IEC National Committees). The object
470
- of IEC is to promote international co-operation on all questions
471
- concerning standardization in the electrical and electronic
472
- fields. To this end and in addition to other activities, IEC
473
- publishes International Standards, Technical Specifications,
474
- Technical Reports, Publicly Available Specifications (PAS) and
475
- Guides (hereafter referred to as “IEC Publication(s)”). Their
476
- preparation is entrusted to technical committees; any IEC National
477
- Committee interested in the subject dealt with may participate in
478
- this preparatory work. International, governmental and
479
- non-governmental organizations liaising with the IEC also
480
- participate in this preparation. IEC collaborates closely with the
481
- International Organization for Standardization (ISO) in accordance
482
- with conditions determined by agreement between the two
483
- organizations.
484
- </p>
485
- </li>
486
- <li>
487
- <p id='_'>
488
- The formal decisions or agreements of IEC on technical matters
489
- express, as nearly as possible, an international consensus of
490
- opinion on the relevant subjects since each technical committee
491
- has representation from all interested IEC National Committees.
492
- </p>
493
- </li>
494
- <li>
495
- <p id='_'>
496
- IEC Publications have the form of recommendations for
497
- international use and are accepted by IEC National Committees in
498
- that sense. While all reasonable efforts are made to ensure that
499
- the technical content of IEC Publications is accurate, IEC cannot
500
- be held responsible for the way in which they are used or for any
501
- misinterpretation by any end user.
502
- </p>
503
- </li>
504
- <li>
505
- <p id='_'>
506
- In order to promote international uniformity, IEC National
507
- Committees undertake to apply IEC Publications transparently to
508
- the maximum extent possible in their national and regional
509
- publications. Any divergence between any IEC Publication and the
510
- corresponding national or regional publication shall be clearly
511
- indicated in the latter.
512
- </p>
513
- </li>
514
- <li>
515
- <p id='_'>
516
- IEC itself does not provide any attestation of conformity.
517
- Independent certification bodies provide conformity assessment
518
- services and, in some areas, access to IEC marks of conformity.
519
- IEC is not responsible for any services carried out by independent
520
- certification bodies.
521
- </p>
522
- </li>
523
- <li>
524
- <p id='_'>All users should ensure that they have the latest edition of this publication.</p>
525
- </li>
526
- <li>
527
- <p id='_'>
528
- No liability shall attach to IEC or its directors, employees,
529
- servants or agents including individual experts and members of its
530
- technical committees and IEC National Committees for any personal
531
- injury, property damage or other damage of any nature whatsoever,
532
- whether direct or indirect, or for costs (including legal fees)
533
- and expenses arising out of the publication, use of, or reliance
534
- upon, this IEC Publication or any other IEC Publications.
535
- </p>
536
- </li>
537
- <li>
538
- <p id='_'>
539
- Attention is drawn to the Normative references cited in this
540
- publication. Use of the referenced publications is indispensable
541
- for the correct application of this publication.
542
- </p>
543
- </li>
544
- <li>
545
- <p id='_'>
546
- Attention is drawn to the possibility that some of the elements of
547
- this IEC Publication may be the subject of patent rights. IEC
548
- shall not be held responsible for identifying any or all such
549
- patent rights.
550
- </p>
551
- </li>
552
- </ol>
553
- </clause>
554
- </legal-statement>
555
- <license-statement>
556
- <clause>
557
- <p id='_'>
558
- This document is still under study and subject to change. It should
559
- not be used for reference purposes.
560
- </p>
561
- until published as such.
562
- <p id='_'>
563
- Recipients of this document are invited to submit, with their
564
- comments, notification of any relevant patent rights of which they are
565
- aware and to provide supporting documentation.
566
- </p>
567
- </clause>
568
- </license-statement>
569
- <feedback-statement>
570
- <clause id='boilerplate-cenelec-attention'>
571
- <title>Attention IEC-CENELEC parallel voting</title>
572
- <p id='_'>
573
- The attention of IEC National Committees, members of CENELEC, is drawn
574
- to the fact that this Committee Draft (CD) is submitted for parallel
575
- voting.
576
- </p>
577
- <p id='_'>The CENELEC members are invited to vote through the CENELEC voting system.</p>
578
- </clause>
579
- </feedback-statement>
580
- </boilerplate>
581
- <sections/>
582
- </iec-standard>
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 &#169; 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
+ &#8220;mirror&#8221; 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 &#8220;IEC
482
+ Publication(s)&#8221;). 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
- it "processes boilerplate in English" do
587
- doc = (strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))
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
- end
611
+ end
605
612
 
606
- it "processes boilerplate in French" do
607
- doc = (strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))
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
- end
631
+ end
625
632
 
626
- it "defaults substage" do
627
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
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
- <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
638
- <bibdata type="standard">
639
- <docidentifier type="ISO">IEC/FDIS 1000 ED 1</docidentifier>
640
- <docnumber>1000</docnumber>
641
- <contributor>
642
- <role type="author"/>
643
- <organization>
644
- <name>International Electrotechnical Commission</name>
645
- <abbreviation>IEC</abbreviation>
646
- </organization>
647
- </contributor>
648
- <contributor>
649
- <role type="publisher"/>
650
- <organization>
651
- <name>International Electrotechnical Commission</name>
652
- <abbreviation>IEC</abbreviation>
653
- </organization>
654
- </contributor>
655
-
656
- <language>en</language>
657
- <script>Latn</script>
658
- <status>
659
- <stage abbreviation="FDIS">50</stage>
660
- <substage abbreviation="RFDIS">00</substage>
661
- </status>
662
- <copyright>
663
- <from>#{Date.today.year}</from>
664
- <owner>
665
- <organization>
666
- <name>International Electrotechnical Commission</name>
667
- <abbreviation>IEC</abbreviation>
668
- </organization>
669
- </owner>
670
- </copyright>
671
- <ext>
672
- <doctype>article</doctype>
673
- <horizontal>false</horizontal>
674
- <editorialgroup>
675
- <technical-committee/>
676
- <subcommittee/>
677
- <workgroup/>
678
- </editorialgroup>
679
- <structuredidentifier>
680
- <project-number>IEC 1000</project-number>
681
- </structuredidentifier>
682
- <stagename>Final draft international standard</stagename>
683
- </ext>
684
- </bibdata>
685
- <boilerplate>
686
- <copyright-statement>
687
- <clause>
688
- <p id='_'>
689
- <strong>Copyright © #{Time.now.year} International Electrotechnical Commission, IEC.</strong>
690
- All rights reserved. It is permitted to download this electronic
691
- file, to make a copy and to print out the content for the sole purpose
692
- of preparing National Committee positions. You may not copy or
693
- “mirror” the file or printed version of the document, or any part of
694
- it, for any other purpose without permission in writing from IEC.
695
- </p>
696
- </clause>
697
- </copyright-statement>
698
- <legal-statement>
699
- <clause>
700
- <ol id='_'>
701
- <li>
702
- <p id='_'>
703
- The International Electrotechnical Commission (IEC) is a worldwide
704
- organization for standardization comprising all national
705
- electrotechnical committees (IEC National Committees). The object
706
- of IEC is to promote international co-operation on all questions
707
- concerning standardization in the electrical and electronic
708
- fields. To this end and in addition to other activities, IEC
709
- publishes International Standards, Technical Specifications,
710
- Technical Reports, Publicly Available Specifications (PAS) and
711
- Guides (hereafter referred to as “IEC Publication(s)”). Their
712
- preparation is entrusted to technical committees; any IEC National
713
- Committee interested in the subject dealt with may participate in
714
- this preparatory work. International, governmental and
715
- non-governmental organizations liaising with the IEC also
716
- participate in this preparation. IEC collaborates closely with the
717
- International Organization for Standardization (ISO) in accordance
718
- with conditions determined by agreement between the two
719
- organizations.
720
- </p>
721
- </li>
722
- <li>
723
- <p id='_'>
724
- The formal decisions or agreements of IEC on technical matters
725
- express, as nearly as possible, an international consensus of
726
- opinion on the relevant subjects since each technical committee
727
- has representation from all interested IEC National Committees.
728
- </p>
729
- </li>
730
- <li>
731
- <p id='_'>
732
- IEC Publications have the form of recommendations for
733
- international use and are accepted by IEC National Committees in
734
- that sense. While all reasonable efforts are made to ensure that
735
- the technical content of IEC Publications is accurate, IEC cannot
736
- be held responsible for the way in which they are used or for any
737
- misinterpretation by any end user.
738
- </p>
739
- </li>
740
- <li>
741
- <p id='_'>
742
- In order to promote international uniformity, IEC National
743
- Committees undertake to apply IEC Publications transparently to
744
- the maximum extent possible in their national and regional
745
- publications. Any divergence between any IEC Publication and the
746
- corresponding national or regional publication shall be clearly
747
- indicated in the latter.
748
- </p>
749
- </li>
750
- <li>
751
- <p id='_'>
752
- IEC itself does not provide any attestation of conformity.
753
- Independent certification bodies provide conformity assessment
754
- services and, in some areas, access to IEC marks of conformity.
755
- IEC is not responsible for any services carried out by independent
756
- certification bodies.
757
- </p>
758
- </li>
759
- <li>
760
- <p id='_'>All users should ensure that they have the latest edition of this publication.</p>
761
- </li>
762
- <li>
763
- <p id='_'>
764
- No liability shall attach to IEC or its directors, employees,
765
- servants or agents including individual experts and members of its
766
- technical committees and IEC National Committees for any personal
767
- injury, property damage or other damage of any nature whatsoever,
768
- whether direct or indirect, or for costs (including legal fees)
769
- and expenses arising out of the publication, use of, or reliance
770
- upon, this IEC Publication or any other IEC Publications.
771
- </p>
772
- </li>
773
- <li>
774
- <p id='_'>
775
- Attention is drawn to the Normative references cited in this
776
- publication. Use of the referenced publications is indispensable
777
- for the correct application of this publication.
778
- </p>
779
- </li>
780
- <li>
781
- <p id='_'>
782
- Attention is drawn to the possibility that some of the elements of
783
- this IEC Publication may be the subject of patent rights. IEC
784
- shall not be held responsible for identifying any or all such
785
- patent rights.
786
- </p>
787
- </li>
788
- </ol>
789
- </clause>
790
- </legal-statement>
791
- <license-statement>
792
- <clause>
793
- <p id='_'>
794
- This document is a draft distributed for approval. It may not be
795
- referred to as an International Standard until published as such.
796
- </p>
797
- <p id='_'>
798
- In addition to their evaluation as being acceptable for industrial,
799
- technological, commercial and user purposes, Final Draft International
800
- Standards may on occasion have to be considered in the light of their
801
- potential to become standards to which reference may be made in
802
- national regulations.
803
- </p>
804
- <p id='_'>
805
- Recipients of this document are invited to submit, with their
806
- comments, notification of any relevant patent rights of which they are
807
- aware and to provide supporting documentation.
808
- </p>
809
- </clause>
810
- </license-statement>
811
- <feedback-statement>
812
- <clause id='boilerplate-cenelec-attention'>
813
- <title>Attention IEC-CENELEC parallel voting</title>
814
- <p id='_'>
815
- The attention of IEC National Committees, members of CENELEC, is drawn
816
- to the fact that this Final Draft International Standard (FDIS) is
817
- submitted for parallel voting.
818
- </p>
819
- <p id='_'>The CENELEC members are invited to vote through the CENELEC voting system.</p>
820
- </clause>
821
- </feedback-statement>
822
- </boilerplate>
823
- <sections/>
824
- </iec-standard>
825
- OUTPUT
826
- end
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
- it "defaults substage for stage 60" do
829
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
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
- <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
840
- <bibdata type="standard">
841
- <docidentifier type="ISO">IEC 1000 ED 1</docidentifier>
842
- <docnumber>1000</docnumber>
843
- <contributor>
844
- <role type="author"/>
845
- <organization>
846
- <name>International Electrotechnical Commission</name>
847
- <abbreviation>IEC</abbreviation>
848
- </organization>
849
- </contributor>
850
- <contributor>
851
- <role type="publisher"/>
852
- <organization>
853
- <name>International Electrotechnical Commission</name>
854
- <abbreviation>IEC</abbreviation>
855
- </organization>
856
- </contributor>
857
-
858
- <language>en</language>
859
- <script>Latn</script>
860
- <status>
861
- <stage abbreviation="PPUB">60</stage>
862
- <substage abbreviation="PPUB">60</substage>
863
- </status>
864
- <copyright>
865
- <from>#{Date.today.year}</from>
866
- <owner>
867
- <organization>
868
- <name>International Electrotechnical Commission</name>
869
- <abbreviation>IEC</abbreviation>
870
- </organization>
871
- </owner>
872
- </copyright>
873
- <ext>
874
- <doctype>article</doctype>
875
- <horizontal>false</horizontal>
876
- <editorialgroup>
877
- <technical-committee/>
878
- <subcommittee/>
879
- <workgroup/>
880
- </editorialgroup>
881
- <structuredidentifier>
882
- <project-number>IEC 1000</project-number>
883
- </structuredidentifier>
884
- <stagename>International standard</stagename>
885
- </ext>
886
- </bibdata>
887
- #{boilerplate(Nokogiri::XML(BLANK_HDR + "</iec-standard>"))}
888
- <sections/>
889
- </iec-standard>
890
- OUTPUT
891
- end
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
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
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
- <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
906
- <bibdata type="standard">
907
- <docidentifier type="ISO">IEC 1000 ED 1</docidentifier>
908
- <docnumber>1000</docnumber>
909
- <contributor>
910
- <role type="author"/>
911
- <organization>
912
- <name>International Electrotechnical Commission</name>
913
- <abbreviation>IEC</abbreviation>
914
- </organization>
915
- </contributor>
916
- <contributor>
917
- <role type="publisher"/>
918
- <organization>
919
- <name>International Electrotechnical Commission</name>
920
- <abbreviation>IEC</abbreviation>
921
- </organization>
922
- </contributor>
923
-
924
- <language>en</language>
925
- <script>Latn</script>
926
- <status>
927
- <stage abbreviation="PPUB">60</stage>
928
- <substage abbreviation="BPUB">00</substage>
929
- </status>
930
- <copyright>
931
- <from>#{Date.today.year}</from>
932
- <owner>
933
- <organization>
934
- <name>International Electrotechnical Commission</name>
935
- <abbreviation>IEC</abbreviation>
936
- </organization>
937
- </owner>
938
- </copyright>
939
- <ext>
940
- <doctype>article</doctype>
941
- <horizontal>false</horizontal>
942
- <editorialgroup>
943
- <technical-committee/>
944
- <subcommittee/>
945
- <workgroup/>
946
- </editorialgroup>
947
- <structuredidentifier>
948
- <project-number>IEC 1000</project-number>
949
- </structuredidentifier>
950
- <stagename>International standard</stagename>
951
- </ext>
952
- </bibdata>
953
- #{boilerplate(Nokogiri::XML(BLANK_HDR + "</iec-standard>"))}
954
- <sections/>
955
- </iec-standard>
956
- OUTPUT
957
- end
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", backend: :iec, header_footer: true)
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", backend: :iec, header_footer: true)
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).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
986
- expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "Arial", sans-serif;]m)
987
- expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Arial", sans-serif;]m)
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", backend: :iec, header_footer: true)
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).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
1003
- expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "Source Han Sans", serif;]m)
1004
- expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Source Han Sans", sans-serif;]m)
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", backend: :iec, header_footer: true)
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).to match(%r[blockquote[^{]+\{[^{]+font-family: Zapf Chancery;]m)
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", backend: :iec, header_footer: true)
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