metanorma-standoc 1.3.6 → 1.3.7
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/ubuntu.yml +0 -1
- data/Gemfile.lock +22 -18
- data/README.adoc +4 -4
- data/lib/asciidoctor/standoc/base.rb +1 -0
- data/lib/asciidoctor/standoc/basicdoc.rng +6 -8
- data/lib/asciidoctor/standoc/blocks.rb +15 -0
- data/lib/asciidoctor/standoc/cleanup.rb +9 -16
- data/lib/asciidoctor/standoc/inline.rb +4 -3
- data/lib/asciidoctor/standoc/macros.rb +20 -2
- data/lib/asciidoctor/standoc/ref.rb +79 -67
- data/lib/asciidoctor/standoc/section.rb +1 -1
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +1 -1
- data/spec/asciidoctor-standoc/base_spec.rb +15 -3
- data/spec/asciidoctor-standoc/blocks_spec.rb +37 -41
- data/spec/asciidoctor-standoc/cleanup_spec.rb +62 -55
- data/spec/asciidoctor-standoc/inline_spec.rb +10 -10
- data/spec/asciidoctor-standoc/lists_spec.rb +3 -3
- data/spec/asciidoctor-standoc/macros_spec.rb +30 -7
- data/spec/asciidoctor-standoc/refs_dl_spec.rb +3 -3
- data/spec/asciidoctor-standoc/refs_spec.rb +43 -13
- data/spec/asciidoctor-standoc/section_spec.rb +81 -63
- data/spec/asciidoctor-standoc/table_spec.rb +4 -4
- data/spec/spec_helper.rb +9 -0
- metadata +4 -4
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe Asciidoctor::Standoc do
|
4
4
|
it "processes inline_quoted formatting" do
|
5
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
5
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
6
6
|
#{DUMBQUOTE_BLANK_HDR}
|
7
7
|
_Physical noise
|
8
8
|
sources_
|
@@ -44,7 +44,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
it "properly handles inline substitution" do
|
47
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
47
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
48
48
|
#{DUMBQUOTE_BLANK_HDR}
|
49
49
|
|
50
50
|
stem:[n < 1] +
|
@@ -62,7 +62,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
62
62
|
end
|
63
63
|
|
64
64
|
it "normalises inline stem" do
|
65
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
65
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
66
66
|
#{DUMBQUOTE_BLANK_HDR}
|
67
67
|
|
68
68
|
stem:[n < 1]
|
@@ -80,7 +80,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
80
80
|
end
|
81
81
|
|
82
82
|
it "generates desired smart quotes for 'dd'" do
|
83
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
83
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
84
84
|
#{ASCIIDOC_BLANK_HDR}
|
85
85
|
'99'.
|
86
86
|
|
@@ -94,7 +94,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
94
94
|
|
95
95
|
|
96
96
|
it "processes breaks" do
|
97
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
97
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
98
98
|
#{ASCIIDOC_BLANK_HDR}
|
99
99
|
Line break +
|
100
100
|
line break
|
@@ -113,7 +113,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
113
113
|
end
|
114
114
|
|
115
115
|
it "processes links" do
|
116
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
116
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
117
117
|
#{ASCIIDOC_BLANK_HDR}
|
118
118
|
mailto:fred@example.com
|
119
119
|
http://example.com[]
|
@@ -132,7 +132,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
132
132
|
end
|
133
133
|
|
134
134
|
it "processes bookmarks" do
|
135
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
135
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
136
136
|
#{ASCIIDOC_BLANK_HDR}
|
137
137
|
Text [[bookmark]] Text
|
138
138
|
INPUT
|
@@ -145,7 +145,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
145
145
|
end
|
146
146
|
|
147
147
|
it "processes crossreferences" do
|
148
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
148
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
149
149
|
#{ASCIIDOC_BLANK_HDR}
|
150
150
|
[[reference]]
|
151
151
|
== Section
|
@@ -172,7 +172,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
172
172
|
end
|
173
173
|
|
174
174
|
it "processes bibliographic anchors" do
|
175
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
175
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
176
176
|
#{ASCIIDOC_BLANK_HDR}
|
177
177
|
[bibliography]
|
178
178
|
== Normative References
|
@@ -202,7 +202,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
202
202
|
end
|
203
203
|
|
204
204
|
it "processes footnotes" do
|
205
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
205
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
206
206
|
#{ASCIIDOC_BLANK_HDR}
|
207
207
|
Hello!footnote:[Footnote text]
|
208
208
|
|
@@ -16,7 +16,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
16
16
|
List F:: List G
|
17
17
|
|
18
18
|
INPUT
|
19
|
-
expect(strip_guid(output)).to be_equivalent_to <<~"OUTPUT"
|
19
|
+
expect(xmlpp(strip_guid(output))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
20
20
|
#{BLANK_HDR}
|
21
21
|
<sections>
|
22
22
|
<ul id="_">
|
@@ -98,7 +98,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
98
98
|
Note 3.
|
99
99
|
|
100
100
|
INPUT
|
101
|
-
expect(strip_guid(output)).to be_equivalent_to <<~"OUTPUT"
|
101
|
+
expect(xmlpp(strip_guid(output))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
102
102
|
#{BLANK_HDR}
|
103
103
|
<sections><ul id="id">
|
104
104
|
<li>
|
@@ -165,7 +165,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
165
165
|
end
|
166
166
|
|
167
167
|
it "anchors lists and list items" do
|
168
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
168
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
169
169
|
#{ASCIIDOC_BLANK_HDR}
|
170
170
|
[[id1]]
|
171
171
|
* [[id2]] List item
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe Asciidoctor::Standoc do
|
4
4
|
it "processes the Asciidoctor::Standoc inline macros" do
|
5
|
-
expect(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)).to be_equivalent_to <<~"OUTPUT"
|
5
|
+
expect(xmlpp(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
6
6
|
#{ASCIIDOC_BLANK_HDR}
|
7
7
|
alt:[term1]
|
8
8
|
deprecated:[term1]
|
@@ -19,7 +19,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
it "processes the TODO custom admonition" do
|
22
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
22
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
23
23
|
#{ASCIIDOC_BLANK_HDR}
|
24
24
|
TODO: Note1
|
25
25
|
|
@@ -45,8 +45,31 @@ RSpec.describe Asciidoctor::Standoc do
|
|
45
45
|
OUTPUT
|
46
46
|
end
|
47
47
|
|
48
|
+
it "generates pseudocode examples, with formatting and initial indentation" do
|
49
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
50
|
+
#{ASCIIDOC_BLANK_HDR}
|
51
|
+
|
52
|
+
[pseudocode]
|
53
|
+
====
|
54
|
+
*A* +
|
55
|
+
[smallcap]#B#
|
56
|
+
|
57
|
+
_C_
|
58
|
+
====
|
59
|
+
INPUT
|
60
|
+
#{BLANK_HDR}
|
61
|
+
<sections>
|
62
|
+
<figure id="_" class="pseudocode"><p id="_"> <strong>A</strong><br/>
|
63
|
+
<smallcap>B</smallcap></p>
|
64
|
+
<p id="_"> <em>C</em></p></figure>
|
65
|
+
</sections>
|
66
|
+
</standard-document>
|
67
|
+
OUTPUT
|
68
|
+
end
|
69
|
+
|
70
|
+
|
48
71
|
it "processes the Ruby markups" do
|
49
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
72
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
50
73
|
#{ASCIIDOC_BLANK_HDR}
|
51
74
|
|
52
75
|
ruby:楽聖少女[がくせいしょうじょ]
|
@@ -62,7 +85,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
62
85
|
end
|
63
86
|
|
64
87
|
it "processes the PlantUML macro" do
|
65
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)).gsub(%r{plantuml/[^.]{36}\.}, "plantuml/_.")).to be_equivalent_to <<~"OUTPUT"
|
88
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)).gsub(%r{plantuml/[^.]{36}\.}, "plantuml/_."))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
66
89
|
#{ASCIIDOC_BLANK_HDR}
|
67
90
|
|
68
91
|
[plantuml]
|
@@ -113,7 +136,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
113
136
|
end
|
114
137
|
|
115
138
|
it "processes the PlantUML macro with imagesdir" do
|
116
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)).gsub(%r{spec/assets/[^.]+\.}, "spec/assets/_.")).to be_equivalent_to <<~"OUTPUT"
|
139
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)).gsub(%r{spec/assets/[^.]+\.}, "spec/assets/_."))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
117
140
|
= Document title
|
118
141
|
Author
|
119
142
|
:docfile: test.adoc
|
@@ -161,7 +184,7 @@ OUTPUT
|
|
161
184
|
INPUT
|
162
185
|
|
163
186
|
mock_plantuml_disabled
|
164
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
187
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
165
188
|
#{ASCIIDOC_BLANK_HDR}
|
166
189
|
|
167
190
|
[plantuml]
|
@@ -184,7 +207,7 @@ Bob --> Alice: Authentication Response
|
|
184
207
|
Alice -> Bob: Another authentication Request
|
185
208
|
Alice <-- Bob: another authentication Response
|
186
209
|
@enduml</sourcecode>
|
187
|
-
</
|
210
|
+
</sections>
|
188
211
|
</standard-document>
|
189
212
|
OUTPUT
|
190
213
|
end
|
@@ -3,7 +3,7 @@ require "relaton_iso"
|
|
3
3
|
|
4
4
|
RSpec.describe Asciidoctor::Standoc do
|
5
5
|
it "processes simple dl reference" do
|
6
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
6
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
7
7
|
#{ASCIIDOC_BLANK_HDR}
|
8
8
|
[bibliography]
|
9
9
|
== Normative References
|
@@ -71,7 +71,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
71
71
|
end
|
72
72
|
|
73
73
|
it "processes complex dl reference" do
|
74
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
74
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
75
75
|
#{ASCIIDOC_BLANK_HDR}
|
76
76
|
[bibliography]
|
77
77
|
== Normative References
|
@@ -440,7 +440,7 @@ OUTPUT
|
|
440
440
|
end
|
441
441
|
|
442
442
|
it "processes complex dl reference with dot path keys" do
|
443
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
443
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
444
444
|
#{ASCIIDOC_BLANK_HDR}
|
445
445
|
[bibliography]
|
446
446
|
== Normative References
|
@@ -4,7 +4,7 @@ require "relaton_ietf"
|
|
4
4
|
|
5
5
|
RSpec.describe Asciidoctor::Standoc do
|
6
6
|
it "processes simple ISO reference" do
|
7
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
7
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp( <<~"OUTPUT")
|
8
8
|
#{ASCIIDOC_BLANK_HDR}
|
9
9
|
[bibliography]
|
10
10
|
== Normative References
|
@@ -33,7 +33,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
it "processes simple ISO reference with date range" do
|
36
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
36
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp( <<~"OUTPUT")
|
37
37
|
#{ASCIIDOC_BLANK_HDR}
|
38
38
|
[bibliography]
|
39
39
|
== Normative References
|
@@ -74,7 +74,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
74
74
|
|
75
75
|
* [[[iso123,ISO 123]]] _Standard_
|
76
76
|
INPUT
|
77
|
-
expect(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
77
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp( <<~"OUTPUT")
|
78
78
|
#{BLANK_HDR}
|
79
79
|
<sections>
|
80
80
|
</sections><bibliography><references id="_" obligation="informative"><title>Normative References</title>
|
@@ -131,7 +131,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
131
131
|
it "fetches simple ISO reference" do
|
132
132
|
# mock_isobib_get_123
|
133
133
|
VCR.use_cassette "isobib_get_123" do
|
134
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
134
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp( <<~"OUTPUT")
|
135
135
|
#{ISOBIB_BLANK_HDR}
|
136
136
|
[bibliography]
|
137
137
|
== Normative References
|
@@ -246,7 +246,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
246
246
|
end
|
247
247
|
|
248
248
|
it "processes simple IEC reference" do
|
249
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
249
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp( <<~"OUTPUT")
|
250
250
|
#{ASCIIDOC_BLANK_HDR}
|
251
251
|
[bibliography]
|
252
252
|
== Normative References
|
@@ -278,7 +278,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
278
278
|
# mock_isobib_get_iec12382
|
279
279
|
# mock_isobib_get_124
|
280
280
|
VCR.use_cassette "dated_iso_ref_joint_iso_iec" do
|
281
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
281
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp( <<~"OUTPUT")
|
282
282
|
#{ISOBIB_BLANK_HDR}
|
283
283
|
[bibliography]
|
284
284
|
== Normative References
|
@@ -398,12 +398,14 @@ RSpec.describe Asciidoctor::Standoc do
|
|
398
398
|
it "processes draft ISO reference" do
|
399
399
|
#stub_fetch_ref no_year: true, note: "The standard is in press"
|
400
400
|
|
401
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
401
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp( <<~"OUTPUT")
|
402
402
|
#{ASCIIDOC_BLANK_HDR}
|
403
403
|
[bibliography]
|
404
404
|
== Normative References
|
405
405
|
|
406
|
-
* [[[iso123,ISO 123:--]]]
|
406
|
+
* [[[iso123,ISO 123:--]]] _Standard_
|
407
|
+
* [[[iso124,ISO 124:—]]]{blank}footnote:[The standard is in press] _Standard_
|
408
|
+
* [[[iso125,ISO 125:–]]], footnote:[The standard is in press] _Standard_
|
407
409
|
INPUT
|
408
410
|
#{BLANK_HDR}
|
409
411
|
<sections>
|
@@ -422,6 +424,33 @@ RSpec.describe Asciidoctor::Standoc do
|
|
422
424
|
<name>ISO</name>
|
423
425
|
</organization>
|
424
426
|
</contributor>
|
427
|
+
</bibitem>
|
428
|
+
<bibitem id="iso124" type="standard">
|
429
|
+
<title format="text/plain">Standard</title>
|
430
|
+
<docidentifier>ISO 124:–</docidentifier>
|
431
|
+
<date type="published">
|
432
|
+
<on>--</on>
|
433
|
+
</date>
|
434
|
+
<contributor>
|
435
|
+
<role type="publisher"/>
|
436
|
+
<organization>
|
437
|
+
<name>ISO</name>
|
438
|
+
</organization>
|
439
|
+
</contributor>
|
440
|
+
<note format="text/plain">ISO DATE: The standard is in press</note>
|
441
|
+
</bibitem>
|
442
|
+
<bibitem id="iso125" type="standard">
|
443
|
+
<title format="text/plain">Standard</title>
|
444
|
+
<docidentifier>ISO 125:–</docidentifier>
|
445
|
+
<date type="published">
|
446
|
+
<on>--</on>
|
447
|
+
</date>
|
448
|
+
<contributor>
|
449
|
+
<role type="publisher"/>
|
450
|
+
<organization>
|
451
|
+
<name>ISO</name>
|
452
|
+
</organization>
|
453
|
+
</contributor>
|
425
454
|
<note format="text/plain">ISO DATE: The standard is in press</note>
|
426
455
|
</bibitem>
|
427
456
|
</references>
|
@@ -433,7 +462,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
433
462
|
it "processes all-parts ISO reference" do
|
434
463
|
#stub_fetch_ref(all_parts: true)
|
435
464
|
|
436
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
465
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp( <<~"OUTPUT")
|
437
466
|
#{ASCIIDOC_BLANK_HDR}
|
438
467
|
[bibliography]
|
439
468
|
== Normative References
|
@@ -470,7 +499,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
470
499
|
it "processes RFC reference in Normative References" do
|
471
500
|
# mock_rfcbib_get_rfc8341
|
472
501
|
VCR.use_cassette "rfcbib_get_rfc8341" do
|
473
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
502
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp( <<~"OUTPUT")
|
474
503
|
#{ISOBIB_BLANK_HDR}
|
475
504
|
[bibliography]
|
476
505
|
== Normative References
|
@@ -495,6 +524,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
495
524
|
<bibitem id="iso123">
|
496
525
|
<fetched>#{Date.today}</fetched>
|
497
526
|
<title format="text/plain" language="en" script="Latn">Network Configuration Access Control Model</title>
|
527
|
+
<uri type='xml'>https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8341.xml</uri>
|
498
528
|
<uri type="src">https://www.rfc-editor.org/info/rfc8341</uri>
|
499
529
|
<docidentifier type="IETF">RFC 8341</docidentifier>
|
500
530
|
<docidentifier type="DOI">10.17487/RFC8341</docidentifier>
|
@@ -549,7 +579,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
549
579
|
end
|
550
580
|
|
551
581
|
it "processes non-ISO reference in Normative References" do
|
552
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
582
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp( <<~"OUTPUT")
|
553
583
|
#{ASCIIDOC_BLANK_HDR}
|
554
584
|
[bibliography]
|
555
585
|
== Normative References
|
@@ -575,7 +605,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
575
605
|
end
|
576
606
|
|
577
607
|
it "processes non-ISO reference in Bibliography" do
|
578
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
608
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp( <<~"OUTPUT")
|
579
609
|
#{ASCIIDOC_BLANK_HDR}
|
580
610
|
[bibliography]
|
581
611
|
== Bibliography
|
@@ -621,7 +651,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
621
651
|
expect(RelatonIso::IsoBibliography).to receive(:search).with("ISO 123") do
|
622
652
|
raise RelatonBib::RequestError.new "getaddrinfo"
|
623
653
|
end.at_least :once
|
624
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
654
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp( <<~"OUTPUT")
|
625
655
|
#{ISOBIB_BLANK_HDR}
|
626
656
|
[bibliography]
|
627
657
|
== Normative References
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe Asciidoctor::Standoc do
|
4
4
|
it "processes sections" do
|
5
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))
|
5
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
6
6
|
#{ASCIIDOC_BLANK_HDR}
|
7
7
|
.Foreword
|
8
8
|
|
@@ -75,6 +75,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
75
75
|
|
76
76
|
=== Bibliography Subsection
|
77
77
|
INPUT
|
78
|
+
#{BLANK_HDR.sub(/<status>/, "<abstract> <p id='_'>Text</p> </abstract><status>")}
|
78
79
|
<preface><abstract id="_">
|
79
80
|
<p id="_">Text</p>
|
80
81
|
</abstract><foreword obligation="informative">
|
@@ -166,7 +167,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
166
167
|
end
|
167
168
|
|
168
169
|
it "processes sections with language and script attributes" do
|
169
|
-
|
170
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
170
171
|
#{ASCIIDOC_BLANK_HDR}
|
171
172
|
.Foreword
|
172
173
|
|
@@ -262,6 +263,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
262
263
|
[language=en,script=Latn]
|
263
264
|
=== Bibliography Subsection
|
264
265
|
INPUT
|
266
|
+
#{BLANK_HDR.sub(/<status>/, "<abstract> <p id='_'>Text</p> </abstract><status>")}
|
265
267
|
<preface><abstract id="_" language="en" script="Latn">
|
266
268
|
<p id="_">Text</p>
|
267
269
|
</abstract><foreword obligation="informative">
|
@@ -353,7 +355,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
353
355
|
end
|
354
356
|
|
355
357
|
it "processes sections with title attributes" do
|
356
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))
|
358
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
357
359
|
#{ASCIIDOC_BLANK_HDR}
|
358
360
|
.Foreword
|
359
361
|
|
@@ -406,63 +408,79 @@ RSpec.describe Asciidoctor::Standoc do
|
|
406
408
|
|
407
409
|
=== Bibliography Subsection
|
408
410
|
INPUT
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
411
|
+
#{BLANK_HDR.sub(/<status>/, "<abstract> <p id='_'>Text</p> </abstract><status>")}
|
412
|
+
<preface>
|
413
|
+
<abstract id='_'>
|
414
|
+
<p id='_'>Text</p>
|
415
|
+
</abstract>
|
416
|
+
<foreword obligation='informative'>
|
417
|
+
<title>Foreword</title>
|
418
|
+
<p id='_'>Text</p>
|
419
|
+
</foreword>
|
420
|
+
<introduction id='_' obligation='informative'>
|
421
|
+
<title>Introduction</title>
|
422
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
423
|
+
<title>Introduction Subsection</title>
|
424
|
+
</clause>
|
425
|
+
</introduction>
|
426
|
+
</preface>
|
427
|
+
<sections>
|
428
|
+
<terms id='_' obligation='normative'>
|
429
|
+
<title>Terms and definitions</title>
|
430
|
+
<p>For the purposes of this document, the following terms and definitions apply.</p>
|
431
|
+
<term id='_'>
|
432
|
+
<preferred>Term1</preferred>
|
433
|
+
</term>
|
434
|
+
</terms>
|
435
|
+
<clause id='_' obligation='normative'>
|
436
|
+
<title>Terms and definitions</title>
|
437
|
+
<terms id='_' obligation='normative'>
|
438
|
+
<title>Normal Terms</title>
|
439
|
+
<term id='_'>
|
440
|
+
<preferred>Term2</preferred>
|
441
|
+
</term>
|
442
|
+
</terms>
|
443
|
+
<definitions id='_'>
|
444
|
+
<title>Σύμβολα και Συντομογραφίες</title>
|
445
|
+
</definitions>
|
446
|
+
</clause>
|
447
|
+
<definitions id='_'>
|
448
|
+
<title>Σύμβολα και Συντομογραφίες</title>
|
449
|
+
</definitions>
|
450
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
451
|
+
<title>Clause 4</title>
|
452
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
453
|
+
<title>Introduction</title>
|
454
|
+
</clause>
|
455
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
456
|
+
<title>Clause 4.2</title>
|
457
|
+
</clause>
|
458
|
+
</clause>
|
459
|
+
</sections>
|
460
|
+
<annex id='_' inline-header='false' obligation='normative'>
|
461
|
+
<title>Annex</title>
|
462
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
463
|
+
<title>Annex A.1</title>
|
464
|
+
</clause>
|
465
|
+
</annex>
|
466
|
+
<bibliography>
|
467
|
+
<references id='_' obligation='informative'>
|
468
|
+
<title>Normative References</title>
|
469
|
+
<p>There are no normative references in this document.</p>
|
470
|
+
</references>
|
471
|
+
<clause id='_' obligation='informative'>
|
472
|
+
<title>Bibliography</title>
|
473
|
+
<references id='_' obligation='informative'>
|
474
|
+
<title>Bibliography Subsection</title>
|
475
|
+
</references>
|
476
|
+
</clause>
|
477
|
+
</bibliography>
|
478
|
+
</standard-document>
|
461
479
|
OUTPUT
|
462
480
|
end
|
463
481
|
|
464
482
|
it "processes section obligations" do
|
465
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
483
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
466
484
|
#{ASCIIDOC_BLANK_HDR}
|
467
485
|
[obligation=informative]
|
468
486
|
== Clause 1
|
@@ -493,7 +511,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
493
511
|
end
|
494
512
|
|
495
513
|
it "processes inline headers" do
|
496
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
514
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
497
515
|
#{ASCIIDOC_BLANK_HDR}
|
498
516
|
== Clause 1
|
499
517
|
|
@@ -524,7 +542,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
524
542
|
end
|
525
543
|
|
526
544
|
it "processes blank headers" do
|
527
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
545
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
528
546
|
#{ASCIIDOC_BLANK_HDR}
|
529
547
|
== Clause 1
|
530
548
|
|
@@ -544,7 +562,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
544
562
|
end
|
545
563
|
|
546
564
|
it "processes terms & definitions with external source" do
|
547
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
565
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
548
566
|
#{ASCIIDOC_BLANK_HDR}
|
549
567
|
|
550
568
|
Foreword
|
@@ -574,7 +592,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
574
592
|
end
|
575
593
|
|
576
594
|
it "processes empty terms & definitions" do
|
577
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
595
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
578
596
|
#{ASCIIDOC_BLANK_HDR}
|
579
597
|
|
580
598
|
Foreword
|
@@ -598,7 +616,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
598
616
|
|
599
617
|
|
600
618
|
it "processes empty terms & definitions with external source" do
|
601
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
619
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
602
620
|
#{ASCIIDOC_BLANK_HDR}
|
603
621
|
|
604
622
|
Foreword
|
@@ -626,7 +644,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
626
644
|
end
|
627
645
|
|
628
646
|
it "processes term document sources in French" do
|
629
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
647
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
630
648
|
= Document title
|
631
649
|
Author
|
632
650
|
:docfile: test.adoc
|
@@ -659,7 +677,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
659
677
|
end
|
660
678
|
|
661
679
|
it "processes term document sources in Chinese" do
|
662
|
-
expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
|
680
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
663
681
|
= Document title
|
664
682
|
Author
|
665
683
|
:docfile: test.adoc
|