metanorma-iso 1.5.8 → 1.5.13

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.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +66 -0
  3. data/README.adoc +5 -6
  4. data/lib/asciidoctor/iso/base.rb +5 -0
  5. data/lib/asciidoctor/iso/basicdoc.rng +4 -11
  6. data/lib/asciidoctor/iso/boilerplate-fr.xml +40 -0
  7. data/lib/asciidoctor/iso/boilerplate.xml +1 -0
  8. data/lib/asciidoctor/iso/cleanup.rb +38 -0
  9. data/lib/asciidoctor/iso/front.rb +14 -15
  10. data/lib/asciidoctor/iso/isodoc.rng +27 -50
  11. data/lib/asciidoctor/iso/isostandard.rng +16 -1
  12. data/lib/asciidoctor/iso/validate.rb +1 -1
  13. data/lib/asciidoctor/iso/validate_section.rb +9 -0
  14. data/lib/isodoc/iso/base_convert.rb +2 -1
  15. data/lib/isodoc/iso/html/header.html +12 -24
  16. data/lib/isodoc/iso/html/htmlstyle.css +1 -1
  17. data/lib/isodoc/iso/html/htmlstyle.scss +1 -1
  18. data/lib/isodoc/iso/html/isodoc.css +42 -42
  19. data/lib/isodoc/iso/html/isodoc.scss +42 -42
  20. data/lib/isodoc/iso/html/style-human.css +14 -10
  21. data/lib/isodoc/iso/html/style-human.scss +7 -7
  22. data/lib/isodoc/iso/html/style-iso.css +12 -8
  23. data/lib/isodoc/iso/html/style-iso.scss +5 -5
  24. data/lib/isodoc/iso/html/wordstyle.css +67 -67
  25. data/lib/isodoc/iso/html/wordstyle.scss +67 -67
  26. data/lib/isodoc/iso/html_convert.rb +4 -0
  27. data/lib/isodoc/iso/i18n-en.yaml +4 -0
  28. data/lib/isodoc/iso/i18n-fr.yaml +5 -0
  29. data/lib/isodoc/iso/i18n-zh-Hans.yaml +5 -0
  30. data/lib/isodoc/iso/i18n.rb +10 -11
  31. data/lib/isodoc/iso/iso.amendment.xsl +739 -141
  32. data/lib/isodoc/iso/iso.international-standard.xsl +739 -141
  33. data/lib/isodoc/iso/metadata.rb +20 -19
  34. data/lib/isodoc/iso/word_convert.rb +4 -0
  35. data/lib/isodoc/iso/xref.rb +10 -0
  36. data/lib/metanorma/iso/fonts_manifest.yaml +6 -0
  37. data/lib/metanorma/iso/processor.rb +0 -9
  38. data/lib/metanorma/iso/version.rb +1 -1
  39. data/metanorma-iso.gemspec +2 -2
  40. data/spec/asciidoctor-iso/amd_spec.rb +7 -7
  41. data/spec/asciidoctor-iso/base_spec.rb +146 -18
  42. data/spec/asciidoctor-iso/blocks_spec.rb +1 -1
  43. data/spec/asciidoctor-iso/cleanup_spec.rb +4 -4
  44. data/spec/asciidoctor-iso/lists_spec.rb +6 -6
  45. data/spec/asciidoctor-iso/refs_spec.rb +174 -143
  46. data/spec/asciidoctor-iso/section_spec.rb +5 -0
  47. data/spec/asciidoctor-iso/validate_spec.rb +52 -15
  48. data/spec/assets/xref_error.adoc +7 -0
  49. data/spec/isodoc/amd_spec.rb +191 -17
  50. data/spec/isodoc/blocks_spec.rb +2 -1
  51. data/spec/isodoc/i18n_spec.rb +13 -13
  52. data/spec/isodoc/inline_spec.rb +2 -2
  53. data/spec/isodoc/iso_spec.rb +2 -2
  54. data/spec/isodoc/metadata_spec.rb +172 -19
  55. data/spec/isodoc/postproc_spec.rb +3 -3
  56. data/spec/isodoc/ref_spec.rb +5 -5
  57. data/spec/isodoc/section_spec.rb +22 -2
  58. data/spec/isodoc/table_spec.rb +1 -1
  59. data/spec/isodoc/terms_spec.rb +1 -1
  60. data/spec/isodoc/xref_spec.rb +23 -11
  61. data/spec/metanorma/processor_spec.rb +1 -1
  62. data/spec/spec_helper.rb +22 -2
  63. metadata +10 -9
  64. data/.github/workflows/macos.yml +0 -41
  65. data/.github/workflows/ubuntu.yml +0 -45
  66. data/.github/workflows/windows.yml +0 -43
@@ -5,15 +5,13 @@ module IsoDoc
5
5
  class Metadata < IsoDoc::Metadata
6
6
  def initialize(lang, script, i18n)
7
7
  super
8
- @metadata = {
9
- tc: "XXXX",
10
- sc: "XXXX",
11
- wg: "XXXX",
12
- editorialgroup: [],
13
- secretariat: "XXXX",
14
- obsoletes: nil,
15
- obsoletes_part: nil
16
- }
8
+ set(:tc, "XXXX")
9
+ set(:sc, "XXXX")
10
+ set(:wg, "XXXX")
11
+ set(:editorialgroup, [])
12
+ set(:secretariat, "XXX")
13
+ set(:obsoletes, nil)
14
+ set(:obsoletes_part, nil)
17
15
  end
18
16
 
19
17
  def status_abbrev(stage, substage, iter, draft, doctype)
@@ -133,33 +131,35 @@ module IsoDoc
133
131
  end
134
132
 
135
133
  def title(isoxml, _out)
136
- intro, main, part, amd = title_parts(isoxml, "en")
134
+ lang = @lang == "fr" ? "fr" : "en"
135
+ intro, main, part, amd = title_parts(isoxml, lang)
137
136
  partnumber, subpartnumber, amdnumber, corrnumber = title_nums(isoxml)
138
137
 
139
138
  set(:doctitlemain, @c.encode(main ? main.text : "", :hexadecimal))
140
- main = compose_title(main, intro, part, partnumber, subpartnumber, "en")
139
+ main = compose_title(main, intro, part, partnumber, subpartnumber, lang)
141
140
  set(:doctitle, main)
142
141
  set(:doctitleintro, @c.encode(intro ? intro.text : "", :hexadecimal)) if intro
143
- set(:doctitlepartlabel, part_prefix(partnumber, subpartnumber, "en"))
142
+ set(:doctitlepartlabel, part_prefix(partnumber, subpartnumber, lang))
144
143
  set(:doctitlepart, @c.encode(part.text, :hexadecimal)) if part
145
- set(:doctitleamdlabel, amd_prefix(amdnumber, "en")) if amdnumber
144
+ set(:doctitleamdlabel, amd_prefix(amdnumber, lang)) if amdnumber
146
145
  set(:doctitleamd, @c.encode(amd.text, :hexadecimal)) if amd
147
- set(:doctitlecorrlabel, corr_prefix(corrnumber, "en")) if corrnumber
146
+ set(:doctitlecorrlabel, corr_prefix(corrnumber, lang)) if corrnumber
148
147
  end
149
148
 
150
149
  def subtitle(isoxml, _out)
151
- intro, main, part, amd = title_parts(isoxml, "fr")
150
+ lang = @lang == "fr" ? "en" : "fr"
151
+ intro, main, part, amd = title_parts(isoxml, lang)
152
152
  partnumber, subpartnumber, amdnumber, corrnumber = title_nums(isoxml)
153
153
 
154
154
  set(:docsubtitlemain, @c.encode(main ? main.text : "", :hexadecimal))
155
- main = compose_title(main, intro, part, partnumber, subpartnumber, "fr")
155
+ main = compose_title(main, intro, part, partnumber, subpartnumber, lang)
156
156
  set(:docsubtitle, main)
157
157
  set(:docsubtitleintro, @c.encode(intro ? intro.text : "", :hexadecimal)) if intro
158
- set(:docsubtitlepartlabel, part_prefix(partnumber, subpartnumber, "fr"))
158
+ set(:docsubtitlepartlabel, part_prefix(partnumber, subpartnumber, lang))
159
159
  set(:docsubtitlepart, @c.encode(part.text, :hexadecimal)) if part
160
- set(:docsubtitleamdlabel, amd_prefix(amdnumber, "fr")) if amdnumber
160
+ set(:docsubtitleamdlabel, amd_prefix(amdnumber, lang)) if amdnumber
161
161
  set(:docsubtitleamd, @c.encode(amd.text, :hexadecimal)) if amd
162
- set(:docsubtitlecorrlabel, corr_prefix(corrnumber, "fr")) if corrnumber
162
+ set(:docsubtitlecorrlabel, corr_prefix(corrnumber, lang)) if corrnumber
163
163
  end
164
164
 
165
165
  def author(xml, _out)
@@ -211,6 +211,7 @@ module IsoDoc
211
211
  ics = []
212
212
  isoxml.xpath(ns("//bibdata/ext/ics/code")).each { |i| ics << i.text }
213
213
  set(:ics, ics.empty? ? nil : ics.join(", "))
214
+ a = isoxml.at(ns("//bibdata/ext/horizontal")) and set(:horizontal, a.text)
214
215
  end
215
216
  end
216
217
  end
@@ -21,6 +21,10 @@ module IsoDoc
21
21
  headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' :
22
22
  '"Cambria",serif'),
23
23
  monospacefont: '"Courier New",monospace',
24
+ normalfontsize: "11.0pt",
25
+ monospacefontsize: "9.0pt",
26
+ smallerfontsize: "10.0pt",
27
+ footnotefontsize: "10.0pt",
24
28
  }
25
29
  end
26
30
 
@@ -34,6 +34,9 @@ module IsoDoc
34
34
  @anchors[c["id"]] = anchor_struct(i + 1, nil, @labels["appendix"], "clause")
35
35
  @anchors[c["id"]][:level] = 2
36
36
  @anchors[c["id"]][:container] = clause["id"]
37
+ c.xpath(ns("./clause | ./references")).each_with_index do |c, j|
38
+ appendix_names1(c, l10n("#{@labels["appendix"]} #{i + 1}.#{j + 1}"), 3, clause["id"])
39
+ end
37
40
  end
38
41
  end
39
42
 
@@ -55,6 +58,13 @@ module IsoDoc
55
58
  end
56
59
  end
57
60
 
61
+ def appendix_names1(clause, num, level, container)
62
+ @anchors[clause["id"]] = { label: num, xref: num, level: level, container: container }
63
+ clause.xpath(ns("./clause | ./references")).each_with_index do |c, i|
64
+ appendix_names1(c, "#{num}.#{i + 1}", level + 1, container)
65
+ end
66
+ end
67
+
58
68
  def hierarchical_formula_names(clause, num)
59
69
  c = IsoDoc::XrefGen::Counter.new
60
70
  clause.xpath(ns(".//formula")).each do |t|
@@ -0,0 +1,6 @@
1
+ ---
2
+ Cambria:
3
+ Cambria Math:
4
+ Times New Roman:
5
+ Source Han Sans:
6
+ Courier New:
@@ -2,15 +2,6 @@ require "metanorma/processor"
2
2
 
3
3
  module Metanorma
4
4
  module Iso
5
- def self.fonts_used
6
- {
7
- html: ["Cambria", "Times New Roman", "Cambria Math", "HanSans", "Courier New"],
8
- html_alt: ["Cambria", "Times New Roman", "Cambria Math", "HanSans", "Courier New"],
9
- doc: ["Cambria", "Times New Roman", "Cambria Math", "HanSans", "Courier New"],
10
- pdf: ["Cambria", "Times New Roman", "Cambria Math", "HanSans", "Courier New"],
11
- }
12
- end
13
-
14
5
  class Processor < Metanorma::Processor
15
6
 
16
7
  def initialize
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ISO
3
- VERSION = "1.5.8".freeze
3
+ VERSION = "1.5.13".freeze
4
4
  end
5
5
  end
@@ -30,8 +30,8 @@ Gem::Specification.new do |spec|
30
30
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
31
31
 
32
32
  spec.add_dependency "ruby-jing"
33
- spec.add_dependency "isodoc", "~> 1.2.0"
34
- spec.add_dependency "metanorma-standoc", "~> 1.5.0"
33
+ spec.add_dependency "isodoc", "~> 1.3.0"
34
+ spec.add_dependency "metanorma-standoc", "~> 1.6.0"
35
35
  spec.add_dependency "tokenizer", "~> 0.3.0"
36
36
  spec.add_dependency "twitter_cldr"
37
37
  spec.add_dependency "mn2sts", "~> 1.5.0"
@@ -183,7 +183,7 @@ OUTPUT
183
183
  :doctype: amendment
184
184
  :updates-document-type: international-standard
185
185
  INPUT
186
- <iso-standard xmlns='https://www.metanorma.org/ns/iso'>
186
+ <iso-standard xmlns='https://www.metanorma.org/ns/iso' type="semantic" version="#{Metanorma::ISO::VERSION}">
187
187
  <bibdata type='standard'>
188
188
  <title language='en' format='text/plain' type='main'>Introduction — Main Title — Title — Title Part — Mass fraction of
189
189
  extraneous matter, milled rice (nonglutinous), sample dividers and
@@ -298,7 +298,7 @@ Author
298
298
  :updates: ISO 17301-1:2030
299
299
  :amendment-number: 1
300
300
  INPUT
301
- <iso-standard xmlns='https://www.metanorma.org/ns/iso'>
301
+ <iso-standard xmlns='https://www.metanorma.org/ns/iso' type="semantic" version="#{Metanorma::ISO::VERSION}">
302
302
  <bibdata type='standard'>
303
303
  <docidentifier type='ISO'>ISO 17301-1:2030/CD Amd 1</docidentifier>
304
304
  <docidentifier type='iso-with-lang'>ISO 17301-1:2030/CD Amd 1(E)</docidentifier>
@@ -366,7 +366,7 @@ Author
366
366
  :updates: ISO 17301-1:2030
367
367
  :amendment-number: 1
368
368
  INPUT
369
- <iso-standard xmlns='https://www.metanorma.org/ns/iso'>
369
+ <iso-standard xmlns='https://www.metanorma.org/ns/iso' type="semantic" version="#{Metanorma::ISO::VERSION}">
370
370
  <bibdata type='standard'>
371
371
  <docidentifier type='ISO'>ISO 17301-1:2030/DAmd 1</docidentifier>
372
372
  <docidentifier type='iso-with-lang'>ISO 17301-1:2030/DAmd 1(E)</docidentifier>
@@ -433,7 +433,7 @@ Author
433
433
  :updates: ISO 17301-1:2030
434
434
  :amendment-number: 1
435
435
  INPUT
436
- <iso-standard xmlns='https://www.metanorma.org/ns/iso'>
436
+ <iso-standard xmlns='https://www.metanorma.org/ns/iso' type="semantic" version="#{Metanorma::ISO::VERSION}">
437
437
  <bibdata type='standard'>
438
438
  <docidentifier type='ISO'>ISO 17301-1:2030/Amd 1</docidentifier>
439
439
  <docidentifier type='iso-with-lang'>ISO 17301-1:2030/Amd 1(E)</docidentifier>
@@ -501,7 +501,7 @@ Author
501
501
  :updates: ISO 17301-1:2030
502
502
  :corrigendum-number: 3
503
503
  INPUT
504
- <iso-standard xmlns='https://www.metanorma.org/ns/iso'>
504
+ <iso-standard xmlns='https://www.metanorma.org/ns/iso' type="semantic" version="#{Metanorma::ISO::VERSION}">
505
505
  <bibdata type='standard'>
506
506
  <docidentifier type='ISO'>ISO 17301-1:2030/CD Cor.3</docidentifier>
507
507
  <docidentifier type='iso-with-lang'>ISO 17301-1:2030/CD Cor.3(E)</docidentifier>
@@ -569,7 +569,7 @@ Author
569
569
  :updates: ISO 17301-1:2030
570
570
  :corrigendum-number: 3
571
571
  INPUT
572
- <iso-standard xmlns='https://www.metanorma.org/ns/iso'>
572
+ <iso-standard xmlns='https://www.metanorma.org/ns/iso' type="semantic" version="#{Metanorma::ISO::VERSION}">
573
573
  <bibdata type='standard'>
574
574
  <docidentifier type='ISO'>ISO 17301-1:2030/FDCor.3</docidentifier>
575
575
  <docidentifier type='iso-with-lang'>ISO 17301-1:2030/FDCor.3(E)</docidentifier>
@@ -636,7 +636,7 @@ Author
636
636
  :updates: ISO 17301-1:2030
637
637
  :corrigendum-number: 3
638
638
  INPUT
639
- <iso-standard xmlns='https://www.metanorma.org/ns/iso'>
639
+ <iso-standard xmlns='https://www.metanorma.org/ns/iso' type="semantic" version="#{Metanorma::ISO::VERSION}">
640
640
  <bibdata type='standard'>
641
641
  <docidentifier type='ISO'>ISO 17301-1:2030/Cor.3</docidentifier>
642
642
  <docidentifier type='iso-with-lang'>ISO 17301-1:2030/Cor.3(E)</docidentifier>
@@ -6,17 +6,6 @@ RSpec.describe Asciidoctor::ISO do
6
6
  expect(Metanorma::ISO::VERSION).not_to be nil
7
7
  end
8
8
 
9
- #it "generates output for the Rice document" do
10
- #FileUtils.rm_f %w(spec/examples/rice.xml spec/examples/rice.doc spec/examples/rice.html spec/examples/rice_alt.html)
11
- #FileUtils.cd "spec/examples"
12
- #Asciidoctor.convert_file "rice.adoc", {:attributes=>{"backend"=>"iso"}, :safe=>0, :header_footer=>true, :requires=>["metanorma-iso"], :failure_level=>4, :mkdirs=>true, :to_file=>nil}
13
- #FileUtils.cd "../.."
14
- #expect(File.exist?("spec/examples/rice.xml"))).to be true
15
- #expect(File.exist?("spec/examples/rice.doc"))).to be true
16
- #expect(File.exist?("spec/examples/rice.html"))).to be true
17
- #expect(File.exist?("spec/examples/rice_alt.html"))).to be true
18
- #end
19
-
20
9
  it "processes a blank document" do
21
10
  expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
22
11
  #{ASCIIDOC_BLANK_HDR}
@@ -29,22 +18,43 @@ RSpec.describe Asciidoctor::ISO do
29
18
 
30
19
  it "converts a blank document" do
31
20
  FileUtils.rm_f "test.doc"
21
+ FileUtils.rm_f "test.html"
22
+ FileUtils.rm_f "test.pdf"
23
+ FileUtils.rm_f "test_alt.html"
32
24
  expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
33
25
  = Document title
34
26
  Author
35
27
  :docfile: test.adoc
36
28
  :novalid:
37
29
  :no-isobib:
38
- :no-pdf:
39
30
  INPUT
40
31
  #{BLANK_HDR}
41
32
  <sections/>
42
33
  </iso-standard>
43
34
  OUTPUT
35
+ expect(File.exist?("test_alt.html")).to be true
36
+ expect(File.exist?("test.html")).to be true
44
37
  expect(File.exist?("test.doc")).to be true
38
+ expect(File.exist?("test.pdf")).to be true
45
39
  expect(File.exist?("htmlstyle.css")).to be false
46
40
  end
47
41
 
42
+ it "converts a blank document in French" do
43
+ expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
44
+ = Document title
45
+ Author
46
+ :docfile: test.adoc
47
+ :novalid:
48
+ :no-isobib:
49
+ :no-pdf:
50
+ :language: fr
51
+ INPUT
52
+ #{BLANK_HDR_FR}
53
+ <sections/>
54
+ </iso-standard>
55
+ OUTPUT
56
+ end
57
+
48
58
  it "processes default metadata" do
49
59
  expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
50
60
  = Document title
@@ -89,9 +99,10 @@ RSpec.describe Asciidoctor::ISO do
89
99
  :title-part-fr: Part du Titre
90
100
  :library-ics: 1,2,3
91
101
  :copyright-year: 2000
102
+ :horizontal: true
92
103
  INPUT
93
104
  <?xml version="1.0" encoding="UTF-8"?>
94
- <iso-standard xmlns="https://www.metanorma.org/ns/iso">
105
+ <iso-standard xmlns="https://www.metanorma.org/ns/iso" type="semantic" version="#{Metanorma::ISO::VERSION}">
95
106
  <bibdata type="standard">
96
107
  <title language="en" format="text/plain" type="main">Introduction — Main Title — Title — Title Part</title>
97
108
  <title language="en" format="text/plain" type="title-intro">Introduction</title>
@@ -142,6 +153,7 @@ RSpec.describe Asciidoctor::ISO do
142
153
  </copyright>
143
154
  <ext>
144
155
  <doctype>article</doctype>
156
+ <horizontal>true</horizontal>
145
157
  <editorialgroup>
146
158
  <technical-committee number="1" type="A">TC</technical-committee>
147
159
  <technical-committee number="11" type="A1">TC1</technical-committee>
@@ -173,7 +185,7 @@ RSpec.describe Asciidoctor::ISO do
173
185
 
174
186
 
175
187
  it "processes complex metadata" do
176
- expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~'OUTPUT')
188
+ expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
177
189
  = Document title
178
190
  Author
179
191
  :docfile: test.adoc
@@ -189,9 +201,15 @@ RSpec.describe Asciidoctor::ISO do
189
201
  :copyright-holder: ISO,IETF
190
202
  :copyright-year: 2001
191
203
  :doctype: technical-report
204
+ :pub-address: 1 Infinity Loop + \
205
+ California
206
+ :pub-phone: 3333333
207
+ :pub-fax: 4444444
208
+ :pub-email: x@example.com
209
+ :pub-uri: http://www.example.com
192
210
  INPUT
193
211
  <?xml version="1.0" encoding="UTF-8"?>
194
- <iso-standard xmlns="https://www.metanorma.org/ns/iso">
212
+ <iso-standard xmlns="https://www.metanorma.org/ns/iso" type="semantic" version="#{Metanorma::ISO::VERSION}">
195
213
  <bibdata type="standard">
196
214
  <docidentifier type="ISO">ISO/IEC/IETF/TR 1000-1-1:2001</docidentifier>
197
215
  <docidentifier type='iso-with-lang'>ISO/IEC/IETF/TR 1000-1-1:2001(X)</docidentifier>
@@ -280,6 +298,116 @@ RSpec.describe Asciidoctor::ISO do
280
298
  OUTPUT
281
299
  end
282
300
 
301
+ it "processes subdivisions" do
302
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, "")))).to be_equivalent_to xmlpp(<<~"OUTPUT")
303
+ = Document title
304
+ Author
305
+ :docfile: test.adoc
306
+ :nodoc:
307
+ :novalid:
308
+ :revdate: 2000-01
309
+ :published-date: 1000-01
310
+ :docnumber: 1000
311
+ :partnumber: 1-1
312
+ :tc-docnumber: 2000
313
+ :language: el
314
+ :script: Grek
315
+ :subdivision: Subdivision
316
+ :subdivision-abbr: SD
317
+ :doctype: This is a DocType
318
+ :pub-address: 1 Infinity Loop + \\
319
+ California
320
+ :pub-phone: 3333333
321
+ :pub-fax: 4444444
322
+ :pub-email: x@example.com
323
+ :pub-uri: http://www.example.com
324
+
325
+ INPUT
326
+ <iso-standard xmlns="https://www.metanorma.org/ns/iso" type="semantic" version="#{Metanorma::ISO::VERSION}">
327
+ <bibdata type='standard'>
328
+ <docidentifier type='ISO'>SD 1000-1-1</docidentifier>
329
+ <docidentifier type='iso-with-lang'>SD 1000-1-1(X)</docidentifier>
330
+ <docidentifier type='iso-reference'>SD 1000-1-1(X)</docidentifier>
331
+ <docidentifier type='iso-tc'>2000</docidentifier>
332
+ <docnumber>1000</docnumber>
333
+ <date type='published'>
334
+ <on>1000-01</on>
335
+ </date>
336
+ <contributor>
337
+ <role type='author'/>
338
+ <organization>
339
+ <name>International Organization for Standardization</name>
340
+ <subdivision>Subdivision</subdivision>
341
+ <abbreviation>SD</abbreviation>
342
+ <address>
343
+ <formattedAddress>1 Infinity Loop <br/>California</formattedAddress>
344
+ </address>
345
+ <phone>3333333</phone>
346
+ <phone type='fax'>4444444</phone>
347
+ <email>x@example.com</email>
348
+ <uri>http://www.example.com</uri>
349
+ </organization>
350
+ </contributor>
351
+ <contributor>
352
+ <role type='publisher'/>
353
+ <organization>
354
+ <name>International Organization for Standardization</name>
355
+ <subdivision>Subdivision</subdivision>
356
+ <abbreviation>SD</abbreviation>
357
+ <address>
358
+ <formattedAddress>1 Infinity Loop <br/>California</formattedAddress>
359
+ </address>
360
+ <phone>3333333</phone>
361
+ <phone type='fax'>4444444</phone>
362
+ <email>x@example.com</email>
363
+ <uri>http://www.example.com</uri>
364
+ </organization>
365
+ </contributor>
366
+ <version>
367
+ <revision-date>2000-01</revision-date>
368
+ </version>
369
+ <language>el</language>
370
+ <script>Grek</script>
371
+ <status>
372
+ <stage abbreviation='IS'>60</stage>
373
+ <substage>60</substage>
374
+ </status>
375
+ <copyright>
376
+ <from>2020</from>
377
+ <owner>
378
+ <organization>
379
+ <name>International Organization for Standardization</name>
380
+ <subdivision>Subdivision</subdivision>
381
+ <abbreviation>SD</abbreviation>
382
+ <address>
383
+ <formattedAddress>1 Infinity Loop <br/>California</formattedAddress>
384
+ </address>
385
+ <phone>3333333</phone>
386
+ <phone type='fax'>4444444</phone>
387
+ <email>x@example.com</email>
388
+ <uri>http://www.example.com</uri>
389
+ </organization>
390
+ </owner>
391
+ </copyright>
392
+ <ext>
393
+ <doctype>this-is-a-doctype</doctype>
394
+ <editorialgroup>
395
+ <technical-committee/>
396
+ <subcommittee/>
397
+ <workgroup/>
398
+ </editorialgroup>
399
+ <structuredidentifier>
400
+ <project-number part='1' subpart='1'>SD 1000</project-number>
401
+ </structuredidentifier>
402
+ <stagename>International standard</stagename>
403
+ </ext>
404
+ </bibdata>
405
+ <sections> </sections>
406
+ </iso-standard>
407
+
408
+ OUTPUT
409
+ end
410
+
283
411
  it "defaults substage, defines iteration on stage 50, gives stage 50 on technical specification" do
284
412
  expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
285
413
  = Document title
@@ -294,7 +422,7 @@ RSpec.describe Asciidoctor::ISO do
294
422
  :doctype: technical-specification
295
423
  :iteration: 2
296
424
  INPUT
297
- <iso-standard xmlns="https://www.metanorma.org/ns/iso">
425
+ <iso-standard xmlns="https://www.metanorma.org/ns/iso" type="semantic" version="#{Metanorma::ISO::VERSION}">
298
426
  <bibdata type="standard">
299
427
  <docidentifier type="ISO">ISO/DTS 1000.2</docidentifier>
300
428
  <docidentifier type='iso-with-lang'>ISO/DTS 1000.2(F)</docidentifier>
@@ -360,7 +488,7 @@ OUTPUT
360
488
  :docnumber: 1000
361
489
  :docstage: 60
362
490
  INPUT
363
- <iso-standard xmlns="https://www.metanorma.org/ns/iso">
491
+ <iso-standard xmlns="https://www.metanorma.org/ns/iso" type="semantic" version="#{Metanorma::ISO::VERSION}">
364
492
  <bibdata type="standard">
365
493
  <docidentifier type="ISO">ISO 1000</docidentifier>
366
494
  <docidentifier type='iso-with-lang'>ISO 1000(E)</docidentifier>
@@ -426,7 +554,7 @@ OUTPUT
426
554
  :docstage: 60
427
555
  :docsubstage: 00
428
556
  INPUT
429
- <iso-standard xmlns="https://www.metanorma.org/ns/iso">
557
+ <iso-standard xmlns="https://www.metanorma.org/ns/iso" type="semantic" version="#{Metanorma::ISO::VERSION}">
430
558
  <bibdata type="standard">
431
559
  <docidentifier type="ISO">ISO 1000</docidentifier>
432
560
  <docidentifier type='iso-with-lang'>ISO 1000(E)</docidentifier>