metanorma-iso 1.5.12 → 1.7.0
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.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +18 -1
- data/lib/asciidoctor/iso/base.rb +5 -5
- data/lib/asciidoctor/iso/basicdoc.rng +52 -3
- data/lib/asciidoctor/iso/cleanup.rb +0 -6
- data/lib/asciidoctor/iso/front.rb +10 -5
- data/lib/asciidoctor/iso/isodoc.rng +51 -3
- data/lib/asciidoctor/iso/isostandard-amd.rng +8 -4
- data/lib/asciidoctor/iso/isostandard.rng +27 -10
- data/lib/asciidoctor/iso/validate.rb +78 -0
- data/lib/asciidoctor/iso/validate_section.rb +12 -9
- data/lib/isodoc/iso/base_convert.rb +2 -1
- data/lib/isodoc/iso/html/header.html +12 -12
- data/lib/isodoc/iso/html/html_iso_intro.html +1 -1
- data/lib/isodoc/iso/html/html_iso_titlepage.html +1 -1
- data/lib/isodoc/iso/html/htmlstyle.css +1 -1
- data/lib/isodoc/iso/html/htmlstyle.scss +1 -1
- data/lib/isodoc/iso/html/isodoc.css +42 -42
- data/lib/isodoc/iso/html/isodoc.scss +42 -42
- data/lib/isodoc/iso/html/style-human.css +9 -9
- data/lib/isodoc/iso/html/style-human.scss +7 -7
- data/lib/isodoc/iso/html/style-iso.css +7 -7
- data/lib/isodoc/iso/html/style-iso.scss +5 -5
- data/lib/isodoc/iso/html/word_iso_intro.html +1 -1
- data/lib/isodoc/iso/html/word_iso_titlepage.html +1 -1
- data/lib/isodoc/iso/html/wordstyle.css +67 -67
- data/lib/isodoc/iso/html/wordstyle.scss +67 -67
- data/lib/isodoc/iso/html_convert.rb +6 -2
- data/lib/isodoc/iso/i18n-en.yaml +2 -0
- data/lib/isodoc/iso/i18n-fr.yaml +1 -1
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +1 -1
- data/lib/isodoc/iso/iso.amendment.xsl +276 -59
- data/lib/isodoc/iso/iso.international-standard.xsl +276 -59
- data/lib/isodoc/iso/metadata.rb +1 -0
- data/lib/isodoc/iso/sections.rb +1 -1
- data/lib/isodoc/iso/word_convert.rb +6 -2
- data/lib/isodoc/iso/xref.rb +34 -8
- data/lib/metanorma/iso/processor.rb +11 -9
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +2 -2
- data/spec/asciidoctor-iso/amd_spec.rb +14 -14
- data/spec/asciidoctor-iso/base_spec.rb +22 -20
- data/spec/asciidoctor-iso/blocks_spec.rb +22 -22
- data/spec/asciidoctor-iso/cleanup_spec.rb +32 -26
- data/spec/asciidoctor-iso/inline_spec.rb +7 -7
- data/spec/asciidoctor-iso/lists_spec.rb +9 -9
- data/spec/asciidoctor-iso/refs_spec.rb +5 -5
- data/spec/asciidoctor-iso/section_spec.rb +12 -7
- data/spec/asciidoctor-iso/table_spec.rb +4 -4
- data/spec/asciidoctor-iso/validate_spec.rb +455 -87
- data/spec/isodoc/amd_spec.rb +13 -13
- data/spec/isodoc/iso_spec.rb +2 -2
- data/spec/isodoc/metadata_spec.rb +2 -0
- data/spec/isodoc/section_spec.rb +20 -0
- data/spec/isodoc/xref_spec.rb +12 -0
- metadata +6 -12
- data/.github/workflows/macos.yml +0 -49
- data/.github/workflows/ubuntu.yml +0 -53
- data/.github/workflows/windows.yml +0 -50
- data/lib/asciidoctor/iso/macros.rb +0 -21
- data/lib/asciidoctor/iso/term_lookup_cleanup.rb +0 -86
- data/spec/asciidoctor-iso/macros_spec.rb +0 -310
data/lib/isodoc/iso/metadata.rb
CHANGED
data/lib/isodoc/iso/sections.rb
CHANGED
@@ -16,11 +16,15 @@ module IsoDoc
|
|
16
16
|
|
17
17
|
def default_fonts(options)
|
18
18
|
{
|
19
|
-
bodyfont: (options[:script] == "Hans" ? '"
|
19
|
+
bodyfont: (options[:script] == "Hans" ? '"Source Han Sans",serif' :
|
20
20
|
'"Cambria",serif'),
|
21
|
-
headerfont: (options[:script] == "Hans" ? '"
|
21
|
+
headerfont: (options[:script] == "Hans" ? '"Source Han Sans",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
|
|
data/lib/isodoc/iso/xref.rb
CHANGED
@@ -1,10 +1,14 @@
|
|
1
1
|
module IsoDoc
|
2
2
|
module Iso
|
3
|
+
class Counter < IsoDoc::XrefGen::Counter
|
4
|
+
end
|
5
|
+
|
3
6
|
class Xref < IsoDoc::Xref
|
4
7
|
def initial_anchor_names(d)
|
5
8
|
if @klass.amd(d)
|
6
9
|
d.xpath(ns("//preface/*")).each { |c| c.element? and preface_names(c) }
|
7
10
|
sequential_asset_names(d.xpath(ns("//preface/*")))
|
11
|
+
d.xpath(ns("//sections/clause")).each { |c| c.element? and preface_names(c) }
|
8
12
|
middle_section_asset_names(d)
|
9
13
|
termnote_anchor_names(d)
|
10
14
|
termexample_anchor_names(d)
|
@@ -19,8 +23,10 @@ module IsoDoc
|
|
19
23
|
return if clause.nil?
|
20
24
|
clause.at(ns("./clause")) and @anchors[clause["id"]] =
|
21
25
|
{ label: "0", level: 1, xref: clause.at(ns("./title"))&.text, type: "clause" }
|
22
|
-
|
23
|
-
|
26
|
+
i = Counter.new
|
27
|
+
clause.xpath(ns("./clause")).each do |c|
|
28
|
+
i.increment(c)
|
29
|
+
section_names1(c, "0.#{i.print}", 2)
|
24
30
|
end
|
25
31
|
end
|
26
32
|
|
@@ -30,10 +36,17 @@ module IsoDoc
|
|
30
36
|
end
|
31
37
|
|
32
38
|
def appendix_names(clause, num)
|
33
|
-
|
34
|
-
|
39
|
+
i = Counter.new
|
40
|
+
clause.xpath(ns("./appendix")).each do |c|
|
41
|
+
i.increment(c)
|
42
|
+
@anchors[c["id"]] = anchor_struct(i.print, nil, @labels["appendix"], "clause")
|
35
43
|
@anchors[c["id"]][:level] = 2
|
36
44
|
@anchors[c["id"]][:container] = clause["id"]
|
45
|
+
j = Counter.new
|
46
|
+
c.xpath(ns("./clause | ./references")).each do |c1|
|
47
|
+
j.increment(c1)
|
48
|
+
appendix_names1(c1, l10n("#{@labels["appendix"]} #{i.print}.#{j.print}"), 3, clause["id"])
|
49
|
+
end
|
37
50
|
end
|
38
51
|
end
|
39
52
|
|
@@ -41,17 +54,30 @@ module IsoDoc
|
|
41
54
|
@anchors[clause["id"]] =
|
42
55
|
{ label: num, level: level, xref: num }
|
43
56
|
# subclauses are not prefixed with "Clause"
|
57
|
+
i = Counter.new
|
44
58
|
clause.xpath(ns("./clause | ./terms | ./term | ./definitions | "\
|
45
59
|
"./references")).
|
46
|
-
|
47
|
-
|
60
|
+
each do |c|
|
61
|
+
i.increment(c)
|
62
|
+
section_names1(c, "#{num}.#{i.print}", level + 1)
|
48
63
|
end
|
49
64
|
end
|
50
65
|
|
51
66
|
def annex_names1(clause, num, level)
|
52
67
|
@anchors[clause["id"]] = { label: num, xref: num, level: level }
|
53
|
-
|
54
|
-
|
68
|
+
i = Counter.new
|
69
|
+
clause.xpath(ns("./clause | ./references")).each do |c|
|
70
|
+
i.increment(c)
|
71
|
+
annex_names1(c, "#{num}.#{i.print}", level + 1)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def appendix_names1(clause, num, level, container)
|
76
|
+
@anchors[clause["id"]] = { label: num, xref: num, level: level, container: container }
|
77
|
+
i = Counter.new
|
78
|
+
clause.xpath(ns("./clause | ./references")).each do |c|
|
79
|
+
i.increment(c)
|
80
|
+
appendix_names1(c, "#{num}.#{i.print}", level + 1, container)
|
55
81
|
end
|
56
82
|
end
|
57
83
|
|
@@ -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
|
@@ -34,6 +25,17 @@ module Metanorma
|
|
34
25
|
"Metanorma::ISO #{Metanorma::ISO::VERSION}"
|
35
26
|
end
|
36
27
|
|
28
|
+
def fonts_manifest
|
29
|
+
{
|
30
|
+
"Cambria" => nil,
|
31
|
+
"Cambria Math" => nil,
|
32
|
+
"Times New Roman" => nil,
|
33
|
+
"Source Han Sans" => nil,
|
34
|
+
"Courier" => nil,
|
35
|
+
"Courier New" => nil,
|
36
|
+
}
|
37
|
+
end
|
38
|
+
|
37
39
|
def use_presentation_xml(ext)
|
38
40
|
return true if ext == :html_alt
|
39
41
|
super
|
data/metanorma-iso.gemspec
CHANGED
@@ -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.
|
34
|
-
spec.add_dependency "metanorma-standoc", "~> 1.
|
33
|
+
spec.add_dependency "isodoc", "~> 1.5.0"
|
34
|
+
spec.add_dependency "metanorma-standoc", "~> 1.8.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"
|
@@ -3,7 +3,7 @@ require "fileutils"
|
|
3
3
|
|
4
4
|
RSpec.describe Asciidoctor::ISO do
|
5
5
|
it "processes amendment sections" do
|
6
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
6
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
7
7
|
#{AMD_BLANK_HDR}
|
8
8
|
== Foreword
|
9
9
|
|
@@ -132,7 +132,7 @@ OUTPUT
|
|
132
132
|
end
|
133
133
|
|
134
134
|
it "processes default metadata, amendment" do
|
135
|
-
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
135
|
+
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
136
136
|
= Document title
|
137
137
|
Author
|
138
138
|
:docfile: test.adoc
|
@@ -284,7 +284,7 @@ OUTPUT
|
|
284
284
|
end
|
285
285
|
|
286
286
|
it "processes metadata, amendment" do
|
287
|
-
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
287
|
+
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
288
288
|
= Document title
|
289
289
|
Author
|
290
290
|
:docfile: test.adoc
|
@@ -325,7 +325,7 @@ INPUT
|
|
325
325
|
<substage>00</substage>
|
326
326
|
</status>
|
327
327
|
<copyright>
|
328
|
-
<from
|
328
|
+
<from>#{Time.now.year}</from>
|
329
329
|
<owner>
|
330
330
|
<organization>
|
331
331
|
<name>International Organization for Standardization</name>
|
@@ -352,7 +352,7 @@ OUTPUT
|
|
352
352
|
end
|
353
353
|
|
354
354
|
it "processes metadata, amendment" do
|
355
|
-
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
355
|
+
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
356
356
|
= Document title
|
357
357
|
Author
|
358
358
|
:docfile: test.adoc
|
@@ -393,7 +393,7 @@ INPUT
|
|
393
393
|
<substage>00</substage>
|
394
394
|
</status>
|
395
395
|
<copyright>
|
396
|
-
<from
|
396
|
+
<from>#{Time.now.year}</from>
|
397
397
|
<owner>
|
398
398
|
<organization>
|
399
399
|
<name>International Organization for Standardization</name>
|
@@ -420,7 +420,7 @@ OUTPUT
|
|
420
420
|
end
|
421
421
|
|
422
422
|
it "processes metadata, amendment" do
|
423
|
-
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
423
|
+
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
424
424
|
= Document title
|
425
425
|
Author
|
426
426
|
:docfile: test.adoc
|
@@ -460,7 +460,7 @@ INPUT
|
|
460
460
|
<substage>60</substage>
|
461
461
|
</status>
|
462
462
|
<copyright>
|
463
|
-
<from
|
463
|
+
<from>#{Time.now.year}</from>
|
464
464
|
<owner>
|
465
465
|
<organization>
|
466
466
|
<name>International Organization for Standardization</name>
|
@@ -487,7 +487,7 @@ OUTPUT
|
|
487
487
|
end
|
488
488
|
|
489
489
|
it "processes metadata, corrigendum" do
|
490
|
-
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
490
|
+
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
491
491
|
= Document title
|
492
492
|
Author
|
493
493
|
:docfile: test.adoc
|
@@ -528,7 +528,7 @@ INPUT
|
|
528
528
|
<substage>00</substage>
|
529
529
|
</status>
|
530
530
|
<copyright>
|
531
|
-
<from
|
531
|
+
<from>#{Time.now.year}</from>
|
532
532
|
<owner>
|
533
533
|
<organization>
|
534
534
|
<name>International Organization for Standardization</name>
|
@@ -555,7 +555,7 @@ OUTPUT
|
|
555
555
|
end
|
556
556
|
|
557
557
|
it "processes metadata, corrigendum" do
|
558
|
-
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
558
|
+
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
559
559
|
= Document title
|
560
560
|
Author
|
561
561
|
:docfile: test.adoc
|
@@ -596,7 +596,7 @@ INPUT
|
|
596
596
|
<substage>00</substage>
|
597
597
|
</status>
|
598
598
|
<copyright>
|
599
|
-
<from
|
599
|
+
<from>#{Time.now.year}</from>
|
600
600
|
<owner>
|
601
601
|
<organization>
|
602
602
|
<name>International Organization for Standardization</name>
|
@@ -623,7 +623,7 @@ OUTPUT
|
|
623
623
|
end
|
624
624
|
|
625
625
|
it "processes metadata, corrigendum" do
|
626
|
-
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
626
|
+
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
627
627
|
= Document title
|
628
628
|
Author
|
629
629
|
:docfile: test.adoc
|
@@ -663,7 +663,7 @@ INPUT
|
|
663
663
|
<substage>60</substage>
|
664
664
|
</status>
|
665
665
|
<copyright>
|
666
|
-
<from
|
666
|
+
<from>#{Time.now.year}</from>
|
667
667
|
<owner>
|
668
668
|
<organization>
|
669
669
|
<name>International Organization for Standardization</name>
|
@@ -7,7 +7,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
it "processes a blank document" do
|
10
|
-
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
10
|
+
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
11
11
|
#{ASCIIDOC_BLANK_HDR}
|
12
12
|
INPUT
|
13
13
|
#{BLANK_HDR}
|
@@ -21,7 +21,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
21
21
|
FileUtils.rm_f "test.html"
|
22
22
|
FileUtils.rm_f "test.pdf"
|
23
23
|
FileUtils.rm_f "test_alt.html"
|
24
|
-
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
24
|
+
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
25
25
|
= Document title
|
26
26
|
Author
|
27
27
|
:docfile: test.adoc
|
@@ -40,7 +40,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
40
40
|
end
|
41
41
|
|
42
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")
|
43
|
+
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
44
44
|
= Document title
|
45
45
|
Author
|
46
46
|
:docfile: test.adoc
|
@@ -56,7 +56,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
56
56
|
end
|
57
57
|
|
58
58
|
it "processes default metadata" do
|
59
|
-
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
59
|
+
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
60
60
|
= Document title
|
61
61
|
Author
|
62
62
|
:docfile: test.adoc
|
@@ -99,6 +99,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
99
99
|
:title-part-fr: Part du Titre
|
100
100
|
:library-ics: 1,2,3
|
101
101
|
:copyright-year: 2000
|
102
|
+
:horizontal: true
|
102
103
|
INPUT
|
103
104
|
<?xml version="1.0" encoding="UTF-8"?>
|
104
105
|
<iso-standard xmlns="https://www.metanorma.org/ns/iso" type="semantic" version="#{Metanorma::ISO::VERSION}">
|
@@ -152,6 +153,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
152
153
|
</copyright>
|
153
154
|
<ext>
|
154
155
|
<doctype>article</doctype>
|
156
|
+
<horizontal>true</horizontal>
|
155
157
|
<editorialgroup>
|
156
158
|
<technical-committee number="1" type="A">TC</technical-committee>
|
157
159
|
<technical-committee number="11" type="A1">TC1</technical-committee>
|
@@ -183,7 +185,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
183
185
|
|
184
186
|
|
185
187
|
it "processes complex metadata" do
|
186
|
-
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, agree_to_terms: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
187
189
|
= Document title
|
188
190
|
Author
|
189
191
|
:docfile: test.adoc
|
@@ -195,8 +197,8 @@ RSpec.describe Asciidoctor::ISO do
|
|
195
197
|
:tc-docnumber: 2000, 2003
|
196
198
|
:language: el
|
197
199
|
:script: Grek
|
198
|
-
:publisher: IEC
|
199
|
-
:copyright-holder: ISO
|
200
|
+
:publisher: IEC;IETF;ISO
|
201
|
+
:copyright-holder: ISO;IETF
|
200
202
|
:copyright-year: 2001
|
201
203
|
:doctype: technical-report
|
202
204
|
:pub-address: 1 Infinity Loop + \
|
@@ -297,7 +299,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
297
299
|
end
|
298
300
|
|
299
301
|
it "processes subdivisions" do
|
300
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, "")))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
302
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true).sub(%r{<boilerplate>.*</boilerplate>}m, "")))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
301
303
|
= Document title
|
302
304
|
Author
|
303
305
|
:docfile: test.adoc
|
@@ -371,7 +373,7 @@ RSpec.describe Asciidoctor::ISO do
|
|
371
373
|
<substage>60</substage>
|
372
374
|
</status>
|
373
375
|
<copyright>
|
374
|
-
<from
|
376
|
+
<from>#{Time.now.year}</from>
|
375
377
|
<owner>
|
376
378
|
<organization>
|
377
379
|
<name>International Organization for Standardization</name>
|
@@ -407,7 +409,7 @@ OUTPUT
|
|
407
409
|
end
|
408
410
|
|
409
411
|
it "defaults substage, defines iteration on stage 50, gives stage 50 on technical specification" do
|
410
|
-
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
412
|
+
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
411
413
|
= Document title
|
412
414
|
Author
|
413
415
|
:docfile: test.adoc
|
@@ -476,7 +478,7 @@ OUTPUT
|
|
476
478
|
end
|
477
479
|
|
478
480
|
it "defaults substage for stage 60" do
|
479
|
-
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
481
|
+
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
480
482
|
= Document title
|
481
483
|
Author
|
482
484
|
:docfile: test.adoc
|
@@ -541,7 +543,7 @@ OUTPUT
|
|
541
543
|
end
|
542
544
|
|
543
545
|
it "populates metadata for PRF" do
|
544
|
-
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
546
|
+
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true).sub(%r{<boilerplate>.*</boilerplate>}m, ""))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
545
547
|
= Document title
|
546
548
|
Author
|
547
549
|
:docfile: test.adoc
|
@@ -609,7 +611,7 @@ OUTPUT
|
|
609
611
|
|
610
612
|
it "reads scripts into blank HTML document" do
|
611
613
|
FileUtils.rm_f "test.html"
|
612
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
614
|
+
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
613
615
|
= Document title
|
614
616
|
Author
|
615
617
|
:docfile: test.adoc
|
@@ -623,7 +625,7 @@ OUTPUT
|
|
623
625
|
|
624
626
|
it "uses default fonts" do
|
625
627
|
FileUtils.rm_f "test.html"
|
626
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
628
|
+
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
627
629
|
= Document title
|
628
630
|
Author
|
629
631
|
:docfile: test.adoc
|
@@ -639,7 +641,7 @@ OUTPUT
|
|
639
641
|
|
640
642
|
it "uses default fonts for alt doc" do
|
641
643
|
FileUtils.rm_f "test_alt.html"
|
642
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
644
|
+
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
643
645
|
= Document title
|
644
646
|
Author
|
645
647
|
:docfile: test.adoc
|
@@ -655,7 +657,7 @@ OUTPUT
|
|
655
657
|
|
656
658
|
it "uses Chinese fonts" do
|
657
659
|
FileUtils.rm_f "test.html"
|
658
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
660
|
+
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
659
661
|
= Document title
|
660
662
|
Author
|
661
663
|
:docfile: test.adoc
|
@@ -666,13 +668,13 @@ OUTPUT
|
|
666
668
|
INPUT
|
667
669
|
html = File.read("test.html", encoding: "utf-8")
|
668
670
|
expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
|
669
|
-
expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "
|
670
|
-
expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "
|
671
|
+
expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "Source Han Sans", serif;]m)
|
672
|
+
expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Source Han Sans", sans-serif;]m)
|
671
673
|
end
|
672
674
|
|
673
675
|
it "uses specified fonts" do
|
674
676
|
FileUtils.rm_f "test.html"
|
675
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
677
|
+
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
676
678
|
= Document title
|
677
679
|
Author
|
678
680
|
:docfile: test.adoc
|
@@ -693,7 +695,7 @@ OUTPUT
|
|
693
695
|
it "strips MS-specific CSS" do
|
694
696
|
FileUtils.rm_f "test.html"
|
695
697
|
FileUtils.rm_f "test.doc"
|
696
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
698
|
+
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
697
699
|
= Document title
|
698
700
|
Author
|
699
701
|
:docfile: test.adoc
|