metanorma-standoc 2.2.5 → 2.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/html/htmlstyle.css +1 -1
- data/lib/metanorma/standoc/base.rb +4 -5
- data/lib/metanorma/standoc/basicdoc.rng +0 -27
- data/lib/metanorma/standoc/biblio-standoc.rng +164 -0
- data/lib/metanorma/standoc/biblio.rng +50 -18
- data/lib/metanorma/standoc/cleanup.rb +18 -17
- data/lib/metanorma/standoc/cleanup_amend.rb +2 -2
- data/lib/metanorma/standoc/cleanup_asciibib.rb +110 -0
- data/lib/metanorma/standoc/cleanup_biblio.rb +7 -112
- data/lib/metanorma/standoc/cleanup_block.rb +7 -6
- data/lib/metanorma/standoc/cleanup_boilerplate.rb +6 -6
- data/lib/metanorma/standoc/cleanup_inline.rb +2 -2
- data/lib/metanorma/standoc/cleanup_maths.rb +12 -4
- data/lib/metanorma/standoc/cleanup_section.rb +19 -9
- data/lib/metanorma/standoc/cleanup_symbols.rb +14 -7
- data/lib/metanorma/standoc/cleanup_text.rb +19 -6
- data/lib/metanorma/standoc/cleanup_toc.rb +1 -2
- data/lib/metanorma/standoc/cleanup_xref.rb +55 -14
- data/lib/metanorma/standoc/inline.rb +29 -12
- data/lib/metanorma/standoc/isodoc-compile.rng +7 -0
- data/lib/metanorma/standoc/isodoc.rng +69 -207
- data/lib/metanorma/standoc/ref_utility.rb +1 -0
- data/lib/metanorma/standoc/render.rb +10 -1
- data/lib/metanorma/standoc/section.rb +10 -3
- data/lib/metanorma/standoc/utils.rb +6 -1
- data/lib/metanorma/standoc/validate.rb +9 -9
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +5 -3
- metadata +7 -141
- data/.github/workflows/rake.yml +0 -15
- data/.github/workflows/release.yml +0 -24
- data/Rakefile +0 -8
- data/bin/rspec +0 -18
- data/spec/assets/a1.adoc +0 -8
- data/spec/assets/a2.adoc +0 -10
- data/spec/assets/a3.adoc +0 -9
- data/spec/assets/a3a.adoc +0 -7
- data/spec/assets/a4.adoc +0 -4
- data/spec/assets/boilerplate.xml +0 -4
- data/spec/assets/codes.yml +0 -695
- data/spec/assets/correct.png +0 -0
- data/spec/assets/corrupt.png +0 -0
- data/spec/assets/header.html +0 -7
- data/spec/assets/html-override.css +0 -1
- data/spec/assets/html.scss +0 -13
- data/spec/assets/htmlcover.html +0 -4
- data/spec/assets/htmlintro.html +0 -5
- data/spec/assets/i18n.yaml +0 -17
- data/spec/assets/iso.adoc +0 -10
- data/spec/assets/iso.headless.html +0 -33
- data/spec/assets/iso.xml +0 -8
- data/spec/assets/iso123.rxl +0 -107
- data/spec/assets/rice_image1.png +0 -0
- data/spec/assets/scripts.html +0 -3
- data/spec/assets/std.css +0 -2
- data/spec/assets/word-override.css +0 -1
- data/spec/assets/word.scss +0 -13
- data/spec/assets/wordcover.html +0 -3
- data/spec/assets/wordintro.html +0 -4
- data/spec/assets/xref_error.adoc +0 -8
- data/spec/examples/103_01_02.html +0 -247
- data/spec/examples/codes_table.html +0 -3174
- data/spec/examples/datamodel/address_class_profile.adoc +0 -5
- data/spec/examples/datamodel/address_class_profile.presentation.xml +0 -14
- data/spec/examples/datamodel/address_component_profile.adoc +0 -5
- data/spec/examples/datamodel/blank_definition_profile.adoc +0 -5
- data/spec/examples/datamodel/common_models_diagram.adoc +0 -5
- data/spec/examples/datamodel/models/models/AddressClassProfile.yml +0 -90
- data/spec/examples/datamodel/models/models/AddressComponentProfile.yml +0 -63
- data/spec/examples/datamodel/models/models/AddressComponentSpecification.yml +0 -15
- data/spec/examples/datamodel/models/models/AddressProfile.yml +0 -36
- data/spec/examples/datamodel/models/models/AttributeProfile.yml +0 -32
- data/spec/examples/datamodel/models/models/InterchangeAddressClassProfile.yml +0 -79
- data/spec/examples/datamodel/models/models/Localization copy.yml +0 -23
- data/spec/examples/datamodel/models/models/Localization.yml +0 -23
- data/spec/examples/datamodel/models/models/ProfileCompliantAddress.yml +0 -36
- data/spec/examples/datamodel/models/models/ProfileCompliantAddressComponent.yml +0 -15
- data/spec/examples/datamodel/models/models/Signature.yml +0 -20
- data/spec/examples/datamodel/models/models/SignatureBlankDefinition.yml +0 -20
- data/spec/examples/datamodel/models/models/TextDirectionCode copy.yml +0 -16
- data/spec/examples/datamodel/models/models/TextDirectionCode.yml +0 -16
- data/spec/examples/datamodel/models/models/Validity.yml +0 -14
- data/spec/examples/datamodel/models/models/iso19160-1/Address.yml +0 -22
- data/spec/examples/datamodel/models/models/iso19160-1/AddressComponent.yml +0 -2
- data/spec/examples/datamodel/models/style.uml.inc +0 -37
- data/spec/examples/datamodel/models/views/CommonModels.yml +0 -9
- data/spec/examples/datamodel/models/views/TopDown.yml +0 -62
- data/spec/examples/datamodel/top_down_diagram.adoc +0 -5
- data/spec/examples/english.yaml +0 -69
- data/spec/examples/iso_123_.xml +0 -46
- data/spec/examples/iso_123_all_parts.xml +0 -46
- data/spec/examples/iso_123_no_year_note.xml +0 -47
- data/spec/examples/iso_124_.xml +0 -42
- data/spec/examples/iso_216_.xml +0 -48
- data/spec/examples/iso_iec_12382_.xml +0 -49
- data/spec/examples/rice.adoc +0 -715
- data/spec/examples/rice.preview.html +0 -1877
- data/spec/examples/rice.sh +0 -4
- data/spec/examples/rice_images/rice_image1.png +0 -0
- data/spec/examples/rice_images/rice_image2.png +0 -0
- data/spec/examples/rice_images/rice_image3_1.png +0 -0
- data/spec/examples/rice_images/rice_image3_2.png +0 -0
- data/spec/examples/rice_images/rice_image3_3.png +0 -0
- data/spec/fixtures/action_schemaexpg1.svg +0 -122
- data/spec/fixtures/datamodel_description_sections_tree.xml +0 -327
- data/spec/fixtures/diagram_definitions.lutaml +0 -22
- data/spec/fixtures/macros_datamodel/address_class_profile.xml +0 -149
- data/spec/fixtures/macros_datamodel/address_component_profile.xml +0 -71
- data/spec/fixtures/macros_datamodel/blank_definition_profile.xml +0 -51
- data/spec/fixtures/macros_datamodel/common_models_diagram.xml +0 -7
- data/spec/fixtures/macros_datamodel/top_down_diagram.xml +0 -7
- data/spec/fixtures/test.exp +0 -121
- data/spec/fixtures/test.xmi +0 -9250
- data/spec/metanorma/base_spec.rb +0 -1125
- data/spec/metanorma/biblio_spec.rb +0 -1004
- data/spec/metanorma/blank_spec.rb +0 -37
- data/spec/metanorma/blocks_spec.rb +0 -1784
- data/spec/metanorma/cleanup_blocks_spec.rb +0 -1099
- data/spec/metanorma/cleanup_sections_spec.rb +0 -1850
- data/spec/metanorma/cleanup_spec.rb +0 -1920
- data/spec/metanorma/cleanup_terms_spec.rb +0 -1543
- data/spec/metanorma/datamodel/attributes_table_preprocessor_spec.rb +0 -111
- data/spec/metanorma/datamodel/diagram_preprocessor_spec.rb +0 -72
- data/spec/metanorma/inline_spec.rb +0 -724
- data/spec/metanorma/isobib_cache_spec.rb +0 -742
- data/spec/metanorma/lists_spec.rb +0 -232
- data/spec/metanorma/macros_concept_spec.rb +0 -1052
- data/spec/metanorma/macros_json2text_spec.rb +0 -10
- data/spec/metanorma/macros_plantuml_spec.rb +0 -402
- data/spec/metanorma/macros_spec.rb +0 -1183
- data/spec/metanorma/macros_yaml2text_spec.rb +0 -10
- data/spec/metanorma/processor_spec.rb +0 -96
- data/spec/metanorma/refs_spec.rb +0 -2807
- data/spec/metanorma/reqt_spec.rb +0 -130
- data/spec/metanorma/section_spec.rb +0 -1325
- data/spec/metanorma/table_spec.rb +0 -474
- data/spec/metanorma/validate_spec.rb +0 -886
- data/spec/spec_helper.rb +0 -290
- data/spec/support/shared_examples/structured_data_2_text_preprocessor.rb +0 -781
- data/spec/vcr_cassettes/bsi16341.yml +0 -488
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +0 -611
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +0 -149
- data/spec/vcr_cassettes/hide_refs.yml +0 -587
- data/spec/vcr_cassettes/isobib_get_123.yml +0 -149
- data/spec/vcr_cassettes/isobib_get_123_1.yml +0 -295
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +0 -385
- data/spec/vcr_cassettes/isobib_get_123_2.yml +0 -295
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +0 -149
- data/spec/vcr_cassettes/isobib_get_124.yml +0 -149
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +0 -351
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +0 -560
- data/spec/vcr_cassettes/std-link.yml +0 -149
@@ -1,1850 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
require "relaton_iec"
|
3
|
-
require "fileutils"
|
4
|
-
|
5
|
-
RSpec.describe Metanorma::Standoc do
|
6
|
-
=begin
|
7
|
-
it "appends any initial user-supplied text to boilerplate in terms and definitions" do
|
8
|
-
input = <<~INPUT
|
9
|
-
#{ASCIIDOC_BLANK_HDR}
|
10
|
-
== Terms and Definitions
|
11
|
-
|
12
|
-
I am boilerplate
|
13
|
-
|
14
|
-
* So am I
|
15
|
-
|
16
|
-
=== Time
|
17
|
-
|
18
|
-
This paragraph is extraneous
|
19
|
-
INPUT
|
20
|
-
output = <<~OUTPUT
|
21
|
-
#{BLANK_HDR}
|
22
|
-
<sections>
|
23
|
-
<terms id="_" obligation="normative"><title>Terms and definitions</title>
|
24
|
-
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
25
|
-
<p id='_'>I am boilerplate</p>
|
26
|
-
<ul id='_'>
|
27
|
-
<li>
|
28
|
-
<p id='_'>So am I</p>
|
29
|
-
</li>
|
30
|
-
</ul>
|
31
|
-
<term id="term-Time">
|
32
|
-
<preferred><expression><name>Time</name></expression></preferred>
|
33
|
-
<definition><verbal-definition><p id="_">This paragraph is extraneous</p></verbal-definition></definition>
|
34
|
-
</term></terms>
|
35
|
-
</sections>
|
36
|
-
</standard-document>
|
37
|
-
OUTPUT
|
38
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
39
|
-
.to be_equivalent_to xmlpp(output)
|
40
|
-
end
|
41
|
-
|
42
|
-
it "removes initial extraneous material from Normative References" do
|
43
|
-
input = <<~INPUT
|
44
|
-
#{ASCIIDOC_BLANK_HDR}
|
45
|
-
[bibliography]
|
46
|
-
== Normative References
|
47
|
-
|
48
|
-
This is extraneous information
|
49
|
-
|
50
|
-
* [[[iso216,ISO 216]]], _Reference_
|
51
|
-
|
52
|
-
This is also extraneous information
|
53
|
-
INPUT
|
54
|
-
output = <<~OUTPUT
|
55
|
-
#{BLANK_HDR}
|
56
|
-
<sections></sections>
|
57
|
-
<bibliography><references id="_" obligation="informative" normative="true"><title>Normative references</title>
|
58
|
-
#{NORM_REF_BOILERPLATE}
|
59
|
-
<bibitem id="iso216" type="standard">
|
60
|
-
<title format="text/plain">Reference</title>
|
61
|
-
<docidentifier>ISO 216</docidentifier>
|
62
|
-
<docnumber>216</docnumber>
|
63
|
-
<contributor>
|
64
|
-
<role type="publisher"/>
|
65
|
-
<organization>
|
66
|
-
<name>ISO</name>
|
67
|
-
</organization>
|
68
|
-
</contributor>
|
69
|
-
</bibitem>
|
70
|
-
<p id='_'>This is also extraneous information</p>
|
71
|
-
</references>
|
72
|
-
</bibliography>
|
73
|
-
</standard-document>
|
74
|
-
OUTPUT
|
75
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
76
|
-
.to be_equivalent_to xmlpp(output)
|
77
|
-
end
|
78
|
-
|
79
|
-
it "preserves user-supplied boilerplate in Normative References" do
|
80
|
-
input = <<~INPUT
|
81
|
-
#{ASCIIDOC_BLANK_HDR}
|
82
|
-
[bibliography]
|
83
|
-
== Normative References
|
84
|
-
|
85
|
-
[NOTE,type=boilerplate]
|
86
|
-
--
|
87
|
-
This is extraneous information
|
88
|
-
--
|
89
|
-
|
90
|
-
* [[[iso216,ISO 216]]], _Reference_
|
91
|
-
|
92
|
-
This is also extraneous information
|
93
|
-
INPUT
|
94
|
-
output = <<~OUTPUT
|
95
|
-
#{BLANK_HDR}
|
96
|
-
<sections></sections>
|
97
|
-
<bibliography><references id="_" obligation="informative" normative="true"><title>Normative references</title>
|
98
|
-
<p id='_'>This is extraneous information</p>
|
99
|
-
<bibitem id="iso216" type="standard">
|
100
|
-
<title format="text/plain">Reference</title>
|
101
|
-
<docidentifier>ISO 216</docidentifier>
|
102
|
-
<docnumber>216</docnumber>
|
103
|
-
<contributor>
|
104
|
-
<role type="publisher"/>
|
105
|
-
<organization>
|
106
|
-
<name>ISO</name>
|
107
|
-
</organization>
|
108
|
-
</contributor>
|
109
|
-
</bibitem>
|
110
|
-
<p id='_'>This is also extraneous information</p>
|
111
|
-
</references>
|
112
|
-
</bibliography>
|
113
|
-
</standard-document>
|
114
|
-
OUTPUT
|
115
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
116
|
-
.to be_equivalent_to xmlpp(output)
|
117
|
-
end
|
118
|
-
|
119
|
-
it "sorts references with their notes in Bibliography" do
|
120
|
-
input = <<~INPUT
|
121
|
-
#{ASCIIDOC_BLANK_HDR}
|
122
|
-
[bibliography]
|
123
|
-
== Bibliography
|
124
|
-
|
125
|
-
This is extraneous information
|
126
|
-
|
127
|
-
* [[[iso216,ISO 216]]], _Reference_
|
128
|
-
|
129
|
-
NOTE: ABC
|
130
|
-
|
131
|
-
NOTE: DEF
|
132
|
-
|
133
|
-
This is further extraneous information
|
134
|
-
|
135
|
-
NOTE: GHI
|
136
|
-
|
137
|
-
* [[[iso216,ISO 215]]], _Reference_
|
138
|
-
|
139
|
-
NOTE: JKL
|
140
|
-
|
141
|
-
This is also extraneous information
|
142
|
-
INPUT
|
143
|
-
output = <<~OUTPUT
|
144
|
-
#{BLANK_HDR}
|
145
|
-
<sections> </sections>
|
146
|
-
<bibliography>
|
147
|
-
<references id='_' obligation='informative' normative="false">
|
148
|
-
<title>Bibliography</title>
|
149
|
-
<p id='_'>This is extraneous information</p>
|
150
|
-
<bibitem id='iso216' type='standard'>
|
151
|
-
<title format='text/plain'>Reference</title>
|
152
|
-
<docidentifier>ISO 216</docidentifier>
|
153
|
-
<docnumber>216</docnumber>
|
154
|
-
<contributor>
|
155
|
-
<role type='publisher'/>
|
156
|
-
<organization>
|
157
|
-
<name>ISO</name>
|
158
|
-
</organization>
|
159
|
-
</contributor>
|
160
|
-
</bibitem>
|
161
|
-
<note id='_'>
|
162
|
-
<p id='_'>ABC</p>
|
163
|
-
</note>
|
164
|
-
<note id='_'>
|
165
|
-
<p id='_'>DEF</p>
|
166
|
-
</note>
|
167
|
-
<bibitem id='iso216' type='standard'>
|
168
|
-
<title format='text/plain'>Reference</title>
|
169
|
-
<docidentifier>ISO 215</docidentifier>
|
170
|
-
<docnumber>215</docnumber>
|
171
|
-
<contributor>
|
172
|
-
<role type='publisher'/>
|
173
|
-
<organization>
|
174
|
-
<name>ISO</name>
|
175
|
-
</organization>
|
176
|
-
</contributor>
|
177
|
-
</bibitem>
|
178
|
-
<note id='_'>
|
179
|
-
<p id='_'>JKL</p>
|
180
|
-
</note>
|
181
|
-
<p id='_'>
|
182
|
-
This is further extraneous information
|
183
|
-
<note id='_'>
|
184
|
-
<p id='_'>GHI</p>
|
185
|
-
</note>
|
186
|
-
</p>
|
187
|
-
<p id='_'>This is also extraneous information</p>
|
188
|
-
</references>
|
189
|
-
</bibliography>
|
190
|
-
</standard-document>
|
191
|
-
OUTPUT
|
192
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
193
|
-
.to be_equivalent_to xmlpp(output)
|
194
|
-
end
|
195
|
-
|
196
|
-
it "defaults section obligations" do
|
197
|
-
input = <<~INPUT
|
198
|
-
#{ASCIIDOC_BLANK_HDR}
|
199
|
-
|
200
|
-
== Clause
|
201
|
-
Text
|
202
|
-
|
203
|
-
[appendix]
|
204
|
-
== Clause
|
205
|
-
|
206
|
-
Text
|
207
|
-
INPUT
|
208
|
-
output = <<~OUTPUT
|
209
|
-
#{BLANK_HDR}
|
210
|
-
<sections><clause id="_" inline-header="false" obligation="normative">
|
211
|
-
<title>Clause</title>
|
212
|
-
<p id="_">Text</p>
|
213
|
-
</clause>
|
214
|
-
</sections><annex id="_" inline-header="false" obligation="normative">
|
215
|
-
<title>Clause</title>
|
216
|
-
<p id="_">Text</p>
|
217
|
-
</annex>
|
218
|
-
</standard-document>
|
219
|
-
OUTPUT
|
220
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
221
|
-
.to be_equivalent_to xmlpp(output)
|
222
|
-
end
|
223
|
-
|
224
|
-
it "extends clause levels past 5" do
|
225
|
-
input = <<~INPUT
|
226
|
-
#{ASCIIDOC_BLANK_HDR}
|
227
|
-
|
228
|
-
== Clause1
|
229
|
-
|
230
|
-
=== Clause2
|
231
|
-
|
232
|
-
==== Clause3
|
233
|
-
|
234
|
-
===== Clause4
|
235
|
-
|
236
|
-
====== Clause 5
|
237
|
-
|
238
|
-
[level=6]
|
239
|
-
====== Clause 6
|
240
|
-
|
241
|
-
[level=7]
|
242
|
-
====== Clause 7A
|
243
|
-
|
244
|
-
[level=7]
|
245
|
-
====== Clause 7B
|
246
|
-
|
247
|
-
[level=6]
|
248
|
-
====== Clause 6B
|
249
|
-
|
250
|
-
====== Clause 5B
|
251
|
-
|
252
|
-
INPUT
|
253
|
-
output = <<~OUTPUT
|
254
|
-
#{BLANK_HDR}
|
255
|
-
<sections>
|
256
|
-
<clause id="_" inline-header="false" obligation="normative">
|
257
|
-
<title>Clause1</title>
|
258
|
-
<clause id="_" inline-header="false" obligation="normative">
|
259
|
-
<title>Clause2</title>
|
260
|
-
<clause id="_" inline-header="false" obligation="normative">
|
261
|
-
<title>Clause3</title>
|
262
|
-
<clause id="_" inline-header="false" obligation="normative"><title>Clause4</title><clause id="_" inline-header="false" obligation="normative">
|
263
|
-
<title>Clause 5</title>
|
264
|
-
<clause id="_" inline-header="false" obligation="normative">
|
265
|
-
<title>Clause 6</title>
|
266
|
-
<clause id="_" inline-header="false" obligation="normative">
|
267
|
-
<title>Clause 7A</title>
|
268
|
-
</clause><clause id="_" inline-header="false" obligation="normative">
|
269
|
-
<title>Clause 7B</title>
|
270
|
-
</clause></clause><clause id="_" inline-header="false" obligation="normative">
|
271
|
-
<title>Clause 6B</title>
|
272
|
-
</clause></clause>
|
273
|
-
<clause id="_" inline-header="false" obligation="normative">
|
274
|
-
<title>Clause 5B</title>
|
275
|
-
</clause></clause>
|
276
|
-
</clause>
|
277
|
-
</clause>
|
278
|
-
</clause>
|
279
|
-
</sections>
|
280
|
-
</standard-document>
|
281
|
-
OUTPUT
|
282
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
283
|
-
.to be_equivalent_to xmlpp(output)
|
284
|
-
end
|
285
|
-
|
286
|
-
it "inserts boilerplate before empty Normative References" do
|
287
|
-
input = <<~INPUT
|
288
|
-
#{ASCIIDOC_BLANK_HDR}
|
289
|
-
|
290
|
-
[bibliography]
|
291
|
-
== Normative References
|
292
|
-
|
293
|
-
INPUT
|
294
|
-
output = <<~OUTPUT
|
295
|
-
#{BLANK_HDR}
|
296
|
-
<sections>
|
297
|
-
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
298
|
-
<title>Normative references</title><p id="_">There are no normative references in this document.</p>
|
299
|
-
</references></bibliography>
|
300
|
-
</standard-document>
|
301
|
-
OUTPUT
|
302
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
303
|
-
.to be_equivalent_to xmlpp(output)
|
304
|
-
end
|
305
|
-
|
306
|
-
it "inserts boilerplate before non-empty Normative References" do
|
307
|
-
input = <<~INPUT
|
308
|
-
#{ASCIIDOC_BLANK_HDR}
|
309
|
-
|
310
|
-
[bibliography]
|
311
|
-
== Normative References
|
312
|
-
* [[[a,b]]] A
|
313
|
-
|
314
|
-
INPUT
|
315
|
-
output = <<~OUTPUT
|
316
|
-
#{BLANK_HDR}
|
317
|
-
<sections>
|
318
|
-
|
319
|
-
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
320
|
-
<title>Normative references</title><p id="_">The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
321
|
-
<bibitem id="a">
|
322
|
-
<formattedref format="application/x-isodoc+xml">A</formattedref>
|
323
|
-
<docidentifier>b</docidentifier>
|
324
|
-
</bibitem>
|
325
|
-
</references></bibliography>
|
326
|
-
</standard-document>
|
327
|
-
|
328
|
-
OUTPUT
|
329
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
330
|
-
.to be_equivalent_to xmlpp(output)
|
331
|
-
end
|
332
|
-
|
333
|
-
it "inserts boilerplate before empty Normative References in French" do
|
334
|
-
input = <<~INPUT
|
335
|
-
= Document title
|
336
|
-
Author
|
337
|
-
:docfile: test.adoc
|
338
|
-
:nodoc:
|
339
|
-
:novalid:
|
340
|
-
:no-isobib:
|
341
|
-
:language: fr
|
342
|
-
|
343
|
-
[bibliography]
|
344
|
-
== Normative References
|
345
|
-
|
346
|
-
INPUT
|
347
|
-
output = <<~OUTPUT
|
348
|
-
#{BLANK_HDR.sub(/<language>en/, '<language>fr')}
|
349
|
-
<sections>
|
350
|
-
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
351
|
-
<title>Références normatives</title><p id="_">Le présent document ne contient aucune référence normative.</p>
|
352
|
-
</references></bibliography>
|
353
|
-
</standard-document>
|
354
|
-
OUTPUT
|
355
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
356
|
-
.to be_equivalent_to xmlpp(output)
|
357
|
-
end
|
358
|
-
|
359
|
-
it "processes section names, with footnotes" do
|
360
|
-
input = <<~INPUT
|
361
|
-
#{ASCIIDOC_BLANK_HDR}
|
362
|
-
.Foreword.footnote:[A]
|
363
|
-
|
364
|
-
Text
|
365
|
-
|
366
|
-
[abstract]
|
367
|
-
== Abstract.footnote:[A]
|
368
|
-
|
369
|
-
Text
|
370
|
-
|
371
|
-
[heading=introduction]
|
372
|
-
== Introduction.footnote:[A]
|
373
|
-
|
374
|
-
=== Introduction Subsection
|
375
|
-
|
376
|
-
[heading=acknowledgements]
|
377
|
-
== Acknowledgements.footnote:[A]
|
378
|
-
|
379
|
-
[.preface]
|
380
|
-
== Dedication
|
381
|
-
|
382
|
-
[heading=scope]
|
383
|
-
== Scope.footnote:[A]
|
384
|
-
|
385
|
-
Text
|
386
|
-
|
387
|
-
[bibliography,heading=normative references]
|
388
|
-
== Normative References.footnote:[A]
|
389
|
-
|
390
|
-
[bibliography,normative=true]
|
391
|
-
== Normative References 2.footnote:[A]
|
392
|
-
|
393
|
-
[heading=terms and definitions]
|
394
|
-
== Terms and Definitions.footnote:[A]
|
395
|
-
|
396
|
-
=== Term1
|
397
|
-
|
398
|
-
[heading="terms and definitions"]
|
399
|
-
== Terms, Definitions, Symbols and Abbreviated Terms.footnote:[A]
|
400
|
-
|
401
|
-
[.nonterm]
|
402
|
-
=== Introduction
|
403
|
-
|
404
|
-
==== Intro 1
|
405
|
-
|
406
|
-
=== Intro 2
|
407
|
-
|
408
|
-
[.nonterm]
|
409
|
-
==== Intro 3
|
410
|
-
|
411
|
-
=== Intro 4
|
412
|
-
|
413
|
-
==== Intro 5
|
414
|
-
|
415
|
-
===== Term1
|
416
|
-
|
417
|
-
=== Normal Terms
|
418
|
-
|
419
|
-
==== Term2
|
420
|
-
|
421
|
-
[heading=symbols and abbreviated terms]
|
422
|
-
=== Symbols and Abbreviated Terms.footnote:[A]
|
423
|
-
|
424
|
-
[.nonterm]
|
425
|
-
==== General
|
426
|
-
|
427
|
-
[heading=symbols]
|
428
|
-
==== Symbols 1.footnote:[A]
|
429
|
-
|
430
|
-
[heading=abbreviated terms]
|
431
|
-
== Abbreviated Terms.footnote:[A]
|
432
|
-
|
433
|
-
== Clause 4
|
434
|
-
|
435
|
-
=== Introduction
|
436
|
-
|
437
|
-
=== Clause 4.2
|
438
|
-
|
439
|
-
== Terms and Definitions
|
440
|
-
|
441
|
-
[appendix]
|
442
|
-
== Annex.footnote:[A]
|
443
|
-
|
444
|
-
=== Annex A.1
|
445
|
-
|
446
|
-
[bibliography,heading=bibliography]
|
447
|
-
== Bibliography.footnote:[A]
|
448
|
-
|
449
|
-
[bibliography,normative=false]
|
450
|
-
== Bibliography 2.footnote:[A]
|
451
|
-
|
452
|
-
=== Bibliography Subsection
|
453
|
-
|
454
|
-
INPUT
|
455
|
-
output = <<~OUTPUT
|
456
|
-
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
457
|
-
<bibdata type='standard'>
|
458
|
-
<title language='en' format='text/plain'>Document title</title>
|
459
|
-
<language>en</language>
|
460
|
-
<script>Latn</script>
|
461
|
-
<abstract>
|
462
|
-
<p>Text</p>
|
463
|
-
</abstract>
|
464
|
-
<status>
|
465
|
-
<stage>published</stage>
|
466
|
-
</status>
|
467
|
-
<copyright>
|
468
|
-
<from>#{Time.now.year}</from>
|
469
|
-
</copyright>
|
470
|
-
<ext>
|
471
|
-
<doctype>standard</doctype>
|
472
|
-
</ext>
|
473
|
-
</bibdata>
|
474
|
-
<preface>
|
475
|
-
<abstract id='_'>
|
476
|
-
<title>Abstract</title>
|
477
|
-
<p id='_'>Text</p>
|
478
|
-
</abstract>
|
479
|
-
<foreword id='_' obligation='informative'>
|
480
|
-
<title>
|
481
|
-
Foreword
|
482
|
-
<fn reference='1'>
|
483
|
-
<p id='_'>A</p>
|
484
|
-
</fn>
|
485
|
-
</title>
|
486
|
-
<p id='_'>Text</p>
|
487
|
-
</foreword>
|
488
|
-
<introduction id='_' obligation='informative'>
|
489
|
-
<title>Introduction</title>
|
490
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
491
|
-
<title>Introduction Subsection</title>
|
492
|
-
</clause>
|
493
|
-
</introduction>
|
494
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
495
|
-
<title>Dedication</title>
|
496
|
-
</clause>
|
497
|
-
<acknowledgements id='_' obligation='informative'>
|
498
|
-
<title>
|
499
|
-
Acknowledgements
|
500
|
-
<fn reference='1'>
|
501
|
-
<p id='_'>A</p>
|
502
|
-
</fn>
|
503
|
-
</title>
|
504
|
-
</acknowledgements>
|
505
|
-
</preface>
|
506
|
-
<sections>
|
507
|
-
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
508
|
-
<title>
|
509
|
-
Scope
|
510
|
-
<fn reference='1'>
|
511
|
-
<p id='_'>A</p>
|
512
|
-
</fn>
|
513
|
-
</title>
|
514
|
-
<p id='_'>Text</p>
|
515
|
-
</clause>
|
516
|
-
<terms id='_' obligation='normative'>
|
517
|
-
<title>
|
518
|
-
Terms and definitions
|
519
|
-
<fn reference='1'>
|
520
|
-
<p id='_'>A</p>
|
521
|
-
</fn>
|
522
|
-
</title>
|
523
|
-
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
524
|
-
<term id='term-Term1'>
|
525
|
-
<preferred><expression><name>Term1</name></expression></preferred>
|
526
|
-
</term>
|
527
|
-
</terms>
|
528
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
529
|
-
<title>
|
530
|
-
Terms, Definitions, Symbols and Abbreviated Terms.
|
531
|
-
<fn reference='1'>
|
532
|
-
<p id='_'>A</p>
|
533
|
-
</fn>
|
534
|
-
</title>
|
535
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
536
|
-
<title>Introduction</title>
|
537
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
538
|
-
<title>Intro 1</title>
|
539
|
-
</clause>
|
540
|
-
</clause>
|
541
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
542
|
-
<title>Intro 2</title>
|
543
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
544
|
-
<title>Intro 3</title>
|
545
|
-
</clause>
|
546
|
-
</clause>
|
547
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
548
|
-
<title>Intro 4</title>
|
549
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
550
|
-
<title>Intro 5</title>
|
551
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
552
|
-
<title>Term1</title>
|
553
|
-
</clause>
|
554
|
-
</clause>
|
555
|
-
</clause>
|
556
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
557
|
-
<title>Normal Terms</title>
|
558
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
559
|
-
<title>Term2</title>
|
560
|
-
</clause>
|
561
|
-
</clause>
|
562
|
-
<definitions id='_' obligation='normative'>
|
563
|
-
<title>
|
564
|
-
Symbols and abbreviated terms
|
565
|
-
<fn reference='1'>
|
566
|
-
<p id='_'>A</p>
|
567
|
-
</fn>
|
568
|
-
</title>
|
569
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
570
|
-
<title>General</title>
|
571
|
-
</clause>
|
572
|
-
<definitions id='_' type='symbols' obligation='normative'>
|
573
|
-
<title>
|
574
|
-
Symbols
|
575
|
-
<fn reference='1'>
|
576
|
-
<p id='_'>A</p>
|
577
|
-
</fn>
|
578
|
-
</title>
|
579
|
-
</definitions>
|
580
|
-
</definitions>
|
581
|
-
</clause>
|
582
|
-
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
583
|
-
<title>
|
584
|
-
Abbreviated terms
|
585
|
-
<fn reference='1'>
|
586
|
-
<p id='_'>A</p>
|
587
|
-
</fn>
|
588
|
-
</title>
|
589
|
-
</definitions>
|
590
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
591
|
-
<title>Clause 4</title>
|
592
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
593
|
-
<title>Introduction</title>
|
594
|
-
</clause>
|
595
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
596
|
-
<title>Clause 4.2</title>
|
597
|
-
</clause>
|
598
|
-
</clause>
|
599
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
600
|
-
<title>Terms and Definitions</title>
|
601
|
-
</clause>
|
602
|
-
</sections>
|
603
|
-
<annex id='_' inline-header='false' obligation='normative'>
|
604
|
-
<title>
|
605
|
-
Annex.
|
606
|
-
<fn reference='1'>
|
607
|
-
<p id='_'>A</p>
|
608
|
-
</fn>
|
609
|
-
</title>
|
610
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
611
|
-
<title>Annex A.1</title>
|
612
|
-
</clause>
|
613
|
-
</annex>
|
614
|
-
<bibliography>
|
615
|
-
<references id='_' normative='true' obligation='informative'>
|
616
|
-
<title>Normative references
|
617
|
-
<fn reference='1'>
|
618
|
-
<p id='_'>A</p>
|
619
|
-
</fn>
|
620
|
-
</title>
|
621
|
-
<p id='_'>There are no normative references in this document.</p>
|
622
|
-
</references>
|
623
|
-
<references id='_' normative='true' obligation='informative'>
|
624
|
-
<title>Normative References 2.
|
625
|
-
<fn reference='1'>
|
626
|
-
<p id='_'>A</p>
|
627
|
-
</fn>
|
628
|
-
</title>
|
629
|
-
</references>
|
630
|
-
<references id='_' normative='false' obligation='informative'>
|
631
|
-
<title>Bibliography
|
632
|
-
<fn reference='1'>
|
633
|
-
<p id='_'>A</p>
|
634
|
-
</fn>
|
635
|
-
</title>
|
636
|
-
</references>
|
637
|
-
<clause id='_' obligation='informative'>
|
638
|
-
<title>Bibliography 2.
|
639
|
-
<fn reference='1'>
|
640
|
-
<p id='_'>A</p>
|
641
|
-
</fn>
|
642
|
-
</title>
|
643
|
-
<references id='_' normative='false' obligation='informative'>
|
644
|
-
<title>Bibliography Subsection</title>
|
645
|
-
</references>
|
646
|
-
</clause>
|
647
|
-
</bibliography>
|
648
|
-
</standard-document>
|
649
|
-
OUTPUT
|
650
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
651
|
-
.to be_equivalent_to xmlpp(output)
|
652
|
-
end
|
653
|
-
|
654
|
-
it "processes section names, default to English" do
|
655
|
-
input = <<~INPUT
|
656
|
-
#{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":language: tlh\n:script: Latn\n:nodoc:")}
|
657
|
-
.Foreword
|
658
|
-
|
659
|
-
Text
|
660
|
-
|
661
|
-
[abstract]
|
662
|
-
== Abstract
|
663
|
-
|
664
|
-
Text
|
665
|
-
|
666
|
-
[heading=introduction]
|
667
|
-
== Introduction
|
668
|
-
|
669
|
-
=== Introduction Subsection
|
670
|
-
|
671
|
-
[heading=acknowledgements]
|
672
|
-
== Acknowledgements
|
673
|
-
|
674
|
-
[.preface]
|
675
|
-
== Dedication
|
676
|
-
|
677
|
-
[heading=scope]
|
678
|
-
== Scope
|
679
|
-
|
680
|
-
Text
|
681
|
-
|
682
|
-
[bibliography,heading=normative references]
|
683
|
-
== Normative References
|
684
|
-
|
685
|
-
[bibliography,normative=true]
|
686
|
-
== Normative References 2
|
687
|
-
|
688
|
-
[heading=terms and definitions]
|
689
|
-
== Terms and Definitions
|
690
|
-
|
691
|
-
=== Term1
|
692
|
-
|
693
|
-
[heading="terms and definitions"]
|
694
|
-
== Terms, Definitions, Symbols and Abbreviated Terms
|
695
|
-
|
696
|
-
[.nonterm]
|
697
|
-
=== Introduction
|
698
|
-
|
699
|
-
==== Intro 1
|
700
|
-
|
701
|
-
=== Intro 2
|
702
|
-
|
703
|
-
[.nonterm]
|
704
|
-
==== Intro 3
|
705
|
-
|
706
|
-
=== Intro 4
|
707
|
-
|
708
|
-
==== Intro 5
|
709
|
-
|
710
|
-
===== Term1
|
711
|
-
|
712
|
-
=== Normal Terms
|
713
|
-
|
714
|
-
==== Term2
|
715
|
-
|
716
|
-
[heading=symbols and abbreviated terms]
|
717
|
-
=== Symbols and Abbreviated Terms
|
718
|
-
|
719
|
-
[.nonterm]
|
720
|
-
==== General
|
721
|
-
|
722
|
-
[heading=symbols]
|
723
|
-
==== Symbols 1
|
724
|
-
|
725
|
-
[heading=abbreviated terms]
|
726
|
-
== Abbreviated Terms
|
727
|
-
|
728
|
-
== Clause 4
|
729
|
-
|
730
|
-
=== Introduction
|
731
|
-
|
732
|
-
=== Clause 4.2
|
733
|
-
|
734
|
-
== Terms and Definitions
|
735
|
-
|
736
|
-
[appendix]
|
737
|
-
== Annex
|
738
|
-
|
739
|
-
=== Annex A.1
|
740
|
-
|
741
|
-
[bibliography,heading=bibliography]
|
742
|
-
== Bibliography
|
743
|
-
|
744
|
-
[bibliography,normative=false]
|
745
|
-
== Bibliography 2
|
746
|
-
|
747
|
-
=== Bibliography Subsection
|
748
|
-
|
749
|
-
INPUT
|
750
|
-
output = <<~OUTPUT
|
751
|
-
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
752
|
-
<bibdata type='standard'>
|
753
|
-
<title language='en' format='text/plain'>Document title</title>
|
754
|
-
<language>tlh</language>
|
755
|
-
<script>Latn</script>
|
756
|
-
<abstract>
|
757
|
-
<p>Text</p>
|
758
|
-
</abstract>
|
759
|
-
<status>
|
760
|
-
<stage>published</stage>
|
761
|
-
</status>
|
762
|
-
<copyright>
|
763
|
-
<from>#{Time.now.year}</from>
|
764
|
-
</copyright>
|
765
|
-
<ext>
|
766
|
-
<doctype>standard</doctype>
|
767
|
-
</ext>
|
768
|
-
</bibdata>
|
769
|
-
<preface>
|
770
|
-
<abstract id='_'>
|
771
|
-
<title>Abstract</title>
|
772
|
-
<p id='_'>Text</p>
|
773
|
-
</abstract>
|
774
|
-
<foreword id='_' obligation='informative'>
|
775
|
-
<title>Foreword</title>
|
776
|
-
<p id='_'>Text</p>
|
777
|
-
</foreword>
|
778
|
-
<introduction id='_' obligation='informative'>
|
779
|
-
<title>Introduction</title>
|
780
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
781
|
-
<title>Introduction Subsection</title>
|
782
|
-
</clause>
|
783
|
-
</introduction>
|
784
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
785
|
-
<title>Dedication</title>
|
786
|
-
</clause>
|
787
|
-
<acknowledgements id='_' obligation='informative'>
|
788
|
-
<title>Acknowledgements</title>
|
789
|
-
</acknowledgements>
|
790
|
-
</preface>
|
791
|
-
<sections>
|
792
|
-
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
793
|
-
<title>Scope</title>
|
794
|
-
<p id='_'>Text</p>
|
795
|
-
</clause>
|
796
|
-
<terms id='_' obligation='normative'>
|
797
|
-
<title>Terms and definitions</title>
|
798
|
-
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
799
|
-
<term id='term-Term1'>
|
800
|
-
<preferred><expression><name>Term1</name></expression></preferred>
|
801
|
-
</term>
|
802
|
-
</terms>
|
803
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
804
|
-
<title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
805
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
806
|
-
<title>Introduction</title>
|
807
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
808
|
-
<title>Intro 1</title>
|
809
|
-
</clause>
|
810
|
-
</clause>
|
811
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
812
|
-
<title>Intro 2</title>
|
813
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
814
|
-
<title>Intro 3</title>
|
815
|
-
</clause>
|
816
|
-
</clause>
|
817
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
818
|
-
<title>Intro 4</title>
|
819
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
820
|
-
<title>Intro 5</title>
|
821
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
822
|
-
<title>Term1</title>
|
823
|
-
</clause>
|
824
|
-
</clause>
|
825
|
-
</clause>
|
826
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
827
|
-
<title>Normal Terms</title>
|
828
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
829
|
-
<title>Term2</title>
|
830
|
-
</clause>
|
831
|
-
</clause>
|
832
|
-
<definitions id='_' obligation='normative'>
|
833
|
-
<title>Symbols and abbreviated terms</title>
|
834
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
835
|
-
<title>General</title>
|
836
|
-
</clause>
|
837
|
-
<definitions id='_' type='symbols' obligation='normative'>
|
838
|
-
<title>Symbols</title>
|
839
|
-
</definitions>
|
840
|
-
</definitions>
|
841
|
-
</clause>
|
842
|
-
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
843
|
-
<title>Abbreviated terms</title>
|
844
|
-
</definitions>
|
845
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
846
|
-
<title>Clause 4</title>
|
847
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
848
|
-
<title>Introduction</title>
|
849
|
-
</clause>
|
850
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
851
|
-
<title>Clause 4.2</title>
|
852
|
-
</clause>
|
853
|
-
</clause>
|
854
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
855
|
-
<title>Terms and Definitions</title>
|
856
|
-
</clause>
|
857
|
-
</sections>
|
858
|
-
<annex id='_' inline-header='false' obligation='normative'>
|
859
|
-
<title>Annex</title>
|
860
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
861
|
-
<title>Annex A.1</title>
|
862
|
-
</clause>
|
863
|
-
</annex>
|
864
|
-
<bibliography>
|
865
|
-
<references id='_' normative='true' obligation='informative'>
|
866
|
-
<title>Normative references</title>
|
867
|
-
<p id='_'>There are no normative references in this document.</p>
|
868
|
-
</references>
|
869
|
-
<references id='_' normative='true' obligation='informative'>
|
870
|
-
<title>Normative References 2</title>
|
871
|
-
</references>
|
872
|
-
<references id='_' normative='false' obligation='informative'>
|
873
|
-
<title>Bibliography</title>
|
874
|
-
</references>
|
875
|
-
<clause id='_' obligation='informative'>
|
876
|
-
<title>Bibliography 2</title>
|
877
|
-
<references id='_' normative='false' obligation='informative'>
|
878
|
-
<title>Bibliography Subsection</title>
|
879
|
-
</references>
|
880
|
-
</clause>
|
881
|
-
</bibliography>
|
882
|
-
</standard-document>
|
883
|
-
OUTPUT
|
884
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
885
|
-
.to be_equivalent_to xmlpp(output)
|
886
|
-
end
|
887
|
-
|
888
|
-
it "processes section names, French" do
|
889
|
-
input = <<~INPUT
|
890
|
-
#{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":language: fr\n:script: Latn\n:nodoc:")}
|
891
|
-
.Foreword
|
892
|
-
|
893
|
-
Text
|
894
|
-
|
895
|
-
[abstract]
|
896
|
-
== Abstract
|
897
|
-
|
898
|
-
Text
|
899
|
-
|
900
|
-
[heading=introduction]
|
901
|
-
== Introduction
|
902
|
-
|
903
|
-
=== Introduction Subsection
|
904
|
-
|
905
|
-
[heading=acknowledgements]
|
906
|
-
== Acknowledgements
|
907
|
-
|
908
|
-
[.preface]
|
909
|
-
== Dedication
|
910
|
-
|
911
|
-
[heading=scope]
|
912
|
-
== Scope
|
913
|
-
|
914
|
-
Text
|
915
|
-
|
916
|
-
[bibliography,heading=normative references]
|
917
|
-
== Normative References
|
918
|
-
|
919
|
-
[bibliography,normative=true]
|
920
|
-
== Normative References 2
|
921
|
-
|
922
|
-
[heading=terms and definitions]
|
923
|
-
== Terms and Definitions
|
924
|
-
|
925
|
-
=== Term1
|
926
|
-
|
927
|
-
[heading="terms and definitions"]
|
928
|
-
== Terms, Definitions, Symbols and Abbreviated Terms
|
929
|
-
|
930
|
-
[.nonterm]
|
931
|
-
=== Introduction
|
932
|
-
|
933
|
-
==== Intro 1
|
934
|
-
|
935
|
-
=== Intro 2
|
936
|
-
|
937
|
-
[.nonterm]
|
938
|
-
==== Intro 3
|
939
|
-
|
940
|
-
=== Intro 4
|
941
|
-
|
942
|
-
==== Intro 5
|
943
|
-
|
944
|
-
===== Term1
|
945
|
-
|
946
|
-
=== Normal Terms
|
947
|
-
|
948
|
-
==== Term2
|
949
|
-
|
950
|
-
[heading=symbols and abbreviated terms]
|
951
|
-
=== Symbols and Abbreviated Terms
|
952
|
-
|
953
|
-
[.nonterm]
|
954
|
-
==== General
|
955
|
-
|
956
|
-
[heading=symbols]
|
957
|
-
==== Symbols 1
|
958
|
-
|
959
|
-
[heading=abbreviated terms]
|
960
|
-
== Abbreviated Terms
|
961
|
-
|
962
|
-
== Clause 4
|
963
|
-
|
964
|
-
=== Introduction
|
965
|
-
|
966
|
-
=== Clause 4.2
|
967
|
-
|
968
|
-
== Terms and Definitions
|
969
|
-
|
970
|
-
[appendix]
|
971
|
-
== Annex
|
972
|
-
|
973
|
-
=== Annex A.1
|
974
|
-
|
975
|
-
[bibliography,heading=bibliography]
|
976
|
-
== Bibliography
|
977
|
-
|
978
|
-
[bibliography,normative=false]
|
979
|
-
== Bibliography 2
|
980
|
-
|
981
|
-
=== Bibliography Subsection
|
982
|
-
|
983
|
-
INPUT
|
984
|
-
output = <<~OUTPUT
|
985
|
-
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
986
|
-
<bibdata type='standard'>
|
987
|
-
<title language='en' format='text/plain'>Document title</title>
|
988
|
-
<language>fr</language>
|
989
|
-
<script>Latn</script>
|
990
|
-
<abstract>
|
991
|
-
<p>Text</p>
|
992
|
-
</abstract>
|
993
|
-
<status>
|
994
|
-
<stage>published</stage>
|
995
|
-
</status>
|
996
|
-
<copyright>
|
997
|
-
<from>#{Time.now.year}</from>
|
998
|
-
</copyright>
|
999
|
-
<ext>
|
1000
|
-
<doctype>standard</doctype>
|
1001
|
-
</ext>
|
1002
|
-
</bibdata>
|
1003
|
-
<preface>
|
1004
|
-
<abstract id='_'>
|
1005
|
-
<title>Résumé</title>
|
1006
|
-
<p id='_'>Text</p>
|
1007
|
-
</abstract>
|
1008
|
-
<foreword id='_' obligation='informative'>
|
1009
|
-
<title>Avant-propos</title>
|
1010
|
-
<p id='_'>Text</p>
|
1011
|
-
</foreword>
|
1012
|
-
<introduction id='_' obligation='informative'>
|
1013
|
-
<title>Introduction</title>
|
1014
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
1015
|
-
<title>Introduction Subsection</title>
|
1016
|
-
</clause>
|
1017
|
-
</introduction>
|
1018
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
1019
|
-
<title>Dedication</title>
|
1020
|
-
</clause>
|
1021
|
-
<acknowledgements id='_' obligation='informative'>
|
1022
|
-
<title>Remerciements</title>
|
1023
|
-
</acknowledgements>
|
1024
|
-
</preface>
|
1025
|
-
<sections>
|
1026
|
-
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
1027
|
-
<title>Domaine d’application</title>
|
1028
|
-
<p id='_'>Text</p>
|
1029
|
-
</clause>
|
1030
|
-
<terms id='_' obligation='normative'>
|
1031
|
-
<title>Terms et définitions</title>
|
1032
|
-
<p id='_'>
|
1033
|
-
Pour les besoins du présent document, les termes et définitions suivants
|
1034
|
-
s’appliquent.
|
1035
|
-
</p>
|
1036
|
-
<term id='term-Term1'>
|
1037
|
-
<preferred><expression><name>Term1</name></expression></preferred>
|
1038
|
-
</term>
|
1039
|
-
</terms>
|
1040
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1041
|
-
<title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
1042
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1043
|
-
<title>Introduction</title>
|
1044
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1045
|
-
<title>Intro 1</title>
|
1046
|
-
</clause>
|
1047
|
-
</clause>
|
1048
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1049
|
-
<title>Intro 2</title>
|
1050
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1051
|
-
<title>Intro 3</title>
|
1052
|
-
</clause>
|
1053
|
-
</clause>
|
1054
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1055
|
-
<title>Intro 4</title>
|
1056
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1057
|
-
<title>Intro 5</title>
|
1058
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1059
|
-
<title>Term1</title>
|
1060
|
-
</clause>
|
1061
|
-
</clause>
|
1062
|
-
</clause>
|
1063
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1064
|
-
<title>Normal Terms</title>
|
1065
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1066
|
-
<title>Term2</title>
|
1067
|
-
</clause>
|
1068
|
-
</clause>
|
1069
|
-
<definitions id='_' obligation='normative'>
|
1070
|
-
<title>Symboles et termes abrégés</title>
|
1071
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1072
|
-
<title>General</title>
|
1073
|
-
</clause>
|
1074
|
-
<definitions id='_' type='symbols' obligation='normative'>
|
1075
|
-
<title>Symboles</title>
|
1076
|
-
</definitions>
|
1077
|
-
</definitions>
|
1078
|
-
</clause>
|
1079
|
-
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
1080
|
-
<title>Termes abrégés</title>
|
1081
|
-
</definitions>
|
1082
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1083
|
-
<title>Clause 4</title>
|
1084
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1085
|
-
<title>Introduction</title>
|
1086
|
-
</clause>
|
1087
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1088
|
-
<title>Clause 4.2</title>
|
1089
|
-
</clause>
|
1090
|
-
</clause>
|
1091
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1092
|
-
<title>Terms and Definitions</title>
|
1093
|
-
</clause>
|
1094
|
-
</sections>
|
1095
|
-
<annex id='_' inline-header='false' obligation='normative'>
|
1096
|
-
<title>Annex</title>
|
1097
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1098
|
-
<title>Annex A.1</title>
|
1099
|
-
</clause>
|
1100
|
-
</annex>
|
1101
|
-
<bibliography>
|
1102
|
-
<references id='_' normative='true' obligation='informative'>
|
1103
|
-
<title>Références normatives</title>
|
1104
|
-
<p id='_'>Le présent document ne contient aucune référence normative.</p>
|
1105
|
-
</references>
|
1106
|
-
<references id='_' normative='true' obligation='informative'>
|
1107
|
-
<title>Normative References 2</title>
|
1108
|
-
</references>
|
1109
|
-
<references id='_' normative='false' obligation='informative'>
|
1110
|
-
<title>Bibliographie</title>
|
1111
|
-
</references>
|
1112
|
-
<clause id='_' obligation='informative'>
|
1113
|
-
<title>Bibliography 2</title>
|
1114
|
-
<references id='_' normative='false' obligation='informative'>
|
1115
|
-
<title>Bibliography Subsection</title>
|
1116
|
-
</references>
|
1117
|
-
</clause>
|
1118
|
-
</bibliography>
|
1119
|
-
</standard-document>
|
1120
|
-
OUTPUT
|
1121
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1122
|
-
.to be_equivalent_to xmlpp(output)
|
1123
|
-
end
|
1124
|
-
|
1125
|
-
it "processes section names, Simplified Chinese" do
|
1126
|
-
input = <<~INPUT
|
1127
|
-
#{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":language: zh\n:script: Hans\n:nodoc:")}
|
1128
|
-
.Foreword
|
1129
|
-
|
1130
|
-
Text
|
1131
|
-
|
1132
|
-
[abstract]
|
1133
|
-
== Abstract
|
1134
|
-
|
1135
|
-
Text
|
1136
|
-
|
1137
|
-
[heading=introduction]
|
1138
|
-
== Introduction
|
1139
|
-
|
1140
|
-
=== Introduction Subsection
|
1141
|
-
|
1142
|
-
[heading=acknowledgements]
|
1143
|
-
== Acknowledgements
|
1144
|
-
|
1145
|
-
[.preface]
|
1146
|
-
== Dedication
|
1147
|
-
|
1148
|
-
[heading=scope]
|
1149
|
-
== Scope
|
1150
|
-
|
1151
|
-
Text
|
1152
|
-
|
1153
|
-
[bibliography,heading=normative references]
|
1154
|
-
== Normative References
|
1155
|
-
|
1156
|
-
[bibliography,normative=true]
|
1157
|
-
== Normative References 2
|
1158
|
-
|
1159
|
-
[heading=terms and definitions]
|
1160
|
-
== Terms and Definitions
|
1161
|
-
|
1162
|
-
=== Term1
|
1163
|
-
|
1164
|
-
[heading="terms and definitions"]
|
1165
|
-
== Terms, Definitions, Symbols and Abbreviated Terms
|
1166
|
-
|
1167
|
-
[.nonterm]
|
1168
|
-
=== Introduction
|
1169
|
-
|
1170
|
-
==== Intro 1
|
1171
|
-
|
1172
|
-
=== Intro 2
|
1173
|
-
|
1174
|
-
[.nonterm]
|
1175
|
-
==== Intro 3
|
1176
|
-
|
1177
|
-
=== Intro 4
|
1178
|
-
|
1179
|
-
==== Intro 5
|
1180
|
-
|
1181
|
-
===== Term1
|
1182
|
-
|
1183
|
-
=== Normal Terms
|
1184
|
-
|
1185
|
-
==== Term2
|
1186
|
-
|
1187
|
-
[heading=symbols and abbreviated terms]
|
1188
|
-
=== Symbols and Abbreviated Terms
|
1189
|
-
|
1190
|
-
[.nonterm]
|
1191
|
-
==== General
|
1192
|
-
|
1193
|
-
[heading=symbols]
|
1194
|
-
==== Symbols 1
|
1195
|
-
|
1196
|
-
[heading=abbreviated terms]
|
1197
|
-
== Abbreviated Terms
|
1198
|
-
|
1199
|
-
== Clause 4
|
1200
|
-
|
1201
|
-
=== Introduction
|
1202
|
-
|
1203
|
-
=== Clause 4.2
|
1204
|
-
|
1205
|
-
== Terms and Definitions
|
1206
|
-
|
1207
|
-
[appendix]
|
1208
|
-
== Annex
|
1209
|
-
|
1210
|
-
=== Annex A.1
|
1211
|
-
|
1212
|
-
[bibliography,heading=bibliography]
|
1213
|
-
== Bibliography
|
1214
|
-
|
1215
|
-
[bibliography,normative=false]
|
1216
|
-
== Bibliography 2
|
1217
|
-
|
1218
|
-
=== Bibliography Subsection
|
1219
|
-
|
1220
|
-
INPUT
|
1221
|
-
output = <<~OUTPUT
|
1222
|
-
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
1223
|
-
<bibdata type='standard'>
|
1224
|
-
<title language='en' format='text/plain'>Document title</title>
|
1225
|
-
<language>zh</language>
|
1226
|
-
<script>Hans</script>
|
1227
|
-
<abstract>
|
1228
|
-
<p>Text</p>
|
1229
|
-
</abstract>
|
1230
|
-
<status>
|
1231
|
-
<stage>published</stage>
|
1232
|
-
</status>
|
1233
|
-
<copyright>
|
1234
|
-
<from>#{Time.now.year}</from>
|
1235
|
-
</copyright>
|
1236
|
-
<ext>
|
1237
|
-
<doctype>standard</doctype>
|
1238
|
-
</ext>
|
1239
|
-
</bibdata>
|
1240
|
-
<preface>
|
1241
|
-
<abstract id='_'>
|
1242
|
-
<title>摘要</title>
|
1243
|
-
<p id='_'>Text</p>
|
1244
|
-
</abstract>
|
1245
|
-
<foreword id='_' obligation='informative'>
|
1246
|
-
<title>前言</title>
|
1247
|
-
<p id='_'>Text</p>
|
1248
|
-
</foreword>
|
1249
|
-
<introduction id='_' obligation='informative'>
|
1250
|
-
<title>引言</title>
|
1251
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
1252
|
-
<title>Introduction Subsection</title>
|
1253
|
-
</clause>
|
1254
|
-
</introduction>
|
1255
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
1256
|
-
<title>Dedication</title>
|
1257
|
-
</clause>
|
1258
|
-
<acknowledgements id='_' obligation='informative'>
|
1259
|
-
<title>致謝</title>
|
1260
|
-
</acknowledgements>
|
1261
|
-
</preface>
|
1262
|
-
<sections>
|
1263
|
-
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
1264
|
-
<title>范围</title>
|
1265
|
-
<p id='_'>Text</p>
|
1266
|
-
</clause>
|
1267
|
-
<terms id='_' obligation='normative'>
|
1268
|
-
<title>术语和定义</title>
|
1269
|
-
<p id='_'>下列术语和定义适用于本文件。</p>
|
1270
|
-
<term id='term-Term1'>
|
1271
|
-
<preferred><expression><name>Term1</name></expression></preferred>
|
1272
|
-
</term>
|
1273
|
-
</terms>
|
1274
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1275
|
-
<title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
1276
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1277
|
-
<title>Introduction</title>
|
1278
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1279
|
-
<title>Intro 1</title>
|
1280
|
-
</clause>
|
1281
|
-
</clause>
|
1282
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1283
|
-
<title>Intro 2</title>
|
1284
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1285
|
-
<title>Intro 3</title>
|
1286
|
-
</clause>
|
1287
|
-
</clause>
|
1288
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1289
|
-
<title>Intro 4</title>
|
1290
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1291
|
-
<title>Intro 5</title>
|
1292
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1293
|
-
<title>Term1</title>
|
1294
|
-
</clause>
|
1295
|
-
</clause>
|
1296
|
-
</clause>
|
1297
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1298
|
-
<title>Normal Terms</title>
|
1299
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1300
|
-
<title>Term2</title>
|
1301
|
-
</clause>
|
1302
|
-
</clause>
|
1303
|
-
<definitions id='_' obligation='normative'>
|
1304
|
-
<title>符号、代号和缩略语</title>
|
1305
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1306
|
-
<title>General</title>
|
1307
|
-
</clause>
|
1308
|
-
<definitions id='_' type='symbols' obligation='normative'>
|
1309
|
-
<title>符号</title>
|
1310
|
-
</definitions>
|
1311
|
-
</definitions>
|
1312
|
-
</clause>
|
1313
|
-
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
1314
|
-
<title>代号和缩略语</title>
|
1315
|
-
</definitions>
|
1316
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1317
|
-
<title>Clause 4</title>
|
1318
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1319
|
-
<title>Introduction</title>
|
1320
|
-
</clause>
|
1321
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1322
|
-
<title>Clause 4.2</title>
|
1323
|
-
</clause>
|
1324
|
-
</clause>
|
1325
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1326
|
-
<title>Terms and Definitions</title>
|
1327
|
-
</clause>
|
1328
|
-
</sections>
|
1329
|
-
<annex id='_' inline-header='false' obligation='normative'>
|
1330
|
-
<title>Annex</title>
|
1331
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1332
|
-
<title>Annex A.1</title>
|
1333
|
-
</clause>
|
1334
|
-
</annex>
|
1335
|
-
<bibliography>
|
1336
|
-
<references id='_' normative='true' obligation='informative'>
|
1337
|
-
<title>规范性引用文件</title>
|
1338
|
-
<p id='_'>本文件并没有规范性引用文件。</p>
|
1339
|
-
</references>
|
1340
|
-
<references id='_' normative='true' obligation='informative'>
|
1341
|
-
<title>Normative References 2</title>
|
1342
|
-
</references>
|
1343
|
-
<references id='_' normative='false' obligation='informative'>
|
1344
|
-
<title>参考文献</title>
|
1345
|
-
</references>
|
1346
|
-
<clause id='_' obligation='informative'>
|
1347
|
-
<title>Bibliography 2</title>
|
1348
|
-
<references id='_' normative='false' obligation='informative'>
|
1349
|
-
<title>Bibliography Subsection</title>
|
1350
|
-
</references>
|
1351
|
-
</clause>
|
1352
|
-
</bibliography>
|
1353
|
-
</standard-document>
|
1354
|
-
OUTPUT
|
1355
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1356
|
-
.to be_equivalent_to xmlpp(output)
|
1357
|
-
end
|
1358
|
-
=end
|
1359
|
-
it "processes section names, internationalisation file" do
|
1360
|
-
input = <<~INPUT
|
1361
|
-
#{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":no-pdf:\n:i18nyaml: spec/assets/i18n.yaml")}
|
1362
|
-
.Foreword
|
1363
|
-
|
1364
|
-
Text
|
1365
|
-
|
1366
|
-
[abstract]
|
1367
|
-
== Abstract
|
1368
|
-
|
1369
|
-
Text
|
1370
|
-
|
1371
|
-
[heading=introduction]
|
1372
|
-
== Introduction
|
1373
|
-
|
1374
|
-
=== Introduction Subsection
|
1375
|
-
|
1376
|
-
[heading=acknowledgements]
|
1377
|
-
== Acknowledgements
|
1378
|
-
|
1379
|
-
[.preface]
|
1380
|
-
== Dedication
|
1381
|
-
|
1382
|
-
[heading=scope]
|
1383
|
-
== Scope
|
1384
|
-
|
1385
|
-
Text
|
1386
|
-
|
1387
|
-
[bibliography,heading=normative references]
|
1388
|
-
== Normative References
|
1389
|
-
|
1390
|
-
[bibliography,normative=true]
|
1391
|
-
== Normative References 2
|
1392
|
-
|
1393
|
-
[heading=terms and definitions]
|
1394
|
-
== Terms and Definitions
|
1395
|
-
|
1396
|
-
=== Term1
|
1397
|
-
|
1398
|
-
[heading="terms and definitions"]
|
1399
|
-
== Terms, Definitions, Symbols and Abbreviated Terms
|
1400
|
-
|
1401
|
-
[.nonterm]
|
1402
|
-
=== Introduction
|
1403
|
-
|
1404
|
-
==== Intro 1
|
1405
|
-
|
1406
|
-
=== Intro 2
|
1407
|
-
|
1408
|
-
[.nonterm]
|
1409
|
-
==== Intro 3
|
1410
|
-
|
1411
|
-
=== Intro 4
|
1412
|
-
|
1413
|
-
==== Intro 5
|
1414
|
-
|
1415
|
-
===== Term1
|
1416
|
-
|
1417
|
-
=== Normal Terms
|
1418
|
-
|
1419
|
-
==== Term2
|
1420
|
-
|
1421
|
-
[heading=symbols and abbreviated terms]
|
1422
|
-
=== Symbols and Abbreviated Terms
|
1423
|
-
|
1424
|
-
[.nonterm]
|
1425
|
-
==== General
|
1426
|
-
|
1427
|
-
[heading=symbols]
|
1428
|
-
==== Symbols 1
|
1429
|
-
|
1430
|
-
[heading=abbreviated terms]
|
1431
|
-
== Abbreviated Terms
|
1432
|
-
|
1433
|
-
== Clause 4
|
1434
|
-
|
1435
|
-
=== Introduction
|
1436
|
-
|
1437
|
-
=== Clause 4.2
|
1438
|
-
|
1439
|
-
== Terms and Definitions
|
1440
|
-
|
1441
|
-
[appendix]
|
1442
|
-
== Annex
|
1443
|
-
|
1444
|
-
=== Annex A.1
|
1445
|
-
|
1446
|
-
[bibliography,heading=bibliography]
|
1447
|
-
== Bibliography
|
1448
|
-
|
1449
|
-
[bibliography,normative=false]
|
1450
|
-
== Bibliography 2
|
1451
|
-
|
1452
|
-
=== Bibliography Subsection
|
1453
|
-
|
1454
|
-
INPUT
|
1455
|
-
output = <<~OUTPUT
|
1456
|
-
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
1457
|
-
<bibdata type='standard'>
|
1458
|
-
<title language='en' format='text/plain'>Document title</title>
|
1459
|
-
<language>en</language>
|
1460
|
-
<script>Latn</script>
|
1461
|
-
<abstract>
|
1462
|
-
<p>Text</p>
|
1463
|
-
</abstract>
|
1464
|
-
<status>
|
1465
|
-
<stage>published</stage>
|
1466
|
-
</status>
|
1467
|
-
<copyright>
|
1468
|
-
<from>#{Time.now.year}</from>
|
1469
|
-
</copyright>
|
1470
|
-
<ext>
|
1471
|
-
<doctype>standard</doctype>
|
1472
|
-
</ext>
|
1473
|
-
</bibdata>
|
1474
|
-
<preface>
|
1475
|
-
<abstract id='_'>
|
1476
|
-
<title>Abstract</title>
|
1477
|
-
<p id='_'>Text</p>
|
1478
|
-
</abstract>
|
1479
|
-
<foreword id='_' obligation='informative'>
|
1480
|
-
<title>Antaŭparolo</title>
|
1481
|
-
<p id='_'>Text</p>
|
1482
|
-
</foreword>
|
1483
|
-
<introduction id='_' obligation='informative'>
|
1484
|
-
<title>Enkonduko</title>
|
1485
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
1486
|
-
<title>Introduction Subsection</title>
|
1487
|
-
</clause>
|
1488
|
-
</introduction>
|
1489
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
1490
|
-
<title>Dedication</title>
|
1491
|
-
</clause>
|
1492
|
-
<acknowledgements id='_' obligation='informative'>
|
1493
|
-
<title>Acknowledgements</title>
|
1494
|
-
</acknowledgements>
|
1495
|
-
</preface>
|
1496
|
-
<sections>
|
1497
|
-
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
1498
|
-
<title>Amplekso</title>
|
1499
|
-
<p id='_'>Text</p>
|
1500
|
-
</clause>
|
1501
|
-
<terms id='_' obligation='normative'>
|
1502
|
-
<title>Terms and definitions</title>
|
1503
|
-
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
1504
|
-
<term id='term-Term1'>
|
1505
|
-
<preferred><expression><name>Term1</name></expression></preferred>
|
1506
|
-
</term>
|
1507
|
-
</terms>
|
1508
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1509
|
-
<title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
1510
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1511
|
-
<title>Introduction</title>
|
1512
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1513
|
-
<title>Intro 1</title>
|
1514
|
-
</clause>
|
1515
|
-
</clause>
|
1516
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1517
|
-
<title>Intro 2</title>
|
1518
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1519
|
-
<title>Intro 3</title>
|
1520
|
-
</clause>
|
1521
|
-
</clause>
|
1522
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1523
|
-
<title>Intro 4</title>
|
1524
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1525
|
-
<title>Intro 5</title>
|
1526
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1527
|
-
<title>Term1</title>
|
1528
|
-
</clause>
|
1529
|
-
</clause>
|
1530
|
-
</clause>
|
1531
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1532
|
-
<title>Normal Terms</title>
|
1533
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1534
|
-
<title>Term2</title>
|
1535
|
-
</clause>
|
1536
|
-
</clause>
|
1537
|
-
<definitions id='_' obligation='normative'>
|
1538
|
-
<title>Symbols and abbreviated terms</title>
|
1539
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1540
|
-
<title>General</title>
|
1541
|
-
</clause>
|
1542
|
-
<definitions id='_' type='symbols' obligation='normative'>
|
1543
|
-
<title>Simboloj kai mallongigitaj terminoj</title>
|
1544
|
-
</definitions>
|
1545
|
-
</definitions>
|
1546
|
-
</clause>
|
1547
|
-
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
1548
|
-
<title>Abbreviated terms</title>
|
1549
|
-
</definitions>
|
1550
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1551
|
-
<title>Clause 4</title>
|
1552
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1553
|
-
<title>Introduction</title>
|
1554
|
-
</clause>
|
1555
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1556
|
-
<title>Clause 4.2</title>
|
1557
|
-
</clause>
|
1558
|
-
</clause>
|
1559
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1560
|
-
<title>Terms and Definitions</title>
|
1561
|
-
</clause>
|
1562
|
-
</sections>
|
1563
|
-
<annex id='_' inline-header='false' obligation='normative'>
|
1564
|
-
<title>Annex</title>
|
1565
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1566
|
-
<title>Annex A.1</title>
|
1567
|
-
</clause>
|
1568
|
-
</annex>
|
1569
|
-
<bibliography>
|
1570
|
-
<references id='_' normative='true' obligation='informative'>
|
1571
|
-
<title>Normaj citaĵoj</title>
|
1572
|
-
<p id='_'>There are no normative references in this document.</p>
|
1573
|
-
</references>
|
1574
|
-
<references id='_' normative='true' obligation='informative'>
|
1575
|
-
<title>Normative References 2</title>
|
1576
|
-
</references>
|
1577
|
-
<references id='_' normative='false' obligation='informative'>
|
1578
|
-
<title>Bibliografio</title>
|
1579
|
-
</references>
|
1580
|
-
<clause id='_' obligation='informative'>
|
1581
|
-
<title>Bibliography 2</title>
|
1582
|
-
<references id='_' normative='false' obligation='informative'>
|
1583
|
-
<title>Bibliography Subsection</title>
|
1584
|
-
</references>
|
1585
|
-
</clause>
|
1586
|
-
</bibliography>
|
1587
|
-
</standard-document>
|
1588
|
-
OUTPUT
|
1589
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1590
|
-
.to be_equivalent_to xmlpp(output)
|
1591
|
-
end
|
1592
|
-
|
1593
|
-
it "adds variant titles" do
|
1594
|
-
input = <<~INPUT
|
1595
|
-
#{ASCIIDOC_BLANK_HDR}
|
1596
|
-
|
1597
|
-
== Clause
|
1598
|
-
Text
|
1599
|
-
|
1600
|
-
=== Subclause
|
1601
|
-
|
1602
|
-
[.variant-title,type=toc]
|
1603
|
-
Clause _A_ stem:[x]
|
1604
|
-
|
1605
|
-
[.variant-title,type=sub]
|
1606
|
-
"A" 'B'
|
1607
|
-
|
1608
|
-
Text
|
1609
|
-
|
1610
|
-
[appendix]
|
1611
|
-
== Clause
|
1612
|
-
|
1613
|
-
[.variant-title,type=toc]
|
1614
|
-
Clause _A_ stem:[y]
|
1615
|
-
|
1616
|
-
Text
|
1617
|
-
INPUT
|
1618
|
-
output = <<~OUTPUT
|
1619
|
-
#{BLANK_HDR}
|
1620
|
-
<sections>
|
1621
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1622
|
-
<title>Clause</title>
|
1623
|
-
<p id='_'>Text</p>
|
1624
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1625
|
-
<title>Subclause</title>
|
1626
|
-
<variant-title type='sub'>“A” ‘B’</variant-title>
|
1627
|
-
<variant-title type='toc'>
|
1628
|
-
Clause
|
1629
|
-
<em>A</em>
|
1630
|
-
<stem type='MathML'>
|
1631
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1632
|
-
<mi>x</mi>
|
1633
|
-
</math>
|
1634
|
-
</stem>
|
1635
|
-
</variant-title>
|
1636
|
-
<p id='_'>Text</p>
|
1637
|
-
</clause>
|
1638
|
-
</clause>
|
1639
|
-
</sections>
|
1640
|
-
<annex id='_' inline-header='false' obligation='normative'>
|
1641
|
-
<title>Clause</title>
|
1642
|
-
<variant-title type='toc'>
|
1643
|
-
Clause
|
1644
|
-
<em>A</em>
|
1645
|
-
<stem type='MathML'>
|
1646
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1647
|
-
<mi>y</mi>
|
1648
|
-
</math>
|
1649
|
-
</stem>
|
1650
|
-
</variant-title>
|
1651
|
-
<p id='_'>Text</p>
|
1652
|
-
</annex>
|
1653
|
-
</standard-document>
|
1654
|
-
OUTPUT
|
1655
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1656
|
-
.to be_equivalent_to xmlpp(output)
|
1657
|
-
end
|
1658
|
-
|
1659
|
-
it "processes TOC clause" do
|
1660
|
-
input = <<~INPUT
|
1661
|
-
#{ASCIIDOC_BLANK_HDR}
|
1662
|
-
|
1663
|
-
== Clause
|
1664
|
-
Text
|
1665
|
-
|
1666
|
-
[type=toc]
|
1667
|
-
=== Table of contents
|
1668
|
-
|
1669
|
-
Text at the start
|
1670
|
-
|
1671
|
-
==== Toc 1
|
1672
|
-
|
1673
|
-
* <<cl2>>
|
1674
|
-
** <<a1>>
|
1675
|
-
|
1676
|
-
==== Toc 2
|
1677
|
-
|
1678
|
-
* <<cl2,some text>>
|
1679
|
-
** <<a1,some more text>>
|
1680
|
-
|
1681
|
-
[[cl2]]
|
1682
|
-
== Clause2
|
1683
|
-
|
1684
|
-
[.variant-title,type=toc]
|
1685
|
-
Clause _A_ stem:[x]
|
1686
|
-
|
1687
|
-
[.variant-title,type=sub]
|
1688
|
-
"A" 'B'
|
1689
|
-
|
1690
|
-
Text
|
1691
|
-
|
1692
|
-
[[a1]]
|
1693
|
-
[appendix]
|
1694
|
-
== Clause
|
1695
|
-
|
1696
|
-
[.variant-title,type=toc]
|
1697
|
-
Clause _A_ stem:[y]
|
1698
|
-
|
1699
|
-
Text
|
1700
|
-
INPUT
|
1701
|
-
output = <<~OUTPUT
|
1702
|
-
#{BLANK_HDR}
|
1703
|
-
<sections>
|
1704
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1705
|
-
<title>Clause</title>
|
1706
|
-
<p id='_'>Text</p>
|
1707
|
-
<clause id='_' type='toc' inline-header='false' obligation='normative'>
|
1708
|
-
<title>Table of contents</title>
|
1709
|
-
<p id='_'>Text at the start</p>
|
1710
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1711
|
-
<title>Toc 1</title>
|
1712
|
-
<toc>
|
1713
|
-
<ul id='_'>
|
1714
|
-
<li>
|
1715
|
-
<p id='_'>
|
1716
|
-
<xref target='cl2'>
|
1717
|
-
Clause#{' '}
|
1718
|
-
<em>A</em>
|
1719
|
-
<stem type='MathML'>
|
1720
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1721
|
-
<mi>x</mi>
|
1722
|
-
</math>
|
1723
|
-
</stem>
|
1724
|
-
</xref>
|
1725
|
-
</p>
|
1726
|
-
<ul id='_'>
|
1727
|
-
<li>
|
1728
|
-
<p id='_'>
|
1729
|
-
<xref target='a1'>
|
1730
|
-
Clause#{' '}
|
1731
|
-
<em>A</em>
|
1732
|
-
<stem type='MathML'>
|
1733
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1734
|
-
<mi>y</mi>
|
1735
|
-
</math>
|
1736
|
-
</stem>
|
1737
|
-
</xref>
|
1738
|
-
</p>
|
1739
|
-
</li>
|
1740
|
-
</ul>
|
1741
|
-
</li>
|
1742
|
-
</ul>
|
1743
|
-
</toc>
|
1744
|
-
</clause>
|
1745
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1746
|
-
<title>Toc 2</title>
|
1747
|
-
<toc>
|
1748
|
-
<ul id='_'>
|
1749
|
-
<li>
|
1750
|
-
<p id='_'>
|
1751
|
-
<xref target='cl2'>some text</xref>
|
1752
|
-
</p>
|
1753
|
-
<ul id='_'>
|
1754
|
-
<li>
|
1755
|
-
<p id='_'>
|
1756
|
-
<xref target='a1'>some more text</xref>
|
1757
|
-
</p>
|
1758
|
-
</li>
|
1759
|
-
</ul>
|
1760
|
-
</li>
|
1761
|
-
</ul>
|
1762
|
-
</toc>
|
1763
|
-
</clause>
|
1764
|
-
</clause>
|
1765
|
-
</clause>
|
1766
|
-
<clause id='cl2' inline-header='false' obligation='normative'>
|
1767
|
-
<title>Clause2</title>
|
1768
|
-
<variant-title type='sub'>“A” ‘B’</variant-title>
|
1769
|
-
<variant-title type='toc'>
|
1770
|
-
Clause#{' '}
|
1771
|
-
<em>A</em>
|
1772
|
-
<stem type='MathML'>
|
1773
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1774
|
-
<mi>x</mi>
|
1775
|
-
</math>
|
1776
|
-
</stem>
|
1777
|
-
</variant-title>
|
1778
|
-
<p id='_'>Text</p>
|
1779
|
-
</clause>
|
1780
|
-
</sections>
|
1781
|
-
<annex id='a1' inline-header='false' obligation='normative'>
|
1782
|
-
<title>Clause</title>
|
1783
|
-
<variant-title type='toc'>
|
1784
|
-
Clause#{' '}
|
1785
|
-
<em>A</em>
|
1786
|
-
<stem type='MathML'>
|
1787
|
-
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1788
|
-
<mi>y</mi>
|
1789
|
-
</math>
|
1790
|
-
</stem>
|
1791
|
-
</variant-title>
|
1792
|
-
<p id='_'>Text</p>
|
1793
|
-
</annex>
|
1794
|
-
</standard-document>
|
1795
|
-
OUTPUT
|
1796
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1797
|
-
.to be_equivalent_to xmlpp(output)
|
1798
|
-
end
|
1799
|
-
|
1800
|
-
it "processes bibliography annex" do
|
1801
|
-
input = <<~INPUT
|
1802
|
-
#{ASCIIDOC_BLANK_HDR}
|
1803
|
-
|
1804
|
-
[appendix]
|
1805
|
-
== Bibliography
|
1806
|
-
|
1807
|
-
[bibliography]
|
1808
|
-
=== Bibliography
|
1809
|
-
INPUT
|
1810
|
-
output = <<~OUTPUT
|
1811
|
-
<annex id='_' obligation='' language='' script=''>
|
1812
|
-
<title>Bibliography</title>
|
1813
|
-
<references id='_' normative='false' obligation='informative'>
|
1814
|
-
<title>Bibliography</title>
|
1815
|
-
</references>
|
1816
|
-
</annex>
|
1817
|
-
OUTPUT
|
1818
|
-
ret = Nokogiri::XML(Asciidoctor.convert(input, *OPTIONS))
|
1819
|
-
expect(xmlpp(strip_guid(ret.at("//xmlns:annex").to_xml)))
|
1820
|
-
.to be_equivalent_to(output)
|
1821
|
-
end
|
1822
|
-
|
1823
|
-
it "processes terms annex" do
|
1824
|
-
input = <<~INPUT
|
1825
|
-
#{ASCIIDOC_BLANK_HDR}
|
1826
|
-
|
1827
|
-
[appendix]
|
1828
|
-
== Terms and definitions
|
1829
|
-
|
1830
|
-
=== Terms and definitions
|
1831
|
-
INPUT
|
1832
|
-
output = <<~OUTPUT
|
1833
|
-
<annex id='_' obligation='' language='' script=''>
|
1834
|
-
<terms id='_' obligation='normative'>
|
1835
|
-
<title>Terms and definitions</title>
|
1836
|
-
<term id='term-Terms-and-definitions'>
|
1837
|
-
<preferred>
|
1838
|
-
<expression>
|
1839
|
-
<name>Terms and definitions</name>
|
1840
|
-
</expression>
|
1841
|
-
</preferred>
|
1842
|
-
</term>
|
1843
|
-
</terms>
|
1844
|
-
</annex>
|
1845
|
-
OUTPUT
|
1846
|
-
ret = Nokogiri::XML(Asciidoctor.convert(input, *OPTIONS))
|
1847
|
-
expect(xmlpp(strip_guid(ret.at("//xmlns:annex").to_xml)))
|
1848
|
-
.to be_equivalent_to(output)
|
1849
|
-
end
|
1850
|
-
end
|