metanorma-standoc 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/macos.yml +0 -7
- data/.github/workflows/ubuntu.yml +6 -11
- data/.github/workflows/windows.yml +0 -8
- data/.rubocop.yml +1 -1
- data/Rakefile +2 -0
- data/lib/asciidoctor/standoc/base.rb +28 -27
- data/lib/asciidoctor/standoc/biblio.rng +1 -1
- data/lib/asciidoctor/standoc/blocks.rb +25 -95
- data/lib/asciidoctor/standoc/blocks_notes.rb +89 -0
- data/lib/asciidoctor/standoc/cleanup.rb +10 -6
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +11 -24
- data/lib/asciidoctor/standoc/cleanup_inline.rb +1 -1
- data/lib/asciidoctor/standoc/cleanup_ref.rb +47 -1
- data/lib/asciidoctor/standoc/cleanup_section.rb +72 -5
- data/lib/asciidoctor/standoc/cleanup_terms.rb +10 -0
- data/lib/asciidoctor/standoc/converter.rb +16 -2
- data/lib/asciidoctor/standoc/inline.rb +1 -1
- data/lib/asciidoctor/standoc/isodoc.rng +439 -6
- data/lib/asciidoctor/standoc/lists.rb +12 -12
- data/lib/asciidoctor/standoc/macros_yaml2text.rb +32 -15
- data/lib/asciidoctor/standoc/ref.rb +75 -34
- data/lib/asciidoctor/standoc/reqt.rb +11 -6
- data/lib/asciidoctor/standoc/reqt.rng +23 -0
- data/lib/asciidoctor/standoc/section.rb +27 -25
- data/lib/asciidoctor/standoc/table.rb +3 -2
- data/lib/asciidoctor/standoc/utils.rb +16 -0
- data/lib/asciidoctor/standoc/views/datamodel/model_representation.adoc.erb +1 -1
- data/lib/metanorma/standoc/processor.rb +5 -7
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +3 -2
- data/spec/asciidoctor-standoc/base_spec.rb +3 -2
- data/spec/asciidoctor-standoc/blocks_spec.rb +68 -32
- data/spec/asciidoctor-standoc/cleanup_spec.rb +1221 -17
- data/spec/asciidoctor-standoc/datamodel/attributes_table_preprocessor_spec.rb +35 -0
- data/spec/asciidoctor-standoc/inline_spec.rb +3 -3
- data/spec/asciidoctor-standoc/isobib_cache_spec.rb +4 -4
- data/spec/asciidoctor-standoc/lists_spec.rb +7 -5
- data/spec/asciidoctor-standoc/macros_spec.rb +4 -3
- data/spec/asciidoctor-standoc/refs_dl_spec.rb +8 -6
- data/spec/asciidoctor-standoc/refs_spec.rb +275 -30
- data/spec/asciidoctor-standoc/section_spec.rb +42 -38
- data/spec/asciidoctor-standoc/table_spec.rb +3 -3
- data/spec/asciidoctor-standoc/validate_spec.rb +56 -0
- data/spec/assets/{html.css → html.scss} +0 -0
- data/spec/assets/i18n.yaml +17 -2
- data/spec/assets/iso123.rxl +107 -0
- data/spec/assets/{word.css → word.scss} +0 -0
- data/spec/examples/datamodel/blank_definition_profile.adoc +4 -0
- data/spec/examples/datamodel/models/models/{Signature copy.yml → SignatureBlankDefinition.yml} +2 -2
- data/spec/fixtures/macros_datamodel/blank_definition_profile.xml +51 -0
- data/spec/metanorma/processor_spec.rb +5 -6
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +83 -83
- data/spec/vcr_cassettes/isobib_get_123.yml +19 -198
- data/spec/vcr_cassettes/isobib_get_123_1.yml +361 -0
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +19 -19
- data/spec/vcr_cassettes/isobib_get_124.yml +21 -21
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +10 -10
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +42 -42
- metadata +32 -18
- data/lib/asciidoctor-yaml/i18n-en.yaml +0 -20
- data/lib/asciidoctor-yaml/i18n-fr.yaml +0 -13
- data/lib/asciidoctor-yaml/i18n-zh-Hans.yaml +0 -15
- data/lib/asciidoctor/standoc/i18n.rb +0 -39
@@ -2,14 +2,15 @@ module Asciidoctor
|
|
2
2
|
module Standoc
|
3
3
|
module Table
|
4
4
|
def table_attrs(node)
|
5
|
-
|
5
|
+
keep_attrs(node).merge( id: Utils::anchor_or_uuid(node),
|
6
6
|
headerrows: node.attr("headerrows"),
|
7
7
|
unnumbered: node.option?("unnumbered") ? "true" : nil,
|
8
|
+
number: node.attr("number"),
|
8
9
|
subsequence: node.attr("subsequence"),
|
9
10
|
alt: node.attr("alt"),
|
10
11
|
summary: node.attr("summary"),
|
11
12
|
width: node.attr("width"),
|
12
|
-
|
13
|
+
)
|
13
14
|
end
|
14
15
|
|
15
16
|
def table(node)
|
@@ -173,6 +173,22 @@ module Asciidoctor
|
|
173
173
|
|
174
174
|
SUBCLAUSE_XPATH = "//clause[not(parent::sections)]"\
|
175
175
|
"[not(ancestor::boilerplate)]".freeze
|
176
|
+
|
177
|
+
def isodoc(lang, script, i18nyaml = nil)
|
178
|
+
conv = html_converter(EmptyAttr.new)
|
179
|
+
i18n = conv.i18n_init(lang, script, i18nyaml)
|
180
|
+
conv.metadata_init(lang, script, i18n)
|
181
|
+
conv
|
182
|
+
end
|
183
|
+
|
184
|
+
class EmptyAttr
|
185
|
+
def attr(_x)
|
186
|
+
nil
|
187
|
+
end
|
188
|
+
def attributes
|
189
|
+
{}
|
190
|
+
end
|
191
|
+
end
|
176
192
|
end
|
177
193
|
end
|
178
194
|
end
|
@@ -11,7 +11,7 @@
|
|
11
11
|
|Name |Definition |Mandatory/ Optional/ Conditional |Max Occur |Data Type
|
12
12
|
|
13
13
|
{definition.attributes&.*,key,EOK}
|
14
|
-
|{key} |{definition.attributes[key].definition || "TODO: enum " + key + "'s definition"} |{definition.attributes[key]&.cardinality&.min == 0 ? "O" : "M"} |{definition.attributes[key]&.cardinality&.max == "*" ? "N" : "1"} |{definition.attributes[key].origin ? "<<" + definition.attributes[key].origin + ">>" : ""}`{definition.attributes[key].type}`
|
14
|
+
|{key} |{definition.attributes[key].definition || "TODO: enum " + key.to_s + "'s definition"} |{definition.attributes[key]&.cardinality&.min == 0 ? "O" : "M"} |{definition.attributes[key]&.cardinality&.max == "*" ? "N" : "1"} |{definition.attributes[key].origin ? "<<" + definition.attributes[key].origin.to_s + ">>" : ""}`{definition.attributes[key].type}`
|
15
15
|
{EOK}
|
16
16
|
|===
|
17
17
|
{end}
|
@@ -21,16 +21,14 @@ module Metanorma
|
|
21
21
|
"Metanorma::Standoc #{Metanorma::Standoc::VERSION}/IsoDoc #{IsoDoc::VERSION}"
|
22
22
|
end
|
23
23
|
|
24
|
-
def
|
25
|
-
Metanorma::Input::Asciidoc.new.process(file, filename, @asciidoctor_backend)
|
26
|
-
end
|
27
|
-
|
28
|
-
def output(isodoc_node, outname, format, options={})
|
24
|
+
def output(isodoc_node, inname, outname, format, options={})
|
29
25
|
case format
|
30
26
|
when :html
|
31
|
-
IsoDoc::HtmlConvert.new(options).convert(
|
27
|
+
IsoDoc::HtmlConvert.new(options).convert(inname, isodoc_node, nil, outname)
|
32
28
|
when :doc
|
33
|
-
IsoDoc::WordConvert.new(options).convert(
|
29
|
+
IsoDoc::WordConvert.new(options).convert(inname, isodoc_node, nil, outname)
|
30
|
+
when :presentation
|
31
|
+
IsoDoc::PresentationXMLConvert.new(options).convert(inname, isodoc_node, nil, outname)
|
34
32
|
else
|
35
33
|
super
|
36
34
|
end
|
data/metanorma-standoc.gemspec
CHANGED
@@ -28,9 +28,9 @@ Gem::Specification.new do |spec|
|
|
28
28
|
|
29
29
|
spec.add_dependency "asciidoctor", "~> 2.0.0"
|
30
30
|
spec.add_dependency "ruby-jing"
|
31
|
-
spec.add_dependency "isodoc", "~> 1.0
|
31
|
+
spec.add_dependency "isodoc", "~> 1.2.0"
|
32
32
|
spec.add_dependency "iev", "~> 0.2.1"
|
33
|
-
spec.add_dependency "relaton", "~> 1.
|
33
|
+
spec.add_dependency "relaton", "~> 1.2.0"
|
34
34
|
spec.add_dependency "relaton-iev", "~> 1.0.0"
|
35
35
|
spec.add_dependency "sterile", "~> 1.0.14"
|
36
36
|
spec.add_dependency "concurrent-ruby"
|
@@ -39,6 +39,7 @@ Gem::Specification.new do |spec|
|
|
39
39
|
spec.add_dependency "mathml2asciimath"
|
40
40
|
|
41
41
|
spec.add_development_dependency "byebug"
|
42
|
+
spec.add_development_dependency "sassc", "2.4.0"
|
42
43
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
43
44
|
spec.add_development_dependency "guard", "~> 2.14"
|
44
45
|
spec.add_development_dependency "guard-rspec", "~> 4.7"
|
@@ -414,6 +414,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
414
414
|
</bibdata>
|
415
415
|
<preface>
|
416
416
|
<abstract id='_'>
|
417
|
+
<title>Abstract</title>
|
417
418
|
<p id='_'>This is the abstract of the document</p>
|
418
419
|
<p id='_'>This is the second paragraph of the abstract of the document.</p>
|
419
420
|
</abstract>
|
@@ -451,7 +452,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
451
452
|
:body-font: Zapf Chancery
|
452
453
|
:header-font: Comic Sans
|
453
454
|
:monospace-font: Andale Mono
|
454
|
-
:htmlstylesheet: spec/assets/html.
|
455
|
+
:htmlstylesheet: spec/assets/html.scss
|
455
456
|
:htmlcoverpage: spec/assets/htmlcover.html
|
456
457
|
:htmlintropage: spec/assets/htmlintro.html
|
457
458
|
:scripts: spec/assets/scripts.html
|
@@ -483,7 +484,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
483
484
|
:body-font: Zapf Chancery
|
484
485
|
:header-font: Comic Sans
|
485
486
|
:monospace-font: Andale Mono
|
486
|
-
:wordstylesheet: spec/assets/word.
|
487
|
+
:wordstylesheet: spec/assets/word.scss
|
487
488
|
:wordcoverpage: spec/assets/wordcover.html
|
488
489
|
:wordintropage: spec/assets/wordintro.html
|
489
490
|
:header: spec/assets/header.html
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
require "open3"
|
3
3
|
|
4
4
|
RSpec.describe Asciidoctor::Standoc do
|
5
|
-
it "processes pass blocks" do
|
5
|
+
it "processes format-specific pass blocks" do
|
6
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
|
|
@@ -19,6 +19,26 @@ RSpec.describe Asciidoctor::Standoc do
|
|
19
19
|
OUTPUT
|
20
20
|
end
|
21
21
|
|
22
|
+
it "processes Metanorma XML pass blocks" do
|
23
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
24
|
+
#{ASCIIDOC_BLANK_HDR}
|
25
|
+
|
26
|
+
++++
|
27
|
+
<abc>X >
|
28
|
+
++++
|
29
|
+
|
30
|
+
++++
|
31
|
+
Y</abc>
|
32
|
+
++++
|
33
|
+
INPUT
|
34
|
+
#{BLANK_HDR}
|
35
|
+
<sections>
|
36
|
+
<abc>X > Y</abc>
|
37
|
+
</sections>
|
38
|
+
</standard-document>
|
39
|
+
OUTPUT
|
40
|
+
end
|
41
|
+
|
22
42
|
it "processes open blocks" do
|
23
43
|
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
24
44
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -43,7 +63,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
43
63
|
#{ASCIIDOC_BLANK_HDR}
|
44
64
|
|
45
65
|
[[ABC]]
|
46
|
-
[stem%inequality]
|
66
|
+
[stem%inequality,number=3,keep-with-next=true,keep-lines-together=true]
|
47
67
|
++++
|
48
68
|
r = 1 %
|
49
69
|
r = 1 %
|
@@ -67,7 +87,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
67
87
|
INPUT
|
68
88
|
#{BLANK_HDR}
|
69
89
|
<sections>
|
70
|
-
<formula id="ABC" inequality="true">
|
90
|
+
<formula id="ABC" inequality="true" number="3" keep-with-next="true" keep-lines-together="true">
|
71
91
|
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>r</mi><mo>=</mo><mn>1</mn><mi>%</mi><mi>r</mi><mo>=</mo><mn>1</mn><mi>%</mi></math></stem>
|
72
92
|
</formula>
|
73
93
|
|
@@ -76,7 +96,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
76
96
|
</formula>
|
77
97
|
<formula id="_" subsequence="A">
|
78
98
|
<stem type="MathML">
|
79
|
-
<math xmlns="http://www.w3.org/1998/Math/MathML"
|
99
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
80
100
|
<mrow>
|
81
101
|
<mi>M</mi>
|
82
102
|
<mo>=</mo>
|
@@ -341,6 +361,10 @@ RSpec.describe Asciidoctor::Standoc do
|
|
341
361
|
#{ASCIIDOC_BLANK_HDR}
|
342
362
|
== Terms and Definitions
|
343
363
|
|
364
|
+
NOTE: This is not a termnote
|
365
|
+
|
366
|
+
EXAMPLE: This is not a termexample
|
367
|
+
|
344
368
|
[.nonterm]
|
345
369
|
=== Term1
|
346
370
|
|
@@ -351,6 +375,9 @@ RSpec.describe Asciidoctor::Standoc do
|
|
351
375
|
<terms id="_" obligation="normative">
|
352
376
|
<title>Terms and definitions</title>
|
353
377
|
<p id="_">No terms and definitions are listed in this document.</p>
|
378
|
+
<note id='_'>
|
379
|
+
<p id='_'>This is not a termnote</p>
|
380
|
+
</note>
|
354
381
|
<clause id="_" inline-header="false" obligation="normative">
|
355
382
|
<title>Term1</title>
|
356
383
|
<note id="_">
|
@@ -377,12 +404,12 @@ RSpec.describe Asciidoctor::Standoc do
|
|
377
404
|
INPUT
|
378
405
|
#{BLANK_HDR}
|
379
406
|
<sections>
|
380
|
-
<terms id="_" obligation="normative"><title>Terms, definitions
|
407
|
+
<terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
|
381
408
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
382
409
|
<term id="_">
|
383
410
|
<preferred>Term1</preferred>
|
384
411
|
</term>
|
385
|
-
<definitions id="_">
|
412
|
+
<definitions id="_" obligation="normative" type="symbols">
|
386
413
|
<title>Symbols</title>
|
387
414
|
<note id="_">
|
388
415
|
<p id="_">This is a note</p>
|
@@ -404,7 +431,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
404
431
|
[[ABC]]
|
405
432
|
NOTE: This is a note
|
406
433
|
|
407
|
-
[NOTE,keep-separate=true]
|
434
|
+
[NOTE,keep-separate=true,number=7,subsequence=A,beforeclauses=true,keep-with-next=true,keep-lines-together=true,type=classified]
|
408
435
|
====
|
409
436
|
XYZ
|
410
437
|
====
|
@@ -416,14 +443,14 @@ RSpec.describe Asciidoctor::Standoc do
|
|
416
443
|
<p id="_">This is a note</p>
|
417
444
|
</note>
|
418
445
|
</foreword></preface><sections>
|
446
|
+
<note id='_' number="7" subsequence="A" keep-with-next="true" keep-lines-together="true" type="classified">
|
447
|
+
<p id='_'>XYZ</p>
|
448
|
+
</note>
|
419
449
|
<clause id="_" inline-header="false" obligation="normative">
|
420
450
|
<title>Clause 1</title>
|
421
451
|
<note id="ABC">
|
422
452
|
<p id="_">This is a note</p>
|
423
453
|
</note>
|
424
|
-
<note id='_'>
|
425
|
-
<p id='_'>XYZ</p>
|
426
|
-
</note>
|
427
454
|
</clause></sections>
|
428
455
|
|
429
456
|
</standard-document>
|
@@ -436,7 +463,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
436
463
|
#{ASCIIDOC_BLANK_HDR}
|
437
464
|
|
438
465
|
[[ABC]]
|
439
|
-
[alt=Literal]
|
466
|
+
[alt=Literal,keep-with-next=true,keep-lines-together=true]
|
440
467
|
....
|
441
468
|
<LITERAL>
|
442
469
|
FIGURATIVE
|
@@ -444,7 +471,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
444
471
|
INPUT
|
445
472
|
#{BLANK_HDR}
|
446
473
|
<sections>
|
447
|
-
<figure id="ABC">
|
474
|
+
<figure id="ABC" keep-with-next="true" keep-lines-together="true">
|
448
475
|
<pre alt="Literal" id="_"><LITERAL>
|
449
476
|
FIGURATIVE
|
450
477
|
</pre>
|
@@ -477,7 +504,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
477
504
|
#{ASCIIDOC_BLANK_HDR}
|
478
505
|
|
479
506
|
[[ABC]]
|
480
|
-
[CAUTION,type=Safety Precautions]
|
507
|
+
[CAUTION,type=Safety Precautions,keep-with-next="true",keep-lines-together="true"]
|
481
508
|
.Precautions
|
482
509
|
====
|
483
510
|
While werewolves are hardy community members, keep in mind the following dietary concerns:
|
@@ -489,7 +516,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
489
516
|
INPUT
|
490
517
|
#{BLANK_HDR}
|
491
518
|
<sections>
|
492
|
-
<admonition id="ABC" type="safety precautions"
|
519
|
+
<admonition id="ABC" type="safety precautions" keep-with-next="true" keep-lines-together="true">
|
520
|
+
<name>Precautions</name><p id="_">While werewolves are hardy community members, keep in mind the following dietary concerns:</p>
|
493
521
|
<ol id="_" type="arabic">
|
494
522
|
<li>
|
495
523
|
<p id="_">They are allergic to cinnamon.</p>
|
@@ -577,11 +605,11 @@ RSpec.describe Asciidoctor::Standoc do
|
|
577
605
|
INPUT
|
578
606
|
#{BLANK_HDR}
|
579
607
|
<sections>
|
580
|
-
<terms id="_" obligation="normative"><title>Terms, definitions
|
608
|
+
<terms id="_" obligation="normative"><title>Terms, definitions and symbols</title>
|
581
609
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p><term id="_">
|
582
610
|
<preferred>Term1</preferred>
|
583
611
|
</term>
|
584
|
-
<definitions id="_">
|
612
|
+
<definitions id="_" obligation="normative" type="symbols">
|
585
613
|
<title>Symbols</title>
|
586
614
|
<example id="_">
|
587
615
|
<p id="_">This is an example</p>
|
@@ -598,7 +626,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
598
626
|
#{ASCIIDOC_BLANK_HDR}
|
599
627
|
|
600
628
|
[[ABC]]
|
601
|
-
[example,subsequence=A]
|
629
|
+
[example,subsequence=A,keep-with-next=true,keep-lines-together=next]
|
602
630
|
.Title
|
603
631
|
====
|
604
632
|
This is an example
|
@@ -610,14 +638,20 @@ RSpec.describe Asciidoctor::Standoc do
|
|
610
638
|
====
|
611
639
|
This is another example
|
612
640
|
====
|
641
|
+
|
642
|
+
[example,number=3]
|
643
|
+
====
|
644
|
+
This is yet another example
|
645
|
+
====
|
613
646
|
INPUT
|
614
647
|
#{BLANK_HDR}
|
615
648
|
<sections>
|
616
|
-
<example id="ABC" subsequence="A">
|
649
|
+
<example id="ABC" subsequence="A" keep-with-next='true' keep-lines-together='next'>
|
617
650
|
<name>Title</name>
|
618
651
|
<p id="_">This is an example</p>
|
619
652
|
<p id="_">Amen</p></example>
|
620
653
|
<example id="_" unnumbered="true"><p id="_">This is another example</p></example>
|
654
|
+
<example id="_" number="3"><p id="_">This is yet another example</p></example>
|
621
655
|
</sections>
|
622
656
|
</standard-document>
|
623
657
|
OUTPUT
|
@@ -652,7 +686,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
652
686
|
INPUT
|
653
687
|
#{BLANK_HDR}
|
654
688
|
<preface><foreword id="_" obligation="informative">
|
655
|
-
<title>
|
689
|
+
<title>Foreword</title>
|
656
690
|
<p id="_">This is a preamble</p>
|
657
691
|
</foreword></preface><sections>
|
658
692
|
<clause id="_" inline-header="false" obligation="normative">
|
@@ -741,14 +775,14 @@ RSpec.describe Asciidoctor::Standoc do
|
|
741
775
|
#{ASCIIDOC_BLANK_HDR}
|
742
776
|
|
743
777
|
[[ABC]]
|
744
|
-
[%unnumbered]
|
778
|
+
[%unnumbered,number=3]
|
745
779
|
.Split-it-right sample divider
|
746
780
|
image::spec/examples/rice_images/rice_image1.png[alttext]
|
747
781
|
|
748
782
|
INPUT
|
749
783
|
#{BLANK_HDR}
|
750
784
|
<sections>
|
751
|
-
<figure id="ABC" unnumbered="true">
|
785
|
+
<figure id="ABC" unnumbered="true" number="3">
|
752
786
|
<name>Split-it-right sample divider</name>
|
753
787
|
<image src="spec/examples/rice_images/rice_image1.png" id="_" mimetype="image/png" height="auto" width="auto" alt="alttext"/>
|
754
788
|
</figure>
|
@@ -840,15 +874,15 @@ RSpec.describe Asciidoctor::Standoc do
|
|
840
874
|
INPUT
|
841
875
|
end
|
842
876
|
|
843
|
-
it "accepts
|
877
|
+
it "accepts attributes on paragraphs" do
|
844
878
|
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
845
879
|
#{ASCIIDOC_BLANK_HDR}
|
846
|
-
[align=right]
|
880
|
+
[align=right,keep-with-next=true,keep-lines-together=true]
|
847
881
|
This para is right-aligned.
|
848
882
|
INPUT
|
849
883
|
#{BLANK_HDR}
|
850
884
|
<sections>
|
851
|
-
<p align="right" id="_">This para is right-aligned.</p>
|
885
|
+
<p align="right" id="_" keep-with-next="true" keep-lines-together="true">This para is right-aligned.</p>
|
852
886
|
</sections>
|
853
887
|
</standard-document>
|
854
888
|
OUTPUT
|
@@ -859,14 +893,14 @@ RSpec.describe Asciidoctor::Standoc do
|
|
859
893
|
#{ASCIIDOC_BLANK_HDR}
|
860
894
|
|
861
895
|
[[ABC]]
|
862
|
-
[quote, ISO, "ISO7301,section 1"]
|
896
|
+
[quote, ISO, "ISO7301,section 1",align="right",keep-with-next=true,keep-lines-together=true]
|
863
897
|
____
|
864
898
|
Block quotation
|
865
899
|
____
|
866
900
|
INPUT
|
867
901
|
#{BLANK_HDR}
|
868
902
|
<sections>
|
869
|
-
<quote id="ABC">
|
903
|
+
<quote id="ABC" align="right" keep-with-next="true" keep-lines-together="true">
|
870
904
|
<source type="inline" bibitemid="ISO7301" citeas="">
|
871
905
|
<localityStack>
|
872
906
|
<locality type="section"><referenceFrom>1</referenceFrom></locality>
|
@@ -886,7 +920,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
886
920
|
|
887
921
|
[[ABC]]
|
888
922
|
.Caption
|
889
|
-
[source%unnumbered,ruby,filename=sourcecode1.rb]
|
923
|
+
[source%unnumbered,ruby,number=3,filename=sourcecode1.rb,keep-with-next=true,keep-lines-together=true]
|
890
924
|
--
|
891
925
|
puts "Hello, world."
|
892
926
|
%w{a b c}.each do |x|
|
@@ -896,7 +930,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
896
930
|
INPUT
|
897
931
|
#{BLANK_HDR}
|
898
932
|
<sections>
|
899
|
-
<sourcecode id="ABC" lang="ruby" filename="sourcecode1.rb" unnumbered="true"
|
933
|
+
<sourcecode id="ABC" lang="ruby" filename="sourcecode1.rb" unnumbered="true" number="3" keep-with-next="true" keep-lines-together="true">
|
934
|
+
<name>Caption</name>puts "Hello, world."
|
900
935
|
%w{a b c}.each do |x|
|
901
936
|
puts x
|
902
937
|
end</sourcecode>
|
@@ -1082,7 +1117,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1082
1117
|
input = <<~"INPUT"
|
1083
1118
|
#{ASCIIDOC_BLANK_HDR}
|
1084
1119
|
[[ABC]]
|
1085
|
-
[.requirement,subsequence="A",inherit="/ss/584/2015/level/1 & /ss/584/2015/level/2"]
|
1120
|
+
[.requirement,subsequence="A",inherit="/ss/584/2015/level/1 & /ss/584/2015/level/2",number=3,keep-with-next=true,keep-lines-together=true]
|
1086
1121
|
.Title
|
1087
1122
|
====
|
1088
1123
|
I recommend this
|
@@ -1091,7 +1126,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1091
1126
|
output = <<~"OUTPUT"
|
1092
1127
|
#{BLANK_HDR}
|
1093
1128
|
<sections>
|
1094
|
-
<requirement id="ABC" subsequence="A"
|
1129
|
+
<requirement id="ABC" subsequence="A" number="3" keep-with-next="true" keep-lines-together="true">
|
1130
|
+
<title>Title</title>
|
1095
1131
|
<inherit>/ss/584/2015/level/1 & /ss/584/2015/level/2</inherit>
|
1096
1132
|
<description><p id="_">I recommend this</p></description>
|
1097
1133
|
</requirement>
|
@@ -1169,7 +1205,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1169
1205
|
====
|
1170
1206
|
I recommend _this_.
|
1171
1207
|
|
1172
|
-
[.specification,type="tabular"]
|
1208
|
+
[.specification,type="tabular",keep-with-next=true,keep-lines-together=true]
|
1173
1209
|
--
|
1174
1210
|
This is the object of the recommendation:
|
1175
1211
|
|===
|
@@ -1217,7 +1253,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1217
1253
|
<recommendation id="ABC" obligation="permission,recommendation" filename="reqt1.rq"><label>/ogc/recommendation/wfs/2</label><subject>user</subject>
|
1218
1254
|
<classification><tag>control-class</tag><value>Technical</value></classification><classification><tag>priority</tag><value>P0</value></classification><classification><tag>family</tag><value>System & Communications Protection</value></classification><classification><tag>family</tag><value>System and Communications Protocols</value></classification>
|
1219
1255
|
<description><p id="_">I recommend <em>this</em>.</p>
|
1220
|
-
</description><specification exclude="false" type="tabular"><p id="_">This is the object of the recommendation:</p><table id="_"> <tbody> <tr> <td align="left">Object</td> <td align="left">Value</td> </tr> <tr> <td align="left">Mission</td> <td align="left">Accomplished</td> </tr> </tbody></table></specification><description>
|
1256
|
+
</description><specification exclude="false" type="tabular" keep-with-next="true" keep-lines-together="true"><p id="_">This is the object of the recommendation:</p><table id="_"> <tbody> <tr> <td align="left">Object</td> <td align="left">Value</td> </tr> <tr> <td align="left">Mission</td> <td align="left">Accomplished</td> </tr> </tbody></table></specification><description>
|
1221
1257
|
<p id="_">As for the measurement targets,</p>
|
1222
1258
|
</description><measurement-target exclude="false"><p id="_">The measurement target shall be measured as:</p><formula id="_"> <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mi>r</mi><mn>1</mn></mfrac><mo>=</mo><mn>0</mn></math></stem></formula></measurement-target>
|
1223
1259
|
<verification exclude="false"><p id="_">The following code will be run for verification:</p><sourcecode lang="CoreRoot" id="_">CoreRoot(success): HttpResponse
|
@@ -360,7 +360,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
360
360
|
</p>
|
361
361
|
</foreword></preface><sections>
|
362
362
|
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
363
|
-
<title>Normative
|
363
|
+
<title>Normative references</title>
|
364
364
|
#{NORM_REF_BOILERPLATE}
|
365
365
|
<bibitem id="iso216" type="standard">
|
366
366
|
<title format="text/plain">Reference</title>
|
@@ -438,7 +438,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
438
438
|
</p>
|
439
439
|
</foreword></preface><sections>
|
440
440
|
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
441
|
-
<title>Normative
|
441
|
+
<title>Normative references</title>
|
442
442
|
#{NORM_REF_BOILERPLATE}
|
443
443
|
<bibitem id="iso216" type="standard">
|
444
444
|
<title format="text/plain">Reference</title>
|
@@ -538,7 +538,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
538
538
|
INPUT
|
539
539
|
#{BLANK_HDR}
|
540
540
|
<sections></sections>
|
541
|
-
<bibliography><references id="_" obligation="informative" normative="true"><title>Normative
|
541
|
+
<bibliography><references id="_" obligation="informative" normative="true"><title>Normative references</title>
|
542
542
|
#{NORM_REF_BOILERPLATE}
|
543
543
|
<bibitem id="iso216" type="standard">
|
544
544
|
<title format="text/plain">Reference</title>
|
@@ -826,7 +826,7 @@ end
|
|
826
826
|
INPUT
|
827
827
|
#{BLANK_HDR}
|
828
828
|
<sections><formula id="_">
|
829
|
-
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>F</mi><
|
829
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mi>F</mi><mi>or</mi><mi>μ</mi><mi>l</mi><mi>a</mi></math></stem>
|
830
830
|
<dl id="_">
|
831
831
|
<dt>a</dt>
|
832
832
|
<dd>
|
@@ -967,7 +967,7 @@ end
|
|
967
967
|
</fn>
|
968
968
|
</p>
|
969
969
|
</clause></sections><bibliography><references id="_" obligation="informative" normative="true">
|
970
|
-
<title>Normative
|
970
|
+
<title>Normative references</title>
|
971
971
|
#{NORM_REF_BOILERPLATE}
|
972
972
|
<bibitem id="iso123" type="standard">
|
973
973
|
<title format="text/plain">Standard</title>
|
@@ -982,7 +982,7 @@ end
|
|
982
982
|
<name>ISO</name>
|
983
983
|
</organization>
|
984
984
|
</contributor>
|
985
|
-
<note format="text/plain"
|
985
|
+
<note format="text/plain" type="ISO DATE">The standard is in press</note>
|
986
986
|
</bibitem>
|
987
987
|
</references>
|
988
988
|
</bibliography>
|
@@ -1198,13 +1198,13 @@ end
|
|
1198
1198
|
</origin>
|
1199
1199
|
</termsource>
|
1200
1200
|
</term></terms></sections><bibliography><references id="_" obligation="informative" normative="true">
|
1201
|
-
<title>Normative
|
1201
|
+
<title>Normative references</title>
|
1202
1202
|
#{NORM_REF_BOILERPLATE}
|
1203
1203
|
<bibitem type="standard" id="IEC60050-102">
|
1204
1204
|
<fetched>#{Date.today}</fetched>
|
1205
1205
|
<title type="title-main" format="text/plain" language="en" script="Latn">International Electrotechnical Vocabulary (IEV)</title>
|
1206
1206
|
<title type="title-part" format="text/plain" language="en" script="Latn">Part 102: Mathematics — General concepts and linear algebra</title>
|
1207
|
-
<title type=
|
1207
|
+
<title type='main' format='text/plain' language='en' script='Latn'>International Electrotechnical Vocabulary (IEV) — Part 102: Mathematics — General concepts and linear algebra</title>
|
1208
1208
|
<uri type="src">https://webstore.iec.ch/publication/160</uri>
|
1209
1209
|
<uri type="obp">/preview/info_iec60050-102%7Bed1.0%7Db.pdf</uri>
|
1210
1210
|
<docidentifier type="IEC">IEC 60050-102:2007</docidentifier>
|
@@ -1222,7 +1222,7 @@ end
|
|
1222
1222
|
<edition>1.0</edition>
|
1223
1223
|
<language>en</language>
|
1224
1224
|
<script>Latn</script>
|
1225
|
-
<abstract format="text/plain" language="en" script="Latn">This part of IEC 60050 gives the general mathematical terminology used in the fields of electricity, electronics and telecommunications, together with basic concepts in linear algebra. It maintains a clear distinction between mathematical concepts and physical concepts, even if some terms are used in both cases. Another part will deal with functions
|
1225
|
+
<abstract format="text/plain" language="en" script="Latn">This part of IEC 60050 gives the general mathematical terminology used in the fields of electricity, electronics and telecommunications, together with basic concepts in linear algebra. It maintains a clear distinction between mathematical concepts and physical concepts, even if some terms are used in both cases. Another part will deal with functions. It has the status of a horizontal standard in accordance with IEC Guide 108.</abstract>
|
1226
1226
|
<status>
|
1227
1227
|
<stage>60</stage>
|
1228
1228
|
<substage>60</substage>
|
@@ -1242,7 +1242,7 @@ end
|
|
1242
1242
|
<fetched>#{Date.today}</fetched>
|
1243
1243
|
<title type="title-main" format="text/plain" language="en" script="Latn">International Electrotechnical Vocabulary (IEV)</title>
|
1244
1244
|
<title type="title-part" format="text/plain" language="en" script="Latn">Part 103: Mathematics — Functions</title>
|
1245
|
-
<title type="main" format="text/plain" language="en" script="Latn">International Electrotechnical Vocabulary (IEV)
|
1245
|
+
<title type="main" format="text/plain" language="en" script="Latn">International Electrotechnical Vocabulary (IEV) — Part 103: Mathematics — Functions</title>
|
1246
1246
|
<uri type="src">https://webstore.iec.ch/publication/161</uri>
|
1247
1247
|
<uri type="obp">/preview/info_iec60050-103%7Bed1.0%7Db.pdf</uri>
|
1248
1248
|
<docidentifier type="IEC">IEC 60050-103:2009</docidentifier>
|
@@ -1515,7 +1515,7 @@ OUTPUT
|
|
1515
1515
|
<sections>
|
1516
1516
|
|
1517
1517
|
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
1518
|
-
<title>Normative
|
1518
|
+
<title>Normative references</title><p id="_">There are no normative references in this document.</p>
|
1519
1519
|
</references></bibliography>
|
1520
1520
|
</standard-document>
|
1521
1521
|
OUTPUT
|
@@ -1534,7 +1534,7 @@ OUTPUT
|
|
1534
1534
|
<sections>
|
1535
1535
|
|
1536
1536
|
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
1537
|
-
<title>Normative
|
1537
|
+
<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>
|
1538
1538
|
<bibitem id="a">
|
1539
1539
|
<formattedref format="application/x-isodoc+xml">A</formattedref>
|
1540
1540
|
<docidentifier>b</docidentifier>
|
@@ -1563,7 +1563,7 @@ it "inserts boilerplate before empty Normative References in French" do
|
|
1563
1563
|
<sections>
|
1564
1564
|
|
1565
1565
|
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
1566
|
-
<title>
|
1566
|
+
<title>Références normatives</title><p id="_">Le présent document ne contient aucune référence normative.</p>
|
1567
1567
|
</references></bibliography>
|
1568
1568
|
</standard-document>
|
1569
1569
|
OUTPUT
|
@@ -1608,7 +1608,7 @@ it "removes bibdata bibitem IDs" do
|
|
1608
1608
|
<sections> </sections>
|
1609
1609
|
<bibliography>
|
1610
1610
|
<references id='_' obligation='informative' normative="true">
|
1611
|
-
<title>Normative
|
1611
|
+
<title>Normative references</title>
|
1612
1612
|
<p id="_">There are no normative references in this document.</p>
|
1613
1613
|
</references>
|
1614
1614
|
</bibliography>
|
@@ -1672,7 +1672,7 @@ it "sorts symbols lists" do
|
|
1672
1672
|
INPUT
|
1673
1673
|
#{BLANK_HDR}
|
1674
1674
|
<sections>
|
1675
|
-
<definitions id='L'>
|
1675
|
+
<definitions id='L' obligation="normative">
|
1676
1676
|
<title>Symbols and abbreviated terms</title>
|
1677
1677
|
<dl id='_'>
|
1678
1678
|
<dt>x</dt>
|
@@ -1717,7 +1717,7 @@ it "sorts symbols lists" do
|
|
1717
1717
|
INPUT
|
1718
1718
|
#{BLANK_HDR}
|
1719
1719
|
<sections>
|
1720
|
-
<definitions id='L'>
|
1720
|
+
<definitions id='L' obligation="normative">
|
1721
1721
|
<title>Symbols and abbreviated terms</title>
|
1722
1722
|
<dl id='_'>
|
1723
1723
|
<dt>x</dt>
|
@@ -1888,7 +1888,7 @@ INPUT
|
|
1888
1888
|
<admonition id='_' type='important'>
|
1889
1889
|
<p id='_'>Notice which is very important</p>
|
1890
1890
|
</admonition>
|
1891
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
1891
|
+
<clause id='_' inline-header='false' obligation='normative' type="scope">
|
1892
1892
|
<title>Scope</title>
|
1893
1893
|
<p id='_'>Scope statement</p>
|
1894
1894
|
</clause>
|
@@ -1899,6 +1899,1210 @@ OUTPUT
|
|
1899
1899
|
end
|
1900
1900
|
|
1901
1901
|
|
1902
|
+
it "processes section names, with footnotes" do
|
1903
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1904
|
+
#{ASCIIDOC_BLANK_HDR}
|
1905
|
+
.Foreword.footnote:[A]
|
1906
|
+
|
1907
|
+
Text
|
1908
|
+
|
1909
|
+
[abstract]
|
1910
|
+
== Abstract.footnote:[A]
|
1911
|
+
|
1912
|
+
Text
|
1913
|
+
|
1914
|
+
[heading=introduction]
|
1915
|
+
== Introduction.footnote:[A]
|
1916
|
+
|
1917
|
+
=== Introduction Subsection
|
1918
|
+
|
1919
|
+
[heading=acknowledgements]
|
1920
|
+
== Acknowledgements.footnote:[A]
|
1921
|
+
|
1922
|
+
[.preface]
|
1923
|
+
== Dedication
|
1924
|
+
|
1925
|
+
[heading=scope]
|
1926
|
+
== Scope.footnote:[A]
|
1927
|
+
|
1928
|
+
Text
|
1929
|
+
|
1930
|
+
[bibliography,heading=normative references]
|
1931
|
+
== Normative References.footnote:[A]
|
1932
|
+
|
1933
|
+
[bibliography,normative=true]
|
1934
|
+
== Normative References 2.footnote:[A]
|
1935
|
+
|
1936
|
+
[heading=terms and definitions]
|
1937
|
+
== Terms and Definitions.footnote:[A]
|
1938
|
+
|
1939
|
+
=== Term1
|
1940
|
+
|
1941
|
+
[heading="terms and definitions"]
|
1942
|
+
== Terms, Definitions, Symbols and Abbreviated Terms.footnote:[A]
|
1943
|
+
|
1944
|
+
[.nonterm]
|
1945
|
+
=== Introduction
|
1946
|
+
|
1947
|
+
==== Intro 1
|
1948
|
+
|
1949
|
+
=== Intro 2
|
1950
|
+
|
1951
|
+
[.nonterm]
|
1952
|
+
==== Intro 3
|
1953
|
+
|
1954
|
+
=== Intro 4
|
1955
|
+
|
1956
|
+
==== Intro 5
|
1957
|
+
|
1958
|
+
===== Term1
|
1959
|
+
|
1960
|
+
=== Normal Terms
|
1961
|
+
|
1962
|
+
==== Term2
|
1963
|
+
|
1964
|
+
[heading=symbols and abbreviated terms]
|
1965
|
+
=== Symbols and Abbreviated Terms.footnote:[A]
|
1966
|
+
|
1967
|
+
[.nonterm]
|
1968
|
+
==== General
|
1969
|
+
|
1970
|
+
[heading=symbols]
|
1971
|
+
==== Symbols 1.footnote:[A]
|
1972
|
+
|
1973
|
+
[heading=abbreviated terms]
|
1974
|
+
== Abbreviated Terms.footnote:[A]
|
1975
|
+
|
1976
|
+
== Clause 4
|
1977
|
+
|
1978
|
+
=== Introduction
|
1979
|
+
|
1980
|
+
=== Clause 4.2
|
1981
|
+
|
1982
|
+
== Terms and Definitions
|
1983
|
+
|
1984
|
+
[appendix]
|
1985
|
+
== Annex.footnote:[A]
|
1986
|
+
|
1987
|
+
=== Annex A.1
|
1988
|
+
|
1989
|
+
[bibliography,heading=bibliography]
|
1990
|
+
== Bibliography.footnote:[A]
|
1991
|
+
|
1992
|
+
[bibliography,normative=false]
|
1993
|
+
== Bibliography 2.footnote:[A]
|
1994
|
+
|
1995
|
+
=== Bibliography Subsection
|
1996
|
+
|
1997
|
+
INPUT
|
1998
|
+
<standard-document xmlns='https://www.metanorma.org/ns/standoc'>
|
1999
|
+
<bibdata type='standard'>
|
2000
|
+
<title language='en' format='text/plain'>Document title</title>
|
2001
|
+
<language>en</language>
|
2002
|
+
<script>Latn</script>
|
2003
|
+
<abstract>
|
2004
|
+
<p>Text</p>
|
2005
|
+
</abstract>
|
2006
|
+
<status>
|
2007
|
+
<stage>published</stage>
|
2008
|
+
</status>
|
2009
|
+
<copyright>
|
2010
|
+
<from>2020</from>
|
2011
|
+
</copyright>
|
2012
|
+
<ext>
|
2013
|
+
<doctype>article</doctype>
|
2014
|
+
</ext>
|
2015
|
+
</bibdata>
|
2016
|
+
<preface>
|
2017
|
+
<abstract id='_'>
|
2018
|
+
<title>Abstract</title>
|
2019
|
+
<p id='_'>Text</p>
|
2020
|
+
</abstract>
|
2021
|
+
<foreword id='_' obligation='informative'>
|
2022
|
+
<title>
|
2023
|
+
Foreword
|
2024
|
+
<fn reference='1'>
|
2025
|
+
<p id='_'>A</p>
|
2026
|
+
</fn>
|
2027
|
+
</title>
|
2028
|
+
<p id='_'>Text</p>
|
2029
|
+
</foreword>
|
2030
|
+
<introduction id='_' obligation='informative'>
|
2031
|
+
<title>Introduction</title>
|
2032
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
2033
|
+
<title>Introduction Subsection</title>
|
2034
|
+
</clause>
|
2035
|
+
</introduction>
|
2036
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
2037
|
+
<title>Dedication</title>
|
2038
|
+
</clause>
|
2039
|
+
<acknowledgements id='_' obligation='informative'>
|
2040
|
+
<title>
|
2041
|
+
Acknowledgements
|
2042
|
+
<fn reference='1'>
|
2043
|
+
<p id='_'>A</p>
|
2044
|
+
</fn>
|
2045
|
+
</title>
|
2046
|
+
</acknowledgements>
|
2047
|
+
</preface>
|
2048
|
+
<sections>
|
2049
|
+
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
2050
|
+
<title>
|
2051
|
+
Scope
|
2052
|
+
<fn reference='1'>
|
2053
|
+
<p id='_'>A</p>
|
2054
|
+
</fn>
|
2055
|
+
</title>
|
2056
|
+
<p id='_'>Text</p>
|
2057
|
+
</clause>
|
2058
|
+
<terms id='_' obligation='normative'>
|
2059
|
+
<title>
|
2060
|
+
Terms and definitions
|
2061
|
+
<fn reference='1'>
|
2062
|
+
<p id='_'>A</p>
|
2063
|
+
</fn>
|
2064
|
+
</title>
|
2065
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
2066
|
+
<term id='_'>
|
2067
|
+
<preferred>Term1</preferred>
|
2068
|
+
</term>
|
2069
|
+
</terms>
|
2070
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2071
|
+
<title>
|
2072
|
+
Terms, Definitions, Symbols and Abbreviated Terms.
|
2073
|
+
<fn reference='1'>
|
2074
|
+
<p id='_'>A</p>
|
2075
|
+
</fn>
|
2076
|
+
</title>
|
2077
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2078
|
+
<title>Introduction</title>
|
2079
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2080
|
+
<title>Intro 1</title>
|
2081
|
+
</clause>
|
2082
|
+
</clause>
|
2083
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2084
|
+
<title>Intro 2</title>
|
2085
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2086
|
+
<title>Intro 3</title>
|
2087
|
+
</clause>
|
2088
|
+
</clause>
|
2089
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2090
|
+
<title>Intro 4</title>
|
2091
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2092
|
+
<title>Intro 5</title>
|
2093
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2094
|
+
<title>Term1</title>
|
2095
|
+
</clause>
|
2096
|
+
</clause>
|
2097
|
+
</clause>
|
2098
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2099
|
+
<title>Normal Terms</title>
|
2100
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2101
|
+
<title>Term2</title>
|
2102
|
+
</clause>
|
2103
|
+
</clause>
|
2104
|
+
<definitions id='_' obligation='normative'>
|
2105
|
+
<title>
|
2106
|
+
Symbols and abbreviated terms
|
2107
|
+
<fn reference='1'>
|
2108
|
+
<p id='_'>A</p>
|
2109
|
+
</fn>
|
2110
|
+
</title>
|
2111
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2112
|
+
<title>General</title>
|
2113
|
+
</clause>
|
2114
|
+
<definitions id='_' type='symbols' obligation='normative'>
|
2115
|
+
<title>
|
2116
|
+
Symbols
|
2117
|
+
<fn reference='1'>
|
2118
|
+
<p id='_'>A</p>
|
2119
|
+
</fn>
|
2120
|
+
</title>
|
2121
|
+
</definitions>
|
2122
|
+
</definitions>
|
2123
|
+
</clause>
|
2124
|
+
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
2125
|
+
<title>
|
2126
|
+
Abbreviated terms
|
2127
|
+
<fn reference='1'>
|
2128
|
+
<p id='_'>A</p>
|
2129
|
+
</fn>
|
2130
|
+
</title>
|
2131
|
+
</definitions>
|
2132
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2133
|
+
<title>Clause 4</title>
|
2134
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2135
|
+
<title>Introduction</title>
|
2136
|
+
</clause>
|
2137
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2138
|
+
<title>Clause 4.2</title>
|
2139
|
+
</clause>
|
2140
|
+
</clause>
|
2141
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2142
|
+
<title>Terms and Definitions</title>
|
2143
|
+
</clause>
|
2144
|
+
</sections>
|
2145
|
+
<annex id='_' inline-header='false' obligation='normative'>
|
2146
|
+
<title>
|
2147
|
+
Annex.
|
2148
|
+
<fn reference='1'>
|
2149
|
+
<p id='_'>A</p>
|
2150
|
+
</fn>
|
2151
|
+
</title>
|
2152
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2153
|
+
<title>Annex A.1</title>
|
2154
|
+
</clause>
|
2155
|
+
</annex>
|
2156
|
+
<bibliography>
|
2157
|
+
<references id='_' normative='true' obligation='informative'>
|
2158
|
+
<title>Normative references</title>
|
2159
|
+
<p id='_'>There are no normative references in this document.</p>
|
2160
|
+
</references>
|
2161
|
+
<references id='_' normative='false' obligation='informative'>
|
2162
|
+
<title>Bibliography</title>
|
2163
|
+
</references>
|
2164
|
+
<references id='_' normative='false' obligation='informative'>
|
2165
|
+
<title>Bibliography</title>
|
2166
|
+
</references>
|
2167
|
+
<clause id='_' obligation='informative'>
|
2168
|
+
<title>Bibliography</title>
|
2169
|
+
<references id='_' normative='false' obligation='informative'>
|
2170
|
+
<title>Bibliography Subsection</title>
|
2171
|
+
</references>
|
2172
|
+
</clause>
|
2173
|
+
</bibliography>
|
2174
|
+
</standard-document>
|
2175
|
+
OUTPUT
|
2176
|
+
end
|
2177
|
+
|
2178
|
+
it "processes section names, default to English" do
|
2179
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2180
|
+
#{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":language: tlh\n:script: Latn\n:nodoc:")}
|
2181
|
+
.Foreword
|
2182
|
+
|
2183
|
+
Text
|
2184
|
+
|
2185
|
+
[abstract]
|
2186
|
+
== Abstract
|
2187
|
+
|
2188
|
+
Text
|
2189
|
+
|
2190
|
+
[heading=introduction]
|
2191
|
+
== Introduction
|
2192
|
+
|
2193
|
+
=== Introduction Subsection
|
2194
|
+
|
2195
|
+
[heading=acknowledgements]
|
2196
|
+
== Acknowledgements
|
2197
|
+
|
2198
|
+
[.preface]
|
2199
|
+
== Dedication
|
2200
|
+
|
2201
|
+
[heading=scope]
|
2202
|
+
== Scope
|
2203
|
+
|
2204
|
+
Text
|
2205
|
+
|
2206
|
+
[bibliography,heading=normative references]
|
2207
|
+
== Normative References
|
2208
|
+
|
2209
|
+
[bibliography,normative=true]
|
2210
|
+
== Normative References 2
|
2211
|
+
|
2212
|
+
[heading=terms and definitions]
|
2213
|
+
== Terms and Definitions
|
2214
|
+
|
2215
|
+
=== Term1
|
2216
|
+
|
2217
|
+
[heading="terms and definitions"]
|
2218
|
+
== Terms, Definitions, Symbols and Abbreviated Terms
|
2219
|
+
|
2220
|
+
[.nonterm]
|
2221
|
+
=== Introduction
|
2222
|
+
|
2223
|
+
==== Intro 1
|
2224
|
+
|
2225
|
+
=== Intro 2
|
2226
|
+
|
2227
|
+
[.nonterm]
|
2228
|
+
==== Intro 3
|
2229
|
+
|
2230
|
+
=== Intro 4
|
2231
|
+
|
2232
|
+
==== Intro 5
|
2233
|
+
|
2234
|
+
===== Term1
|
2235
|
+
|
2236
|
+
=== Normal Terms
|
2237
|
+
|
2238
|
+
==== Term2
|
2239
|
+
|
2240
|
+
[heading=symbols and abbreviated terms]
|
2241
|
+
=== Symbols and Abbreviated Terms
|
2242
|
+
|
2243
|
+
[.nonterm]
|
2244
|
+
==== General
|
2245
|
+
|
2246
|
+
[heading=symbols]
|
2247
|
+
==== Symbols 1
|
2248
|
+
|
2249
|
+
[heading=abbreviated terms]
|
2250
|
+
== Abbreviated Terms
|
2251
|
+
|
2252
|
+
== Clause 4
|
2253
|
+
|
2254
|
+
=== Introduction
|
2255
|
+
|
2256
|
+
=== Clause 4.2
|
2257
|
+
|
2258
|
+
== Terms and Definitions
|
2259
|
+
|
2260
|
+
[appendix]
|
2261
|
+
== Annex
|
2262
|
+
|
2263
|
+
=== Annex A.1
|
2264
|
+
|
2265
|
+
[bibliography,heading=bibliography]
|
2266
|
+
== Bibliography
|
2267
|
+
|
2268
|
+
[bibliography,normative=false]
|
2269
|
+
== Bibliography 2
|
2270
|
+
|
2271
|
+
=== Bibliography Subsection
|
2272
|
+
|
2273
|
+
INPUT
|
2274
|
+
<standard-document xmlns='https://www.metanorma.org/ns/standoc'>
|
2275
|
+
<bibdata type='standard'>
|
2276
|
+
<title language='en' format='text/plain'>Document title</title>
|
2277
|
+
<language>tlh</language>
|
2278
|
+
<script>Latn</script>
|
2279
|
+
<abstract>
|
2280
|
+
<p>Text</p>
|
2281
|
+
</abstract>
|
2282
|
+
<status>
|
2283
|
+
<stage>published</stage>
|
2284
|
+
</status>
|
2285
|
+
<copyright>
|
2286
|
+
<from>2020</from>
|
2287
|
+
</copyright>
|
2288
|
+
<ext>
|
2289
|
+
<doctype>article</doctype>
|
2290
|
+
</ext>
|
2291
|
+
</bibdata>
|
2292
|
+
<preface>
|
2293
|
+
<abstract id='_'>
|
2294
|
+
<title>Abstract</title>
|
2295
|
+
<p id='_'>Text</p>
|
2296
|
+
</abstract>
|
2297
|
+
<foreword id='_' obligation='informative'>
|
2298
|
+
<title>Foreword</title>
|
2299
|
+
<p id='_'>Text</p>
|
2300
|
+
</foreword>
|
2301
|
+
<introduction id='_' obligation='informative'>
|
2302
|
+
<title>Introduction</title>
|
2303
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
2304
|
+
<title>Introduction Subsection</title>
|
2305
|
+
</clause>
|
2306
|
+
</introduction>
|
2307
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
2308
|
+
<title>Dedication</title>
|
2309
|
+
</clause>
|
2310
|
+
<acknowledgements id='_' obligation='informative'>
|
2311
|
+
<title>Acknowledgements</title>
|
2312
|
+
</acknowledgements>
|
2313
|
+
</preface>
|
2314
|
+
<sections>
|
2315
|
+
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
2316
|
+
<title>Scope</title>
|
2317
|
+
<p id='_'>Text</p>
|
2318
|
+
</clause>
|
2319
|
+
<terms id='_' obligation='normative'>
|
2320
|
+
<title>Terms and definitions</title>
|
2321
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
2322
|
+
<term id='_'>
|
2323
|
+
<preferred>Term1</preferred>
|
2324
|
+
</term>
|
2325
|
+
</terms>
|
2326
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2327
|
+
<title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
2328
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2329
|
+
<title>Introduction</title>
|
2330
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2331
|
+
<title>Intro 1</title>
|
2332
|
+
</clause>
|
2333
|
+
</clause>
|
2334
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2335
|
+
<title>Intro 2</title>
|
2336
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2337
|
+
<title>Intro 3</title>
|
2338
|
+
</clause>
|
2339
|
+
</clause>
|
2340
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2341
|
+
<title>Intro 4</title>
|
2342
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2343
|
+
<title>Intro 5</title>
|
2344
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2345
|
+
<title>Term1</title>
|
2346
|
+
</clause>
|
2347
|
+
</clause>
|
2348
|
+
</clause>
|
2349
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2350
|
+
<title>Normal Terms</title>
|
2351
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2352
|
+
<title>Term2</title>
|
2353
|
+
</clause>
|
2354
|
+
</clause>
|
2355
|
+
<definitions id='_' obligation='normative'>
|
2356
|
+
<title>Symbols and abbreviated terms</title>
|
2357
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2358
|
+
<title>General</title>
|
2359
|
+
</clause>
|
2360
|
+
<definitions id='_' type='symbols' obligation='normative'>
|
2361
|
+
<title>Symbols</title>
|
2362
|
+
</definitions>
|
2363
|
+
</definitions>
|
2364
|
+
</clause>
|
2365
|
+
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
2366
|
+
<title>Abbreviated terms</title>
|
2367
|
+
</definitions>
|
2368
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2369
|
+
<title>Clause 4</title>
|
2370
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2371
|
+
<title>Introduction</title>
|
2372
|
+
</clause>
|
2373
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2374
|
+
<title>Clause 4.2</title>
|
2375
|
+
</clause>
|
2376
|
+
</clause>
|
2377
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2378
|
+
<title>Terms and Definitions</title>
|
2379
|
+
</clause>
|
2380
|
+
</sections>
|
2381
|
+
<annex id='_' inline-header='false' obligation='normative'>
|
2382
|
+
<title>Annex</title>
|
2383
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2384
|
+
<title>Annex A.1</title>
|
2385
|
+
</clause>
|
2386
|
+
</annex>
|
2387
|
+
<bibliography>
|
2388
|
+
<references id='_' normative='true' obligation='informative'>
|
2389
|
+
<title>Normative references</title>
|
2390
|
+
<p id='_'>There are no normative references in this document.</p>
|
2391
|
+
</references>
|
2392
|
+
<references id='_' normative='false' obligation='informative'>
|
2393
|
+
<title>Bibliography</title>
|
2394
|
+
</references>
|
2395
|
+
<references id='_' normative='false' obligation='informative'>
|
2396
|
+
<title>Bibliography</title>
|
2397
|
+
</references>
|
2398
|
+
<clause id='_' obligation='informative'>
|
2399
|
+
<title>Bibliography</title>
|
2400
|
+
<references id='_' normative='false' obligation='informative'>
|
2401
|
+
<title>Bibliography Subsection</title>
|
2402
|
+
</references>
|
2403
|
+
</clause>
|
2404
|
+
</bibliography>
|
2405
|
+
</standard-document>
|
2406
|
+
OUTPUT
|
2407
|
+
end
|
2408
|
+
|
2409
|
+
it "processes section names, French" do
|
2410
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2411
|
+
#{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":language: fr\n:script: Latn\n:nodoc:")}
|
2412
|
+
.Foreword
|
2413
|
+
|
2414
|
+
Text
|
2415
|
+
|
2416
|
+
[abstract]
|
2417
|
+
== Abstract
|
2418
|
+
|
2419
|
+
Text
|
2420
|
+
|
2421
|
+
[heading=introduction]
|
2422
|
+
== Introduction
|
2423
|
+
|
2424
|
+
=== Introduction Subsection
|
2425
|
+
|
2426
|
+
[heading=acknowledgements]
|
2427
|
+
== Acknowledgements
|
2428
|
+
|
2429
|
+
[.preface]
|
2430
|
+
== Dedication
|
2431
|
+
|
2432
|
+
[heading=scope]
|
2433
|
+
== Scope
|
2434
|
+
|
2435
|
+
Text
|
2436
|
+
|
2437
|
+
[bibliography,heading=normative references]
|
2438
|
+
== Normative References
|
2439
|
+
|
2440
|
+
[bibliography,normative=true]
|
2441
|
+
== Normative References 2
|
2442
|
+
|
2443
|
+
[heading=terms and definitions]
|
2444
|
+
== Terms and Definitions
|
2445
|
+
|
2446
|
+
=== Term1
|
2447
|
+
|
2448
|
+
[heading="terms and definitions"]
|
2449
|
+
== Terms, Definitions, Symbols and Abbreviated Terms
|
2450
|
+
|
2451
|
+
[.nonterm]
|
2452
|
+
=== Introduction
|
2453
|
+
|
2454
|
+
==== Intro 1
|
2455
|
+
|
2456
|
+
=== Intro 2
|
2457
|
+
|
2458
|
+
[.nonterm]
|
2459
|
+
==== Intro 3
|
2460
|
+
|
2461
|
+
=== Intro 4
|
2462
|
+
|
2463
|
+
==== Intro 5
|
2464
|
+
|
2465
|
+
===== Term1
|
2466
|
+
|
2467
|
+
=== Normal Terms
|
2468
|
+
|
2469
|
+
==== Term2
|
2470
|
+
|
2471
|
+
[heading=symbols and abbreviated terms]
|
2472
|
+
=== Symbols and Abbreviated Terms
|
2473
|
+
|
2474
|
+
[.nonterm]
|
2475
|
+
==== General
|
2476
|
+
|
2477
|
+
[heading=symbols]
|
2478
|
+
==== Symbols 1
|
2479
|
+
|
2480
|
+
[heading=abbreviated terms]
|
2481
|
+
== Abbreviated Terms
|
2482
|
+
|
2483
|
+
== Clause 4
|
2484
|
+
|
2485
|
+
=== Introduction
|
2486
|
+
|
2487
|
+
=== Clause 4.2
|
2488
|
+
|
2489
|
+
== Terms and Definitions
|
2490
|
+
|
2491
|
+
[appendix]
|
2492
|
+
== Annex
|
2493
|
+
|
2494
|
+
=== Annex A.1
|
2495
|
+
|
2496
|
+
[bibliography,heading=bibliography]
|
2497
|
+
== Bibliography
|
2498
|
+
|
2499
|
+
[bibliography,normative=false]
|
2500
|
+
== Bibliography 2
|
2501
|
+
|
2502
|
+
=== Bibliography Subsection
|
2503
|
+
|
2504
|
+
INPUT
|
2505
|
+
<standard-document xmlns='https://www.metanorma.org/ns/standoc'>
|
2506
|
+
<bibdata type='standard'>
|
2507
|
+
<title language='en' format='text/plain'>Document title</title>
|
2508
|
+
<language>fr</language>
|
2509
|
+
<script>Latn</script>
|
2510
|
+
<abstract>
|
2511
|
+
<p>Text</p>
|
2512
|
+
</abstract>
|
2513
|
+
<status>
|
2514
|
+
<stage>published</stage>
|
2515
|
+
</status>
|
2516
|
+
<copyright>
|
2517
|
+
<from>2020</from>
|
2518
|
+
</copyright>
|
2519
|
+
<ext>
|
2520
|
+
<doctype>article</doctype>
|
2521
|
+
</ext>
|
2522
|
+
</bibdata>
|
2523
|
+
<preface>
|
2524
|
+
<abstract id='_'>
|
2525
|
+
<title>Résumé</title>
|
2526
|
+
<p id='_'>Text</p>
|
2527
|
+
</abstract>
|
2528
|
+
<foreword id='_' obligation='informative'>
|
2529
|
+
<title>Avant-propos</title>
|
2530
|
+
<p id='_'>Text</p>
|
2531
|
+
</foreword>
|
2532
|
+
<introduction id='_' obligation='informative'>
|
2533
|
+
<title>Introduction</title>
|
2534
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
2535
|
+
<title>Introduction Subsection</title>
|
2536
|
+
</clause>
|
2537
|
+
</introduction>
|
2538
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
2539
|
+
<title>Dedication</title>
|
2540
|
+
</clause>
|
2541
|
+
<acknowledgements id='_' obligation='informative'>
|
2542
|
+
<title>Remerciements</title>
|
2543
|
+
</acknowledgements>
|
2544
|
+
</preface>
|
2545
|
+
<sections>
|
2546
|
+
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
2547
|
+
<title>Domaine d’application</title>
|
2548
|
+
<p id='_'>Text</p>
|
2549
|
+
</clause>
|
2550
|
+
<terms id='_' obligation='normative'>
|
2551
|
+
<title>Terms et définitions</title>
|
2552
|
+
<p id='_'>
|
2553
|
+
Pour les besoins du présent document, les termes et définitions suivants
|
2554
|
+
s’appliquent.
|
2555
|
+
</p>
|
2556
|
+
<term id='_'>
|
2557
|
+
<preferred>Term1</preferred>
|
2558
|
+
</term>
|
2559
|
+
</terms>
|
2560
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2561
|
+
<title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
2562
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2563
|
+
<title>Introduction</title>
|
2564
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2565
|
+
<title>Intro 1</title>
|
2566
|
+
</clause>
|
2567
|
+
</clause>
|
2568
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2569
|
+
<title>Intro 2</title>
|
2570
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2571
|
+
<title>Intro 3</title>
|
2572
|
+
</clause>
|
2573
|
+
</clause>
|
2574
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2575
|
+
<title>Intro 4</title>
|
2576
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2577
|
+
<title>Intro 5</title>
|
2578
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2579
|
+
<title>Term1</title>
|
2580
|
+
</clause>
|
2581
|
+
</clause>
|
2582
|
+
</clause>
|
2583
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2584
|
+
<title>Normal Terms</title>
|
2585
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2586
|
+
<title>Term2</title>
|
2587
|
+
</clause>
|
2588
|
+
</clause>
|
2589
|
+
<definitions id='_' obligation='normative'>
|
2590
|
+
<title>Symbols and abbreviated terms</title>
|
2591
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2592
|
+
<title>General</title>
|
2593
|
+
</clause>
|
2594
|
+
<definitions id='_' type='symbols' obligation='normative'>
|
2595
|
+
<title>Symboles</title>
|
2596
|
+
</definitions>
|
2597
|
+
</definitions>
|
2598
|
+
</clause>
|
2599
|
+
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
2600
|
+
<title>Termes abrégés</title>
|
2601
|
+
</definitions>
|
2602
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2603
|
+
<title>Clause 4</title>
|
2604
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2605
|
+
<title>Introduction</title>
|
2606
|
+
</clause>
|
2607
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2608
|
+
<title>Clause 4.2</title>
|
2609
|
+
</clause>
|
2610
|
+
</clause>
|
2611
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2612
|
+
<title>Terms and Definitions</title>
|
2613
|
+
</clause>
|
2614
|
+
</sections>
|
2615
|
+
<annex id='_' inline-header='false' obligation='normative'>
|
2616
|
+
<title>Annex</title>
|
2617
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2618
|
+
<title>Annex A.1</title>
|
2619
|
+
</clause>
|
2620
|
+
</annex>
|
2621
|
+
<bibliography>
|
2622
|
+
<references id='_' normative='true' obligation='informative'>
|
2623
|
+
<title>Références normatives</title>
|
2624
|
+
<p id='_'>Le présent document ne contient aucune référence normative.</p>
|
2625
|
+
</references>
|
2626
|
+
<references id='_' normative='false' obligation='informative'>
|
2627
|
+
<title>Bibliographie</title>
|
2628
|
+
</references>
|
2629
|
+
<references id='_' normative='false' obligation='informative'>
|
2630
|
+
<title>Bibliography</title>
|
2631
|
+
</references>
|
2632
|
+
<clause id='_' obligation='informative'>
|
2633
|
+
<title>Bibliography</title>
|
2634
|
+
<references id='_' normative='false' obligation='informative'>
|
2635
|
+
<title>Bibliography Subsection</title>
|
2636
|
+
</references>
|
2637
|
+
</clause>
|
2638
|
+
</bibliography>
|
2639
|
+
</standard-document>
|
2640
|
+
OUTPUT
|
2641
|
+
end
|
2642
|
+
|
2643
|
+
it "processes section names, Simplified Chinese" do
|
2644
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2645
|
+
#{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":language: zh\n:script: Hans\n:nodoc:")}
|
2646
|
+
.Foreword
|
2647
|
+
|
2648
|
+
Text
|
2649
|
+
|
2650
|
+
[abstract]
|
2651
|
+
== Abstract
|
2652
|
+
|
2653
|
+
Text
|
2654
|
+
|
2655
|
+
[heading=introduction]
|
2656
|
+
== Introduction
|
2657
|
+
|
2658
|
+
=== Introduction Subsection
|
2659
|
+
|
2660
|
+
[heading=acknowledgements]
|
2661
|
+
== Acknowledgements
|
2662
|
+
|
2663
|
+
[.preface]
|
2664
|
+
== Dedication
|
2665
|
+
|
2666
|
+
[heading=scope]
|
2667
|
+
== Scope
|
2668
|
+
|
2669
|
+
Text
|
2670
|
+
|
2671
|
+
[bibliography,heading=normative references]
|
2672
|
+
== Normative References
|
2673
|
+
|
2674
|
+
[bibliography,normative=true]
|
2675
|
+
== Normative References 2
|
2676
|
+
|
2677
|
+
[heading=terms and definitions]
|
2678
|
+
== Terms and Definitions
|
2679
|
+
|
2680
|
+
=== Term1
|
2681
|
+
|
2682
|
+
[heading="terms and definitions"]
|
2683
|
+
== Terms, Definitions, Symbols and Abbreviated Terms
|
2684
|
+
|
2685
|
+
[.nonterm]
|
2686
|
+
=== Introduction
|
2687
|
+
|
2688
|
+
==== Intro 1
|
2689
|
+
|
2690
|
+
=== Intro 2
|
2691
|
+
|
2692
|
+
[.nonterm]
|
2693
|
+
==== Intro 3
|
2694
|
+
|
2695
|
+
=== Intro 4
|
2696
|
+
|
2697
|
+
==== Intro 5
|
2698
|
+
|
2699
|
+
===== Term1
|
2700
|
+
|
2701
|
+
=== Normal Terms
|
2702
|
+
|
2703
|
+
==== Term2
|
2704
|
+
|
2705
|
+
[heading=symbols and abbreviated terms]
|
2706
|
+
=== Symbols and Abbreviated Terms
|
2707
|
+
|
2708
|
+
[.nonterm]
|
2709
|
+
==== General
|
2710
|
+
|
2711
|
+
[heading=symbols]
|
2712
|
+
==== Symbols 1
|
2713
|
+
|
2714
|
+
[heading=abbreviated terms]
|
2715
|
+
== Abbreviated Terms
|
2716
|
+
|
2717
|
+
== Clause 4
|
2718
|
+
|
2719
|
+
=== Introduction
|
2720
|
+
|
2721
|
+
=== Clause 4.2
|
2722
|
+
|
2723
|
+
== Terms and Definitions
|
2724
|
+
|
2725
|
+
[appendix]
|
2726
|
+
== Annex
|
2727
|
+
|
2728
|
+
=== Annex A.1
|
2729
|
+
|
2730
|
+
[bibliography,heading=bibliography]
|
2731
|
+
== Bibliography
|
2732
|
+
|
2733
|
+
[bibliography,normative=false]
|
2734
|
+
== Bibliography 2
|
2735
|
+
|
2736
|
+
=== Bibliography Subsection
|
2737
|
+
|
2738
|
+
INPUT
|
2739
|
+
<standard-document xmlns='https://www.metanorma.org/ns/standoc'>
|
2740
|
+
<bibdata type='standard'>
|
2741
|
+
<title language='en' format='text/plain'>Document title</title>
|
2742
|
+
<language>zh</language>
|
2743
|
+
<script>Hans</script>
|
2744
|
+
<abstract>
|
2745
|
+
<p>Text</p>
|
2746
|
+
</abstract>
|
2747
|
+
<status>
|
2748
|
+
<stage>published</stage>
|
2749
|
+
</status>
|
2750
|
+
<copyright>
|
2751
|
+
<from>2020</from>
|
2752
|
+
</copyright>
|
2753
|
+
<ext>
|
2754
|
+
<doctype>article</doctype>
|
2755
|
+
</ext>
|
2756
|
+
</bibdata>
|
2757
|
+
<preface>
|
2758
|
+
<abstract id='_'>
|
2759
|
+
<title>摘要</title>
|
2760
|
+
<p id='_'>Text</p>
|
2761
|
+
</abstract>
|
2762
|
+
<foreword id='_' obligation='informative'>
|
2763
|
+
<title>前言</title>
|
2764
|
+
<p id='_'>Text</p>
|
2765
|
+
</foreword>
|
2766
|
+
<introduction id='_' obligation='informative'>
|
2767
|
+
<title>引言</title>
|
2768
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
2769
|
+
<title>Introduction Subsection</title>
|
2770
|
+
</clause>
|
2771
|
+
</introduction>
|
2772
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
2773
|
+
<title>Dedication</title>
|
2774
|
+
</clause>
|
2775
|
+
<acknowledgements id='_' obligation='informative'>
|
2776
|
+
<title>致謝</title>
|
2777
|
+
</acknowledgements>
|
2778
|
+
</preface>
|
2779
|
+
<sections>
|
2780
|
+
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
2781
|
+
<title>范围</title>
|
2782
|
+
<p id='_'>Text</p>
|
2783
|
+
</clause>
|
2784
|
+
<terms id='_' obligation='normative'>
|
2785
|
+
<title>术语和定义</title>
|
2786
|
+
<p id='_'>下列术语和定义适用于本文件。</p>
|
2787
|
+
<term id='_'>
|
2788
|
+
<preferred>Term1</preferred>
|
2789
|
+
</term>
|
2790
|
+
</terms>
|
2791
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2792
|
+
<title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
2793
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2794
|
+
<title>Introduction</title>
|
2795
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2796
|
+
<title>Intro 1</title>
|
2797
|
+
</clause>
|
2798
|
+
</clause>
|
2799
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2800
|
+
<title>Intro 2</title>
|
2801
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2802
|
+
<title>Intro 3</title>
|
2803
|
+
</clause>
|
2804
|
+
</clause>
|
2805
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2806
|
+
<title>Intro 4</title>
|
2807
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2808
|
+
<title>Intro 5</title>
|
2809
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2810
|
+
<title>Term1</title>
|
2811
|
+
</clause>
|
2812
|
+
</clause>
|
2813
|
+
</clause>
|
2814
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2815
|
+
<title>Normal Terms</title>
|
2816
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2817
|
+
<title>Term2</title>
|
2818
|
+
</clause>
|
2819
|
+
</clause>
|
2820
|
+
<definitions id='_' obligation='normative'>
|
2821
|
+
<title>符号、代号和缩略语</title>
|
2822
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2823
|
+
<title>General</title>
|
2824
|
+
</clause>
|
2825
|
+
<definitions id='_' type='symbols' obligation='normative'>
|
2826
|
+
<title>符号</title>
|
2827
|
+
</definitions>
|
2828
|
+
</definitions>
|
2829
|
+
</clause>
|
2830
|
+
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
2831
|
+
<title>代号和缩略语</title>
|
2832
|
+
</definitions>
|
2833
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2834
|
+
<title>Clause 4</title>
|
2835
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2836
|
+
<title>Introduction</title>
|
2837
|
+
</clause>
|
2838
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2839
|
+
<title>Clause 4.2</title>
|
2840
|
+
</clause>
|
2841
|
+
</clause>
|
2842
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2843
|
+
<title>Terms and Definitions</title>
|
2844
|
+
</clause>
|
2845
|
+
</sections>
|
2846
|
+
<annex id='_' inline-header='false' obligation='normative'>
|
2847
|
+
<title>Annex</title>
|
2848
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
2849
|
+
<title>Annex A.1</title>
|
2850
|
+
</clause>
|
2851
|
+
</annex>
|
2852
|
+
<bibliography>
|
2853
|
+
<references id='_' normative='true' obligation='informative'>
|
2854
|
+
<title>规范性引用文件</title>
|
2855
|
+
<p id='_'>本文件并没有规范性引用文件。</p>
|
2856
|
+
</references>
|
2857
|
+
<references id='_' normative='false' obligation='informative'>
|
2858
|
+
<title>参考文献</title>
|
2859
|
+
</references>
|
2860
|
+
<references id='_' normative='false' obligation='informative'>
|
2861
|
+
<title>Bibliography</title>
|
2862
|
+
</references>
|
2863
|
+
<clause id='_' obligation='informative'>
|
2864
|
+
<title>Bibliography</title>
|
2865
|
+
<references id='_' normative='false' obligation='informative'>
|
2866
|
+
<title>Bibliography Subsection</title>
|
2867
|
+
</references>
|
2868
|
+
</clause>
|
2869
|
+
</bibliography>
|
2870
|
+
</standard-document>
|
2871
|
+
OUTPUT
|
2872
|
+
end
|
2873
|
+
|
2874
|
+
it "processes section names, internationalisation file" do
|
2875
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2876
|
+
#{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":i18nyaml: spec/assets/i18n.yaml")}
|
2877
|
+
.Foreword
|
2878
|
+
|
2879
|
+
Text
|
2880
|
+
|
2881
|
+
[abstract]
|
2882
|
+
== Abstract
|
2883
|
+
|
2884
|
+
Text
|
2885
|
+
|
2886
|
+
[heading=introduction]
|
2887
|
+
== Introduction
|
2888
|
+
|
2889
|
+
=== Introduction Subsection
|
2890
|
+
|
2891
|
+
[heading=acknowledgements]
|
2892
|
+
== Acknowledgements
|
2893
|
+
|
2894
|
+
[.preface]
|
2895
|
+
== Dedication
|
2896
|
+
|
2897
|
+
[heading=scope]
|
2898
|
+
== Scope
|
2899
|
+
|
2900
|
+
Text
|
2901
|
+
|
2902
|
+
[bibliography,heading=normative references]
|
2903
|
+
== Normative References
|
2904
|
+
|
2905
|
+
[bibliography,normative=true]
|
2906
|
+
== Normative References 2
|
2907
|
+
|
2908
|
+
[heading=terms and definitions]
|
2909
|
+
== Terms and Definitions
|
2910
|
+
|
2911
|
+
=== Term1
|
2912
|
+
|
2913
|
+
[heading="terms and definitions"]
|
2914
|
+
== Terms, Definitions, Symbols and Abbreviated Terms
|
2915
|
+
|
2916
|
+
[.nonterm]
|
2917
|
+
=== Introduction
|
2918
|
+
|
2919
|
+
==== Intro 1
|
2920
|
+
|
2921
|
+
=== Intro 2
|
2922
|
+
|
2923
|
+
[.nonterm]
|
2924
|
+
==== Intro 3
|
2925
|
+
|
2926
|
+
=== Intro 4
|
2927
|
+
|
2928
|
+
==== Intro 5
|
2929
|
+
|
2930
|
+
===== Term1
|
2931
|
+
|
2932
|
+
=== Normal Terms
|
2933
|
+
|
2934
|
+
==== Term2
|
2935
|
+
|
2936
|
+
[heading=symbols and abbreviated terms]
|
2937
|
+
=== Symbols and Abbreviated Terms
|
2938
|
+
|
2939
|
+
[.nonterm]
|
2940
|
+
==== General
|
2941
|
+
|
2942
|
+
[heading=symbols]
|
2943
|
+
==== Symbols 1
|
2944
|
+
|
2945
|
+
[heading=abbreviated terms]
|
2946
|
+
== Abbreviated Terms
|
2947
|
+
|
2948
|
+
== Clause 4
|
2949
|
+
|
2950
|
+
=== Introduction
|
2951
|
+
|
2952
|
+
=== Clause 4.2
|
2953
|
+
|
2954
|
+
== Terms and Definitions
|
2955
|
+
|
2956
|
+
[appendix]
|
2957
|
+
== Annex
|
2958
|
+
|
2959
|
+
=== Annex A.1
|
2960
|
+
|
2961
|
+
[bibliography,heading=bibliography]
|
2962
|
+
== Bibliography
|
2963
|
+
|
2964
|
+
[bibliography,normative=false]
|
2965
|
+
== Bibliography 2
|
2966
|
+
|
2967
|
+
=== Bibliography Subsection
|
2968
|
+
|
2969
|
+
INPUT
|
2970
|
+
<standard-document xmlns='https://www.metanorma.org/ns/standoc'>
|
2971
|
+
<bibdata type='standard'>
|
2972
|
+
<title language='en' format='text/plain'>Document title</title>
|
2973
|
+
<language>en</language>
|
2974
|
+
<script>Latn</script>
|
2975
|
+
<abstract>
|
2976
|
+
<p>Text</p>
|
2977
|
+
</abstract>
|
2978
|
+
<status>
|
2979
|
+
<stage>published</stage>
|
2980
|
+
</status>
|
2981
|
+
<copyright>
|
2982
|
+
<from>2020</from>
|
2983
|
+
</copyright>
|
2984
|
+
<ext>
|
2985
|
+
<doctype>article</doctype>
|
2986
|
+
</ext>
|
2987
|
+
</bibdata>
|
2988
|
+
<preface>
|
2989
|
+
<abstract id='_'>
|
2990
|
+
<title>Abstract</title>
|
2991
|
+
<p id='_'>Text</p>
|
2992
|
+
</abstract>
|
2993
|
+
<foreword id='_' obligation='informative'>
|
2994
|
+
<title>Antaŭparolo</title>
|
2995
|
+
<p id='_'>Text</p>
|
2996
|
+
</foreword>
|
2997
|
+
<introduction id='_' obligation='informative'>
|
2998
|
+
<title>Enkonduko</title>
|
2999
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
3000
|
+
<title>Introduction Subsection</title>
|
3001
|
+
</clause>
|
3002
|
+
</introduction>
|
3003
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
3004
|
+
<title>Dedication</title>
|
3005
|
+
</clause>
|
3006
|
+
<acknowledgements id='_' obligation='informative'>
|
3007
|
+
<title>Acknowledgements</title>
|
3008
|
+
</acknowledgements>
|
3009
|
+
</preface>
|
3010
|
+
<sections>
|
3011
|
+
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
3012
|
+
<title>Amplekso</title>
|
3013
|
+
<p id='_'>Text</p>
|
3014
|
+
</clause>
|
3015
|
+
<terms id='_' obligation='normative'>
|
3016
|
+
<title>Terms and definitions</title>
|
3017
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
3018
|
+
<term id='_'>
|
3019
|
+
<preferred>Term1</preferred>
|
3020
|
+
</term>
|
3021
|
+
</terms>
|
3022
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3023
|
+
<title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
3024
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3025
|
+
<title>Introduction</title>
|
3026
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3027
|
+
<title>Intro 1</title>
|
3028
|
+
</clause>
|
3029
|
+
</clause>
|
3030
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3031
|
+
<title>Intro 2</title>
|
3032
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3033
|
+
<title>Intro 3</title>
|
3034
|
+
</clause>
|
3035
|
+
</clause>
|
3036
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3037
|
+
<title>Intro 4</title>
|
3038
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3039
|
+
<title>Intro 5</title>
|
3040
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3041
|
+
<title>Term1</title>
|
3042
|
+
</clause>
|
3043
|
+
</clause>
|
3044
|
+
</clause>
|
3045
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3046
|
+
<title>Normal Terms</title>
|
3047
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3048
|
+
<title>Term2</title>
|
3049
|
+
</clause>
|
3050
|
+
</clause>
|
3051
|
+
<definitions id='_' obligation='normative'>
|
3052
|
+
<title>Symbols and abbreviated terms</title>
|
3053
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3054
|
+
<title>General</title>
|
3055
|
+
</clause>
|
3056
|
+
<definitions id='_' type='symbols' obligation='normative'>
|
3057
|
+
<title>Simboloj kai mallongigitaj terminoj</title>
|
3058
|
+
</definitions>
|
3059
|
+
</definitions>
|
3060
|
+
</clause>
|
3061
|
+
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
3062
|
+
<title>Abbreviated terms</title>
|
3063
|
+
</definitions>
|
3064
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3065
|
+
<title>Clause 4</title>
|
3066
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3067
|
+
<title>Introduction</title>
|
3068
|
+
</clause>
|
3069
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3070
|
+
<title>Clause 4.2</title>
|
3071
|
+
</clause>
|
3072
|
+
</clause>
|
3073
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3074
|
+
<title>Terms and Definitions</title>
|
3075
|
+
</clause>
|
3076
|
+
</sections>
|
3077
|
+
<annex id='_' inline-header='false' obligation='normative'>
|
3078
|
+
<title>Annex</title>
|
3079
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
3080
|
+
<title>Annex A.1</title>
|
3081
|
+
</clause>
|
3082
|
+
</annex>
|
3083
|
+
<bibliography>
|
3084
|
+
<references id='_' normative='true' obligation='informative'>
|
3085
|
+
<title>Normaj citaĵoj</title>
|
3086
|
+
<p id='_'>There are no normative references in this document.</p>
|
3087
|
+
</references>
|
3088
|
+
<references id='_' normative='false' obligation='informative'>
|
3089
|
+
<title>Bibliografio</title>
|
3090
|
+
</references>
|
3091
|
+
<references id='_' normative='false' obligation='informative'>
|
3092
|
+
<title>Bibliography</title>
|
3093
|
+
</references>
|
3094
|
+
<clause id='_' obligation='informative'>
|
3095
|
+
<title>Bibliography</title>
|
3096
|
+
<references id='_' normative='false' obligation='informative'>
|
3097
|
+
<title>Bibliography Subsection</title>
|
3098
|
+
</references>
|
3099
|
+
</clause>
|
3100
|
+
</bibliography>
|
3101
|
+
</standard-document>
|
3102
|
+
OUTPUT
|
3103
|
+
end
|
3104
|
+
|
3105
|
+
|
1902
3106
|
private
|
1903
3107
|
|
1904
3108
|
def mock_iecbib_get_iec60050_103_01
|