metanorma-standoc 1.6.0 → 1.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +66 -0
- data/README.adoc +1 -3
- data/lib/asciidoctor/standoc/base.rb +8 -16
- data/lib/asciidoctor/standoc/basicdoc.rng +32 -0
- data/lib/asciidoctor/standoc/cleanup.rb +52 -4
- data/lib/asciidoctor/standoc/cleanup_block.rb +41 -4
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +14 -0
- data/lib/asciidoctor/standoc/cleanup_footnotes.rb +25 -0
- data/lib/asciidoctor/standoc/cleanup_inline.rb +6 -2
- data/lib/asciidoctor/standoc/cleanup_ref.rb +18 -25
- data/lib/asciidoctor/standoc/cleanup_terms.rb +3 -0
- data/lib/asciidoctor/standoc/converter.rb +61 -3
- data/lib/asciidoctor/standoc/front.rb +9 -3
- data/lib/asciidoctor/standoc/front_contributor.rb +34 -10
- data/lib/asciidoctor/standoc/isodoc.rng +29 -44
- data/lib/asciidoctor/standoc/lists.rb +4 -2
- data/lib/asciidoctor/standoc/macros.rb +45 -63
- data/lib/asciidoctor/standoc/macros_terms.rb +82 -0
- data/lib/asciidoctor/standoc/ref.rb +24 -36
- data/lib/asciidoctor/standoc/ref_sect.rb +16 -8
- data/lib/asciidoctor/standoc/section.rb +5 -9
- data/lib/asciidoctor/standoc/table.rb +12 -0
- data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +86 -0
- data/lib/liquid/custom_blocks/with_json_nested_context.rb +18 -0
- data/lib/liquid/custom_blocks/with_yaml_nested_context.rb +19 -0
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +6 -3
- data/spec/asciidoctor-standoc/base_spec.rb +127 -8
- data/spec/asciidoctor-standoc/blocks_spec.rb +8 -8
- data/spec/asciidoctor-standoc/cleanup_sections_spec.rb +1514 -0
- data/spec/asciidoctor-standoc/cleanup_spec.rb +450 -1554
- data/spec/asciidoctor-standoc/isobib_cache_spec.rb +22 -31
- data/spec/asciidoctor-standoc/lists_spec.rb +10 -1
- data/spec/asciidoctor-standoc/macros_json2text_spec.rb +1 -1
- data/spec/asciidoctor-standoc/macros_lutaml_spec.rb +80 -0
- data/spec/asciidoctor-standoc/macros_plantuml_spec.rb +307 -0
- data/spec/asciidoctor-standoc/macros_spec.rb +378 -169
- data/spec/asciidoctor-standoc/macros_yaml2text_spec.rb +1 -1
- data/spec/asciidoctor-standoc/refs_dl_spec.rb +8 -8
- data/spec/asciidoctor-standoc/refs_spec.rb +350 -101
- data/spec/asciidoctor-standoc/section_spec.rb +11 -11
- data/spec/asciidoctor-standoc/table_spec.rb +86 -0
- data/spec/asciidoctor-standoc/validate_spec.rb +26 -0
- data/spec/fixtures/diagram_definitions.lutaml +22 -0
- data/spec/fixtures/test.exp +121 -0
- data/spec/spec_helper.rb +33 -0
- data/spec/support/shared_examples/structured_data_2_text_preprocessor.rb +156 -4
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +49 -233
- data/spec/vcr_cassettes/isobib_get_123.yml +12 -58
- data/spec/vcr_cassettes/isobib_get_123_1.yml +27 -119
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +361 -0
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +12 -58
- data/spec/vcr_cassettes/isobib_get_124.yml +11 -57
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +8 -8
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +276 -158
- metadata +61 -14
- data/.github/workflows/macos.yml +0 -41
- data/.github/workflows/ubuntu.yml +0 -45
- data/.github/workflows/windows.yml +0 -43
- data/lib/asciidoctor/standoc/base_structured_text_preprocessor.rb +0 -123
- data/lib/asciidoctor/standoc/json2_text_preprocessor.rb +0 -44
- data/lib/asciidoctor/standoc/yaml2_text_preprocessor.rb +0 -46
@@ -158,7 +158,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
158
158
|
<terms id="_" obligation="normative">
|
159
159
|
<title>Terms and definitions</title>
|
160
160
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
161
|
-
<term id="
|
161
|
+
<term id="term-t90"><preferred><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub>
|
162
162
|
<mrow>
|
163
163
|
<mi>t</mi>
|
164
164
|
</mrow>
|
@@ -200,11 +200,11 @@ RSpec.describe Asciidoctor::Standoc do
|
|
200
200
|
<terms id="_" obligation="normative">
|
201
201
|
<title>Terms and definitions</title>
|
202
202
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
203
|
-
<term id="
|
203
|
+
<term id="term-tempus">
|
204
204
|
<preferred>Tempus</preferred>
|
205
205
|
<domain>relativity</domain><definition><p id="_"> Time</p></definition>
|
206
206
|
</term>
|
207
|
-
<term id='
|
207
|
+
<term id='term-tempus1'>
|
208
208
|
<preferred>Tempus1</preferred>
|
209
209
|
<domain>relativity2</domain>
|
210
210
|
<definition>
|
@@ -243,7 +243,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
243
243
|
<terms id="_" obligation="normative">
|
244
244
|
<title>Terms and definitions</title>
|
245
245
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
246
|
-
<term id="
|
246
|
+
<term id="term-t90"><preferred><stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub>
|
247
247
|
<mrow>
|
248
248
|
<mi>t</mi>
|
249
249
|
</mrow>
|
@@ -268,33 +268,6 @@ RSpec.describe Asciidoctor::Standoc do
|
|
268
268
|
OUTPUT
|
269
269
|
end
|
270
270
|
|
271
|
-
it "strips any initial boilerplate from terms and definitions" do
|
272
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
273
|
-
#{ASCIIDOC_BLANK_HDR}
|
274
|
-
== Terms and Definitions
|
275
|
-
|
276
|
-
I am boilerplate
|
277
|
-
|
278
|
-
* So am I
|
279
|
-
|
280
|
-
=== Time
|
281
|
-
|
282
|
-
This paragraph is extraneous
|
283
|
-
INPUT
|
284
|
-
#{BLANK_HDR}
|
285
|
-
<sections>
|
286
|
-
<terms id="_" obligation="normative"><title>Terms and definitions</title>
|
287
|
-
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
288
|
-
|
289
|
-
<term id="_">
|
290
|
-
<preferred>Time</preferred>
|
291
|
-
<definition><p id="_">This paragraph is extraneous</p></definition>
|
292
|
-
</term></terms>
|
293
|
-
</sections>
|
294
|
-
</standard-document>
|
295
|
-
OUTPUT
|
296
|
-
end
|
297
|
-
|
298
271
|
it "moves notes inside preceding blocks, if they are not at clause end, and the blocks are not delimited" do
|
299
272
|
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
300
273
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -415,6 +388,9 @@ RSpec.describe Asciidoctor::Standoc do
|
|
415
388
|
#{ASCIIDOC_BLANK_HDR}
|
416
389
|
<<iso216,whole,clause=3,example=9-11,locality:prelude="33 a",locality:entirety:the reference,xyz>>
|
417
390
|
<<iso216,whole,clause=3,example=9-11,locality:prelude=33,locality:entirety="the reference";whole,clause=3,example=9-11,locality:prelude=33,locality:entirety:the reference,xyz>>
|
391
|
+
<<iso216,_whole_>>
|
392
|
+
<<iso216,a _whole_ flagon>>
|
393
|
+
<<iso216,whole,clause=3,a _whole_ flagon>>
|
418
394
|
|
419
395
|
[bibliography]
|
420
396
|
== Normative References
|
@@ -462,7 +438,25 @@ RSpec.describe Asciidoctor::Standoc do
|
|
462
438
|
</localityStack>
|
463
439
|
the reference,xyz
|
464
440
|
</eref>
|
465
|
-
|
441
|
+
<eref type='inline' bibitemid='iso216' citeas='ISO 216'>
|
442
|
+
<em>whole</em>
|
443
|
+
</eref>
|
444
|
+
<eref type='inline' bibitemid='iso216' citeas='ISO 216'>
|
445
|
+
a
|
446
|
+
<em>whole</em>
|
447
|
+
flagon
|
448
|
+
</eref>
|
449
|
+
<eref type='inline' bibitemid='iso216' citeas='ISO 216'>
|
450
|
+
<localityStack>
|
451
|
+
<locality type='whole'/>
|
452
|
+
<locality type='clause'>
|
453
|
+
<referenceFrom>3</referenceFrom>
|
454
|
+
</locality>
|
455
|
+
</localityStack>
|
456
|
+
a
|
457
|
+
<em>whole</em>
|
458
|
+
flagon
|
459
|
+
</eref>
|
466
460
|
</p>
|
467
461
|
</foreword></preface><sections>
|
468
462
|
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
@@ -536,7 +530,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
536
530
|
<terms id="_" obligation="normative">
|
537
531
|
<title>Terms and definitions</title>
|
538
532
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
539
|
-
<term id="
|
533
|
+
<term id="term-term1">
|
540
534
|
<preferred>Term1</preferred>
|
541
535
|
<termsource status="identical">
|
542
536
|
<origin bibitemid="ISO2191" type="inline" citeas="">
|
@@ -552,114 +546,6 @@ RSpec.describe Asciidoctor::Standoc do
|
|
552
546
|
OUTPUT
|
553
547
|
end
|
554
548
|
|
555
|
-
it "removes initial extraneous material from Normative References" do
|
556
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
557
|
-
#{ASCIIDOC_BLANK_HDR}
|
558
|
-
[bibliography]
|
559
|
-
== Normative References
|
560
|
-
|
561
|
-
This is extraneous information
|
562
|
-
|
563
|
-
* [[[iso216,ISO 216]]], _Reference_
|
564
|
-
|
565
|
-
This is also extraneous information
|
566
|
-
INPUT
|
567
|
-
#{BLANK_HDR}
|
568
|
-
<sections></sections>
|
569
|
-
<bibliography><references id="_" obligation="informative" normative="true"><title>Normative references</title>
|
570
|
-
#{NORM_REF_BOILERPLATE}
|
571
|
-
<bibitem id="iso216" type="standard">
|
572
|
-
<title format="text/plain">Reference</title>
|
573
|
-
<docidentifier>ISO 216</docidentifier>
|
574
|
-
<docnumber>216</docnumber>
|
575
|
-
<contributor>
|
576
|
-
<role type="publisher"/>
|
577
|
-
<organization>
|
578
|
-
<name>ISO</name>
|
579
|
-
</organization>
|
580
|
-
</contributor>
|
581
|
-
</bibitem>
|
582
|
-
<p id='_'>This is also extraneous information</p>
|
583
|
-
</references>
|
584
|
-
</bibliography>
|
585
|
-
</standard-document>
|
586
|
-
OUTPUT
|
587
|
-
end
|
588
|
-
|
589
|
-
it "sorts references with their notes in Bibliography" do
|
590
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
591
|
-
#{ASCIIDOC_BLANK_HDR}
|
592
|
-
[bibliography]
|
593
|
-
== Bibliography
|
594
|
-
|
595
|
-
This is extraneous information
|
596
|
-
|
597
|
-
* [[[iso216,ISO 216]]], _Reference_
|
598
|
-
|
599
|
-
NOTE: ABC
|
600
|
-
|
601
|
-
NOTE: DEF
|
602
|
-
|
603
|
-
This is further extraneous information
|
604
|
-
|
605
|
-
NOTE: GHI
|
606
|
-
|
607
|
-
* [[[iso216,ISO 215]]], _Reference_
|
608
|
-
|
609
|
-
NOTE: JKL
|
610
|
-
|
611
|
-
This is also extraneous information
|
612
|
-
INPUT
|
613
|
-
#{BLANK_HDR}
|
614
|
-
<sections> </sections>
|
615
|
-
<bibliography>
|
616
|
-
<references id='_' obligation='informative' normative="false">
|
617
|
-
<title>Bibliography</title>
|
618
|
-
<p id='_'>This is extraneous information</p>
|
619
|
-
<bibitem id='iso216' type='standard'>
|
620
|
-
<title format='text/plain'>Reference</title>
|
621
|
-
<docidentifier>ISO 216</docidentifier>
|
622
|
-
<docnumber>216</docnumber>
|
623
|
-
<contributor>
|
624
|
-
<role type='publisher'/>
|
625
|
-
<organization>
|
626
|
-
<name>ISO</name>
|
627
|
-
</organization>
|
628
|
-
</contributor>
|
629
|
-
</bibitem>
|
630
|
-
<note id='_'>
|
631
|
-
<p id='_'>ABC</p>
|
632
|
-
</note>
|
633
|
-
<note id='_'>
|
634
|
-
<p id='_'>DEF</p>
|
635
|
-
</note>
|
636
|
-
<bibitem id='iso216' type='standard'>
|
637
|
-
<title format='text/plain'>Reference</title>
|
638
|
-
<docidentifier>ISO 215</docidentifier>
|
639
|
-
<docnumber>215</docnumber>
|
640
|
-
<contributor>
|
641
|
-
<role type='publisher'/>
|
642
|
-
<organization>
|
643
|
-
<name>ISO</name>
|
644
|
-
</organization>
|
645
|
-
</contributor>
|
646
|
-
</bibitem>
|
647
|
-
<note id='_'>
|
648
|
-
<p id='_'>JKL</p>
|
649
|
-
</note>
|
650
|
-
<p id='_'>
|
651
|
-
This is further extraneous information
|
652
|
-
<note id='_'>
|
653
|
-
<p id='_'>GHI</p>
|
654
|
-
</note>
|
655
|
-
</p>
|
656
|
-
<p id='_'>This is also extraneous information</p>
|
657
|
-
</references>
|
658
|
-
</bibliography>
|
659
|
-
</standard-document>
|
660
|
-
OUTPUT
|
661
|
-
end
|
662
|
-
|
663
549
|
it "inserts IDs into paragraphs" do
|
664
550
|
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
665
551
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -703,24 +589,68 @@ end
|
|
703
589
|
Key
|
704
590
|
|
705
591
|
a:: b
|
592
|
+
|
593
|
+
|===
|
594
|
+
|a |b |c
|
595
|
+
|===
|
596
|
+
|
597
|
+
[%key]
|
598
|
+
a:: b
|
599
|
+
|
600
|
+
|===
|
601
|
+
|a |b |c
|
602
|
+
|===
|
603
|
+
|
604
|
+
a:: b
|
706
605
|
INPUT
|
707
606
|
#{BLANK_HDR}
|
708
|
-
<sections
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
607
|
+
<sections>
|
608
|
+
<table id='_'>
|
609
|
+
<tbody>
|
610
|
+
<tr>
|
611
|
+
<td valign='top' align='left'>a</td>
|
612
|
+
<td valign='top' align='left'>b</td>
|
613
|
+
<td valign='top' align='left'>c</td>
|
614
|
+
</tr>
|
615
|
+
</tbody>
|
616
|
+
<dl id='_' key='true'>
|
617
|
+
<dt>a</dt>
|
618
|
+
<dd>
|
619
|
+
<p id='_'>b</p>
|
620
|
+
</dd>
|
621
|
+
</dl>
|
622
|
+
</table>
|
623
|
+
<table id='_'>
|
624
|
+
<tbody>
|
625
|
+
<tr>
|
626
|
+
<td valign='top' align='left'>a</td>
|
627
|
+
<td valign='top' align='left'>b</td>
|
628
|
+
<td valign='top' align='left'>c</td>
|
629
|
+
</tr>
|
630
|
+
</tbody>
|
631
|
+
<dl id='_' key='true'>
|
632
|
+
<dt>a</dt>
|
633
|
+
<dd>
|
634
|
+
<p id='_'>b</p>
|
635
|
+
</dd>
|
636
|
+
</dl>
|
637
|
+
</table>
|
638
|
+
<table id='_'>
|
639
|
+
<tbody>
|
640
|
+
<tr>
|
641
|
+
<td valign='top' align='left'>a</td>
|
642
|
+
<td valign='top' align='left'>b</td>
|
643
|
+
<td valign='top' align='left'>c</td>
|
644
|
+
</tr>
|
645
|
+
</tbody>
|
646
|
+
</table>
|
647
|
+
<dl id='_'>
|
648
|
+
<dt>a</dt>
|
649
|
+
<dd>
|
650
|
+
<p id='_'>b</p>
|
651
|
+
</dd>
|
652
|
+
</dl>
|
653
|
+
</sections>
|
724
654
|
</standard-document>
|
725
655
|
OUTPUT
|
726
656
|
end
|
@@ -851,18 +781,76 @@ end
|
|
851
781
|
Where,
|
852
782
|
|
853
783
|
a:: b
|
784
|
+
|
785
|
+
[stem]
|
786
|
+
++++
|
787
|
+
Formula
|
788
|
+
++++
|
789
|
+
|
790
|
+
[%key]
|
791
|
+
a:: b
|
792
|
+
|
793
|
+
[stem]
|
794
|
+
++++
|
795
|
+
Formula
|
796
|
+
++++
|
797
|
+
|
798
|
+
a:: b
|
854
799
|
INPUT
|
855
800
|
#{BLANK_HDR}
|
856
|
-
<sections
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
801
|
+
<sections>
|
802
|
+
<formula id='_'>
|
803
|
+
<stem type='MathML'>
|
804
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
805
|
+
<mi>F</mi>
|
806
|
+
<mi>or</mi>
|
807
|
+
<mi>μ</mi>
|
808
|
+
<mi>l</mi>
|
809
|
+
<mi>a</mi>
|
810
|
+
</math>
|
811
|
+
</stem>
|
812
|
+
<dl id='_' key='true'>
|
813
|
+
<dt>a</dt>
|
814
|
+
<dd>
|
815
|
+
<p id='_'>b</p>
|
816
|
+
</dd>
|
817
|
+
</dl>
|
818
|
+
</formula>
|
819
|
+
<formula id='_'>
|
820
|
+
<stem type='MathML'>
|
821
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
822
|
+
<mi>F</mi>
|
823
|
+
<mi>or</mi>
|
824
|
+
<mi>μ</mi>
|
825
|
+
<mi>l</mi>
|
826
|
+
<mi>a</mi>
|
827
|
+
</math>
|
828
|
+
</stem>
|
829
|
+
<dl id='_' key='true'>
|
830
|
+
<dt>a</dt>
|
831
|
+
<dd>
|
832
|
+
<p id='_'>b</p>
|
833
|
+
</dd>
|
834
|
+
</dl>
|
835
|
+
</formula>
|
836
|
+
<formula id='_'>
|
837
|
+
<stem type='MathML'>
|
838
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
839
|
+
<mi>F</mi>
|
840
|
+
<mi>or</mi>
|
841
|
+
<mi>μ</mi>
|
842
|
+
<mi>l</mi>
|
843
|
+
<mi>a</mi>
|
844
|
+
</math>
|
845
|
+
</stem>
|
846
|
+
</formula>
|
847
|
+
<dl id='_'>
|
848
|
+
<dt>a</dt>
|
849
|
+
<dd>
|
850
|
+
<p id='_'>b</p>
|
851
|
+
</dd>
|
852
|
+
</dl>
|
853
|
+
</sections>
|
866
854
|
</standard-document>
|
867
855
|
OUTPUT
|
868
856
|
end
|
@@ -914,19 +902,46 @@ end
|
|
914
902
|
key:
|
915
903
|
|
916
904
|
a:: b
|
917
|
-
INPUT
|
918
|
-
#{BLANK_HDR}
|
919
|
-
<sections><figure id="_">
|
920
|
-
<image src="spec/examples/rice_images/rice_image1.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
921
|
-
<dl id="_">
|
922
|
-
<dt>a</dt>
|
923
|
-
<dd>
|
924
|
-
<p id="_">b</p>
|
925
|
-
</dd>
|
926
|
-
</dl></figure>
|
927
905
|
|
928
|
-
|
906
|
+
image::spec/examples/rice_images/rice_image1.png[]
|
907
|
+
|
908
|
+
[%key]
|
909
|
+
a:: b
|
910
|
+
|
911
|
+
image::spec/examples/rice_images/rice_image1.png[]
|
929
912
|
|
913
|
+
a:: b
|
914
|
+
INPUT
|
915
|
+
#{BLANK_HDR}
|
916
|
+
<sections>
|
917
|
+
<figure id='_'>
|
918
|
+
<image src='spec/examples/rice_images/rice_image1.png' id='_' mimetype='image/png' height='auto' width='auto'/>
|
919
|
+
<dl id='_' key='true'>
|
920
|
+
<dt>a</dt>
|
921
|
+
<dd>
|
922
|
+
<p id='_'>b</p>
|
923
|
+
</dd>
|
924
|
+
</dl>
|
925
|
+
</figure>
|
926
|
+
<figure id='_'>
|
927
|
+
<image src='spec/examples/rice_images/rice_image1.png' id='_' mimetype='image/png' height='auto' width='auto'/>
|
928
|
+
<dl id='_' key='true'>
|
929
|
+
<dt>a</dt>
|
930
|
+
<dd>
|
931
|
+
<p id='_'>b</p>
|
932
|
+
</dd>
|
933
|
+
</dl>
|
934
|
+
</figure>
|
935
|
+
<figure id='_'>
|
936
|
+
<image src='spec/examples/rice_images/rice_image1.png' id='_' mimetype='image/png' height='auto' width='auto'/>
|
937
|
+
</figure>
|
938
|
+
<dl id='_'>
|
939
|
+
<dt>a</dt>
|
940
|
+
<dd>
|
941
|
+
<p id='_'>b</p>
|
942
|
+
</dd>
|
943
|
+
</dl>
|
944
|
+
</sections>
|
930
945
|
</standard-document>
|
931
946
|
OUTPUT
|
932
947
|
end
|
@@ -1010,7 +1025,7 @@ end
|
|
1010
1025
|
<name>ISO</name>
|
1011
1026
|
</organization>
|
1012
1027
|
</contributor>
|
1013
|
-
<note format="text/plain" type="
|
1028
|
+
<note format="text/plain" type="Unpublished-Status">The standard is in press</note>
|
1014
1029
|
</bibitem>
|
1015
1030
|
</references>
|
1016
1031
|
</bibliography>
|
@@ -1018,31 +1033,6 @@ end
|
|
1018
1033
|
OUTPUT
|
1019
1034
|
end
|
1020
1035
|
|
1021
|
-
it "defaults section obligations" do
|
1022
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1023
|
-
#{ASCIIDOC_BLANK_HDR}
|
1024
|
-
|
1025
|
-
== Clause
|
1026
|
-
Text
|
1027
|
-
|
1028
|
-
[appendix]
|
1029
|
-
== Clause
|
1030
|
-
|
1031
|
-
Text
|
1032
|
-
INPUT
|
1033
|
-
#{BLANK_HDR}
|
1034
|
-
<sections><clause id="_" inline-header="false" obligation="normative">
|
1035
|
-
<title>Clause</title>
|
1036
|
-
<p id="_">Text</p>
|
1037
|
-
</clause>
|
1038
|
-
</sections><annex id="_" inline-header="false" obligation="normative">
|
1039
|
-
<title>Clause</title>
|
1040
|
-
<p id="_">Text</p>
|
1041
|
-
</annex>
|
1042
|
-
</standard-document>
|
1043
|
-
OUTPUT
|
1044
|
-
end
|
1045
|
-
|
1046
1036
|
it "rearranges term note, term example, term source" do
|
1047
1037
|
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1048
1038
|
#{ASCIIDOC_BLANK_HDR}
|
@@ -1069,7 +1059,7 @@ end
|
|
1069
1059
|
<terms id="_" obligation="normative">
|
1070
1060
|
<title>Terms and definitions</title>
|
1071
1061
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
1072
|
-
<term id="
|
1062
|
+
<term id="term-term"><preferred>Term</preferred>
|
1073
1063
|
|
1074
1064
|
|
1075
1065
|
|
@@ -1094,69 +1084,6 @@ end
|
|
1094
1084
|
OUTPUT
|
1095
1085
|
end
|
1096
1086
|
|
1097
|
-
it "extends clause levels past 5" do
|
1098
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1099
|
-
#{ASCIIDOC_BLANK_HDR}
|
1100
|
-
|
1101
|
-
== Clause1
|
1102
|
-
|
1103
|
-
=== Clause2
|
1104
|
-
|
1105
|
-
==== Clause3
|
1106
|
-
|
1107
|
-
===== Clause4
|
1108
|
-
|
1109
|
-
====== Clause 5
|
1110
|
-
|
1111
|
-
[level=6]
|
1112
|
-
====== Clause 6
|
1113
|
-
|
1114
|
-
[level=7]
|
1115
|
-
====== Clause 7A
|
1116
|
-
|
1117
|
-
[level=7]
|
1118
|
-
====== Clause 7B
|
1119
|
-
|
1120
|
-
[level=6]
|
1121
|
-
====== Clause 6B
|
1122
|
-
|
1123
|
-
====== Clause 5B
|
1124
|
-
|
1125
|
-
INPUT
|
1126
|
-
#{BLANK_HDR}
|
1127
|
-
<sections>
|
1128
|
-
<clause id="_" inline-header="false" obligation="normative">
|
1129
|
-
<title>Clause1</title>
|
1130
|
-
<clause id="_" inline-header="false" obligation="normative">
|
1131
|
-
<title>Clause2</title>
|
1132
|
-
<clause id="_" inline-header="false" obligation="normative">
|
1133
|
-
<title>Clause3</title>
|
1134
|
-
<clause id="_" inline-header="false" obligation="normative"><title>Clause4</title><clause id="_" inline-header="false" obligation="normative">
|
1135
|
-
<title>Clause 5</title>
|
1136
|
-
<clause id="_" inline-header="false" obligation="normative">
|
1137
|
-
<title>Clause 6</title>
|
1138
|
-
<clause id="_" inline-header="false" obligation="normative">
|
1139
|
-
<title>Clause 7A</title>
|
1140
|
-
</clause><clause id="_" inline-header="false" obligation="normative">
|
1141
|
-
<title>Clause 7B</title>
|
1142
|
-
</clause></clause><clause id="_" inline-header="false" obligation="normative">
|
1143
|
-
<title>Clause 6B</title>
|
1144
|
-
</clause></clause>
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
<clause id="_" inline-header="false" obligation="normative">
|
1150
|
-
<title>Clause 5B</title>
|
1151
|
-
</clause></clause>
|
1152
|
-
</clause>
|
1153
|
-
</clause>
|
1154
|
-
</clause>
|
1155
|
-
</sections>
|
1156
|
-
</standard-document>
|
1157
|
-
OUTPUT
|
1158
|
-
end
|
1159
|
-
|
1160
1087
|
it "separates IEV citations by top-level clause" do
|
1161
1088
|
FileUtils.rm_rf File.expand_path("~/.relaton-bib.pstore1")
|
1162
1089
|
FileUtils.mv File.expand_path("~/.relaton/cache"), File.expand_path("~/.relaton-bib.pstore1"), force: true
|
@@ -1167,7 +1094,7 @@ end
|
|
1167
1094
|
# mock_iecbib_get_iec60050_102_01
|
1168
1095
|
# mock_iecbib_get_iec60050_103_01
|
1169
1096
|
# mock_iev
|
1170
|
-
VCR.use_cassette "separates_iev_citations_by_top_level_clause"
|
1097
|
+
VCR.use_cassette "separates_iev_citations_by_top_level_clause" do
|
1171
1098
|
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1172
1099
|
#{CACHED_ISOBIB_BLANK_HDR}
|
1173
1100
|
|
@@ -1196,7 +1123,7 @@ end
|
|
1196
1123
|
<sections>
|
1197
1124
|
<terms id="_" obligation="normative"><title>Terms and definitions</title>
|
1198
1125
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
1199
|
-
<term id="
|
1126
|
+
<term id="term-automation1">
|
1200
1127
|
<preferred>Automation1</preferred>
|
1201
1128
|
<termsource status="identical">
|
1202
1129
|
<origin bibitemid="IEC60050-103" type="inline" citeas="IEC 60050-103:2009">
|
@@ -1206,7 +1133,7 @@ end
|
|
1206
1133
|
</origin>
|
1207
1134
|
</termsource>
|
1208
1135
|
</term>
|
1209
|
-
<term id="
|
1136
|
+
<term id="term-automation2">
|
1210
1137
|
<preferred>Automation2</preferred>
|
1211
1138
|
<termsource status="identical">
|
1212
1139
|
<origin bibitemid="IEC60050-102" type="inline" citeas="IEC 60050-102:2007">
|
@@ -1216,7 +1143,7 @@ end
|
|
1216
1143
|
</origin>
|
1217
1144
|
</termsource>
|
1218
1145
|
</term>
|
1219
|
-
<term id="
|
1146
|
+
<term id="term-automation3">
|
1220
1147
|
<preferred>Automation3</preferred>
|
1221
1148
|
<termsource status="identical">
|
1222
1149
|
<origin bibitemid="IEC60050-103" type="inline" citeas="IEC 60050-103:2009">
|
@@ -1238,7 +1165,7 @@ end
|
|
1238
1165
|
<docidentifier type="IEC">IEC 60050-102:2007</docidentifier>
|
1239
1166
|
<docidentifier type='URN'>urn:iec:std:iec:60050-102:2007:::en</docidentifier>
|
1240
1167
|
<date type="published">
|
1241
|
-
<on>2007</on>
|
1168
|
+
<on>2007-08-27</on>
|
1242
1169
|
</date>
|
1243
1170
|
<contributor>
|
1244
1171
|
<role type="publisher"/>
|
@@ -1277,7 +1204,7 @@ end
|
|
1277
1204
|
<docidentifier type="IEC">IEC 60050-103:2009</docidentifier>
|
1278
1205
|
<docidentifier type='URN'>urn:iec:std:iec:60050-103:2009:::en</docidentifier>
|
1279
1206
|
<date type="published">
|
1280
|
-
<on>2009</on>
|
1207
|
+
<on>2009-12-14</on>
|
1281
1208
|
</date>
|
1282
1209
|
<contributor>
|
1283
1210
|
<role type="publisher"/>
|
@@ -1488,6 +1415,14 @@ OUTPUT
|
|
1488
1415
|
* [[[iso125,ISO 125]]] _Standard 124_
|
1489
1416
|
* [[[iso126,1]]] _Standard 123_
|
1490
1417
|
|
1418
|
+
[bibliography]
|
1419
|
+
== Bibliography Redux
|
1420
|
+
|
1421
|
+
[bibliography]
|
1422
|
+
=== Clause 1
|
1423
|
+
* [[[iso127,ISO 124]]] _Standard 124_
|
1424
|
+
* [[[iso128,1]]] _Standard 123_
|
1425
|
+
|
1491
1426
|
INPUT
|
1492
1427
|
#{BLANK_HDR}
|
1493
1428
|
<sections><clause id="_" inline-header="false" obligation="normative">
|
@@ -1535,77 +1470,34 @@ OUTPUT
|
|
1535
1470
|
</formattedref>
|
1536
1471
|
<docidentifier type="metanorma">[4]</docidentifier>
|
1537
1472
|
</bibitem>
|
1473
|
+
</references>
|
1474
|
+
</clause>
|
1475
|
+
<clause id='_' obligation='informative'>
|
1476
|
+
<title>Bibliography Redux</title>
|
1477
|
+
<references id='_' normative='false' obligation='informative'>
|
1478
|
+
<title>Clause 1</title>
|
1479
|
+
<bibitem id='iso127' type='standard'>
|
1480
|
+
<title format='text/plain'>Standard 124</title>
|
1481
|
+
<docidentifier>ISO 124</docidentifier>
|
1482
|
+
<docnumber>124</docnumber>
|
1483
|
+
<contributor>
|
1484
|
+
<role type='publisher'/>
|
1485
|
+
<organization>
|
1486
|
+
<name>ISO</name>
|
1487
|
+
</organization>
|
1488
|
+
</contributor>
|
1489
|
+
</bibitem>
|
1490
|
+
<bibitem id='iso128'>
|
1491
|
+
<formattedref format='application/x-isodoc+xml'>
|
1492
|
+
<em>Standard 123</em>
|
1493
|
+
</formattedref>
|
1494
|
+
<docidentifier type='metanorma'>[6]</docidentifier>
|
1495
|
+
</bibitem>
|
1538
1496
|
</references></clause></bibliography>
|
1539
1497
|
</standard-document>
|
1540
1498
|
OUTPUT
|
1541
1499
|
end
|
1542
1500
|
|
1543
|
-
it "inserts boilerplate before empty Normative References" do
|
1544
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1545
|
-
#{ASCIIDOC_BLANK_HDR}
|
1546
|
-
|
1547
|
-
[bibliography]
|
1548
|
-
== Normative References
|
1549
|
-
|
1550
|
-
INPUT
|
1551
|
-
#{BLANK_HDR}
|
1552
|
-
<sections>
|
1553
|
-
|
1554
|
-
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
1555
|
-
<title>Normative references</title><p id="_">There are no normative references in this document.</p>
|
1556
|
-
</references></bibliography>
|
1557
|
-
</standard-document>
|
1558
|
-
OUTPUT
|
1559
|
-
end
|
1560
|
-
|
1561
|
-
it "inserts boilerplate before non-empty Normative References" do
|
1562
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1563
|
-
#{ASCIIDOC_BLANK_HDR}
|
1564
|
-
|
1565
|
-
[bibliography]
|
1566
|
-
== Normative References
|
1567
|
-
* [[[a,b]]] A
|
1568
|
-
|
1569
|
-
INPUT
|
1570
|
-
#{BLANK_HDR}
|
1571
|
-
<sections>
|
1572
|
-
|
1573
|
-
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
1574
|
-
<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>
|
1575
|
-
<bibitem id="a">
|
1576
|
-
<formattedref format="application/x-isodoc+xml">A</formattedref>
|
1577
|
-
<docidentifier>b</docidentifier>
|
1578
|
-
</bibitem>
|
1579
|
-
</references></bibliography>
|
1580
|
-
</standard-document>
|
1581
|
-
|
1582
|
-
OUTPUT
|
1583
|
-
end
|
1584
|
-
|
1585
|
-
it "inserts boilerplate before empty Normative References in French" do
|
1586
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1587
|
-
= Document title
|
1588
|
-
Author
|
1589
|
-
:docfile: test.adoc
|
1590
|
-
:nodoc:
|
1591
|
-
:novalid:
|
1592
|
-
:no-isobib:
|
1593
|
-
:language: fr
|
1594
|
-
|
1595
|
-
[bibliography]
|
1596
|
-
== Normative References
|
1597
|
-
|
1598
|
-
INPUT
|
1599
|
-
#{BLANK_HDR.sub(/<language>en/, "<language>fr")}
|
1600
|
-
<sections>
|
1601
|
-
|
1602
|
-
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
1603
|
-
<title>Références normatives</title><p id="_">Le présent document ne contient aucune référence normative.</p>
|
1604
|
-
</references></bibliography>
|
1605
|
-
</standard-document>
|
1606
|
-
OUTPUT
|
1607
|
-
end
|
1608
|
-
|
1609
1501
|
it "removes bibdata bibitem IDs" do
|
1610
1502
|
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1611
1503
|
= Document title
|
@@ -1960,1221 +1852,18 @@ OUTPUT
|
|
1960
1852
|
end
|
1961
1853
|
|
1962
1854
|
|
1963
|
-
it "
|
1964
|
-
|
1965
|
-
|
1966
|
-
.Foreword.footnote:[A]
|
1967
|
-
|
1968
|
-
Text
|
1969
|
-
|
1970
|
-
[abstract]
|
1971
|
-
== Abstract.footnote:[A]
|
1972
|
-
|
1973
|
-
Text
|
1974
|
-
|
1975
|
-
[heading=introduction]
|
1976
|
-
== Introduction.footnote:[A]
|
1977
|
-
|
1978
|
-
=== Introduction Subsection
|
1979
|
-
|
1980
|
-
[heading=acknowledgements]
|
1981
|
-
== Acknowledgements.footnote:[A]
|
1982
|
-
|
1983
|
-
[.preface]
|
1984
|
-
== Dedication
|
1985
|
-
|
1986
|
-
[heading=scope]
|
1987
|
-
== Scope.footnote:[A]
|
1988
|
-
|
1989
|
-
Text
|
1990
|
-
|
1991
|
-
[bibliography,heading=normative references]
|
1992
|
-
== Normative References.footnote:[A]
|
1993
|
-
|
1994
|
-
[bibliography,normative=true]
|
1995
|
-
== Normative References 2.footnote:[A]
|
1996
|
-
|
1997
|
-
[heading=terms and definitions]
|
1998
|
-
== Terms and Definitions.footnote:[A]
|
1999
|
-
|
2000
|
-
=== Term1
|
2001
|
-
|
2002
|
-
[heading="terms and definitions"]
|
2003
|
-
== Terms, Definitions, Symbols and Abbreviated Terms.footnote:[A]
|
2004
|
-
|
2005
|
-
[.nonterm]
|
2006
|
-
=== Introduction
|
2007
|
-
|
2008
|
-
==== Intro 1
|
2009
|
-
|
2010
|
-
=== Intro 2
|
2011
|
-
|
2012
|
-
[.nonterm]
|
2013
|
-
==== Intro 3
|
2014
|
-
|
2015
|
-
=== Intro 4
|
1855
|
+
it "fixes illegal anchors" do
|
1856
|
+
input = <<~INPUT
|
1857
|
+
#{ASCIIDOC_BLANK_HDR}
|
2016
1858
|
|
2017
|
-
|
2018
|
-
|
2019
|
-
|
2020
|
-
|
2021
|
-
|
2022
|
-
|
2023
|
-
|
2024
|
-
|
2025
|
-
[heading=symbols and abbreviated terms]
|
2026
|
-
=== Symbols and Abbreviated Terms.footnote:[A]
|
2027
|
-
|
2028
|
-
[.nonterm]
|
2029
|
-
==== General
|
2030
|
-
|
2031
|
-
[heading=symbols]
|
2032
|
-
==== Symbols 1.footnote:[A]
|
2033
|
-
|
2034
|
-
[heading=abbreviated terms]
|
2035
|
-
== Abbreviated Terms.footnote:[A]
|
2036
|
-
|
2037
|
-
== Clause 4
|
2038
|
-
|
2039
|
-
=== Introduction
|
2040
|
-
|
2041
|
-
=== Clause 4.2
|
2042
|
-
|
2043
|
-
== Terms and Definitions
|
2044
|
-
|
2045
|
-
[appendix]
|
2046
|
-
== Annex.footnote:[A]
|
2047
|
-
|
2048
|
-
=== Annex A.1
|
2049
|
-
|
2050
|
-
[bibliography,heading=bibliography]
|
2051
|
-
== Bibliography.footnote:[A]
|
2052
|
-
|
2053
|
-
[bibliography,normative=false]
|
2054
|
-
== Bibliography 2.footnote:[A]
|
2055
|
-
|
2056
|
-
=== Bibliography Subsection
|
2057
|
-
|
2058
|
-
INPUT
|
2059
|
-
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
2060
|
-
<bibdata type='standard'>
|
2061
|
-
<title language='en' format='text/plain'>Document title</title>
|
2062
|
-
<language>en</language>
|
2063
|
-
<script>Latn</script>
|
2064
|
-
<abstract>
|
2065
|
-
<p>Text</p>
|
2066
|
-
</abstract>
|
2067
|
-
<status>
|
2068
|
-
<stage>published</stage>
|
2069
|
-
</status>
|
2070
|
-
<copyright>
|
2071
|
-
<from>2020</from>
|
2072
|
-
</copyright>
|
2073
|
-
<ext>
|
2074
|
-
<doctype>article</doctype>
|
2075
|
-
</ext>
|
2076
|
-
</bibdata>
|
2077
|
-
<preface>
|
2078
|
-
<abstract id='_'>
|
2079
|
-
<title>Abstract</title>
|
2080
|
-
<p id='_'>Text</p>
|
2081
|
-
</abstract>
|
2082
|
-
<foreword id='_' obligation='informative'>
|
2083
|
-
<title>
|
2084
|
-
Foreword
|
2085
|
-
<fn reference='1'>
|
2086
|
-
<p id='_'>A</p>
|
2087
|
-
</fn>
|
2088
|
-
</title>
|
2089
|
-
<p id='_'>Text</p>
|
2090
|
-
</foreword>
|
2091
|
-
<introduction id='_' obligation='informative'>
|
2092
|
-
<title>Introduction</title>
|
2093
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
2094
|
-
<title>Introduction Subsection</title>
|
2095
|
-
</clause>
|
2096
|
-
</introduction>
|
2097
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
2098
|
-
<title>Dedication</title>
|
2099
|
-
</clause>
|
2100
|
-
<acknowledgements id='_' obligation='informative'>
|
2101
|
-
<title>
|
2102
|
-
Acknowledgements
|
2103
|
-
<fn reference='1'>
|
2104
|
-
<p id='_'>A</p>
|
2105
|
-
</fn>
|
2106
|
-
</title>
|
2107
|
-
</acknowledgements>
|
2108
|
-
</preface>
|
2109
|
-
<sections>
|
2110
|
-
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
2111
|
-
<title>
|
2112
|
-
Scope
|
2113
|
-
<fn reference='1'>
|
2114
|
-
<p id='_'>A</p>
|
2115
|
-
</fn>
|
2116
|
-
</title>
|
2117
|
-
<p id='_'>Text</p>
|
2118
|
-
</clause>
|
2119
|
-
<terms id='_' obligation='normative'>
|
2120
|
-
<title>
|
2121
|
-
Terms and definitions
|
2122
|
-
<fn reference='1'>
|
2123
|
-
<p id='_'>A</p>
|
2124
|
-
</fn>
|
2125
|
-
</title>
|
2126
|
-
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
2127
|
-
<term id='_'>
|
2128
|
-
<preferred>Term1</preferred>
|
2129
|
-
</term>
|
2130
|
-
</terms>
|
2131
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2132
|
-
<title>
|
2133
|
-
Terms, Definitions, Symbols and Abbreviated Terms.
|
2134
|
-
<fn reference='1'>
|
2135
|
-
<p id='_'>A</p>
|
2136
|
-
</fn>
|
2137
|
-
</title>
|
2138
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2139
|
-
<title>Introduction</title>
|
2140
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2141
|
-
<title>Intro 1</title>
|
2142
|
-
</clause>
|
2143
|
-
</clause>
|
2144
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2145
|
-
<title>Intro 2</title>
|
2146
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2147
|
-
<title>Intro 3</title>
|
2148
|
-
</clause>
|
2149
|
-
</clause>
|
2150
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2151
|
-
<title>Intro 4</title>
|
2152
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2153
|
-
<title>Intro 5</title>
|
2154
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2155
|
-
<title>Term1</title>
|
2156
|
-
</clause>
|
2157
|
-
</clause>
|
2158
|
-
</clause>
|
2159
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2160
|
-
<title>Normal Terms</title>
|
2161
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2162
|
-
<title>Term2</title>
|
2163
|
-
</clause>
|
2164
|
-
</clause>
|
2165
|
-
<definitions id='_' obligation='normative'>
|
2166
|
-
<title>
|
2167
|
-
Symbols and abbreviated terms
|
2168
|
-
<fn reference='1'>
|
2169
|
-
<p id='_'>A</p>
|
2170
|
-
</fn>
|
2171
|
-
</title>
|
2172
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2173
|
-
<title>General</title>
|
2174
|
-
</clause>
|
2175
|
-
<definitions id='_' type='symbols' obligation='normative'>
|
2176
|
-
<title>
|
2177
|
-
Symbols
|
2178
|
-
<fn reference='1'>
|
2179
|
-
<p id='_'>A</p>
|
2180
|
-
</fn>
|
2181
|
-
</title>
|
2182
|
-
</definitions>
|
2183
|
-
</definitions>
|
2184
|
-
</clause>
|
2185
|
-
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
2186
|
-
<title>
|
2187
|
-
Abbreviated terms
|
2188
|
-
<fn reference='1'>
|
2189
|
-
<p id='_'>A</p>
|
2190
|
-
</fn>
|
2191
|
-
</title>
|
2192
|
-
</definitions>
|
2193
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2194
|
-
<title>Clause 4</title>
|
2195
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2196
|
-
<title>Introduction</title>
|
2197
|
-
</clause>
|
2198
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2199
|
-
<title>Clause 4.2</title>
|
2200
|
-
</clause>
|
2201
|
-
</clause>
|
2202
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2203
|
-
<title>Terms and Definitions</title>
|
2204
|
-
</clause>
|
2205
|
-
</sections>
|
2206
|
-
<annex id='_' inline-header='false' obligation='normative'>
|
2207
|
-
<title>
|
2208
|
-
Annex.
|
2209
|
-
<fn reference='1'>
|
2210
|
-
<p id='_'>A</p>
|
2211
|
-
</fn>
|
2212
|
-
</title>
|
2213
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2214
|
-
<title>Annex A.1</title>
|
2215
|
-
</clause>
|
2216
|
-
</annex>
|
2217
|
-
<bibliography>
|
2218
|
-
<references id='_' normative='true' obligation='informative'>
|
2219
|
-
<title>Normative references</title>
|
2220
|
-
<p id='_'>There are no normative references in this document.</p>
|
2221
|
-
</references>
|
2222
|
-
<references id='_' normative='false' obligation='informative'>
|
2223
|
-
<title>Bibliography</title>
|
2224
|
-
</references>
|
2225
|
-
<references id='_' normative='false' obligation='informative'>
|
2226
|
-
<title>Bibliography</title>
|
2227
|
-
</references>
|
2228
|
-
<clause id='_' obligation='informative'>
|
2229
|
-
<title>Bibliography</title>
|
2230
|
-
<references id='_' normative='false' obligation='informative'>
|
2231
|
-
<title>Bibliography Subsection</title>
|
2232
|
-
</references>
|
2233
|
-
</clause>
|
2234
|
-
</bibliography>
|
2235
|
-
</standard-document>
|
2236
|
-
OUTPUT
|
2237
|
-
end
|
2238
|
-
|
2239
|
-
it "processes section names, default to English" do
|
2240
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2241
|
-
#{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":language: tlh\n:script: Latn\n:nodoc:")}
|
2242
|
-
.Foreword
|
2243
|
-
|
2244
|
-
Text
|
2245
|
-
|
2246
|
-
[abstract]
|
2247
|
-
== Abstract
|
2248
|
-
|
2249
|
-
Text
|
2250
|
-
|
2251
|
-
[heading=introduction]
|
2252
|
-
== Introduction
|
2253
|
-
|
2254
|
-
=== Introduction Subsection
|
2255
|
-
|
2256
|
-
[heading=acknowledgements]
|
2257
|
-
== Acknowledgements
|
2258
|
-
|
2259
|
-
[.preface]
|
2260
|
-
== Dedication
|
2261
|
-
|
2262
|
-
[heading=scope]
|
2263
|
-
== Scope
|
2264
|
-
|
2265
|
-
Text
|
2266
|
-
|
2267
|
-
[bibliography,heading=normative references]
|
2268
|
-
== Normative References
|
2269
|
-
|
2270
|
-
[bibliography,normative=true]
|
2271
|
-
== Normative References 2
|
2272
|
-
|
2273
|
-
[heading=terms and definitions]
|
2274
|
-
== Terms and Definitions
|
2275
|
-
|
2276
|
-
=== Term1
|
2277
|
-
|
2278
|
-
[heading="terms and definitions"]
|
2279
|
-
== Terms, Definitions, Symbols and Abbreviated Terms
|
2280
|
-
|
2281
|
-
[.nonterm]
|
2282
|
-
=== Introduction
|
2283
|
-
|
2284
|
-
==== Intro 1
|
2285
|
-
|
2286
|
-
=== Intro 2
|
2287
|
-
|
2288
|
-
[.nonterm]
|
2289
|
-
==== Intro 3
|
2290
|
-
|
2291
|
-
=== Intro 4
|
2292
|
-
|
2293
|
-
==== Intro 5
|
2294
|
-
|
2295
|
-
===== Term1
|
2296
|
-
|
2297
|
-
=== Normal Terms
|
2298
|
-
|
2299
|
-
==== Term2
|
2300
|
-
|
2301
|
-
[heading=symbols and abbreviated terms]
|
2302
|
-
=== Symbols and Abbreviated Terms
|
2303
|
-
|
2304
|
-
[.nonterm]
|
2305
|
-
==== General
|
2306
|
-
|
2307
|
-
[heading=symbols]
|
2308
|
-
==== Symbols 1
|
2309
|
-
|
2310
|
-
[heading=abbreviated terms]
|
2311
|
-
== Abbreviated Terms
|
2312
|
-
|
2313
|
-
== Clause 4
|
2314
|
-
|
2315
|
-
=== Introduction
|
2316
|
-
|
2317
|
-
=== Clause 4.2
|
2318
|
-
|
2319
|
-
== Terms and Definitions
|
2320
|
-
|
2321
|
-
[appendix]
|
2322
|
-
== Annex
|
2323
|
-
|
2324
|
-
=== Annex A.1
|
2325
|
-
|
2326
|
-
[bibliography,heading=bibliography]
|
2327
|
-
== Bibliography
|
2328
|
-
|
2329
|
-
[bibliography,normative=false]
|
2330
|
-
== Bibliography 2
|
2331
|
-
|
2332
|
-
=== Bibliography Subsection
|
2333
|
-
|
2334
|
-
INPUT
|
2335
|
-
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
2336
|
-
<bibdata type='standard'>
|
2337
|
-
<title language='en' format='text/plain'>Document title</title>
|
2338
|
-
<language>tlh</language>
|
2339
|
-
<script>Latn</script>
|
2340
|
-
<abstract>
|
2341
|
-
<p>Text</p>
|
2342
|
-
</abstract>
|
2343
|
-
<status>
|
2344
|
-
<stage>published</stage>
|
2345
|
-
</status>
|
2346
|
-
<copyright>
|
2347
|
-
<from>2020</from>
|
2348
|
-
</copyright>
|
2349
|
-
<ext>
|
2350
|
-
<doctype>article</doctype>
|
2351
|
-
</ext>
|
2352
|
-
</bibdata>
|
2353
|
-
<preface>
|
2354
|
-
<abstract id='_'>
|
2355
|
-
<title>Abstract</title>
|
2356
|
-
<p id='_'>Text</p>
|
2357
|
-
</abstract>
|
2358
|
-
<foreword id='_' obligation='informative'>
|
2359
|
-
<title>Foreword</title>
|
2360
|
-
<p id='_'>Text</p>
|
2361
|
-
</foreword>
|
2362
|
-
<introduction id='_' obligation='informative'>
|
2363
|
-
<title>Introduction</title>
|
2364
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
2365
|
-
<title>Introduction Subsection</title>
|
2366
|
-
</clause>
|
2367
|
-
</introduction>
|
2368
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
2369
|
-
<title>Dedication</title>
|
2370
|
-
</clause>
|
2371
|
-
<acknowledgements id='_' obligation='informative'>
|
2372
|
-
<title>Acknowledgements</title>
|
2373
|
-
</acknowledgements>
|
2374
|
-
</preface>
|
2375
|
-
<sections>
|
2376
|
-
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
2377
|
-
<title>Scope</title>
|
2378
|
-
<p id='_'>Text</p>
|
2379
|
-
</clause>
|
2380
|
-
<terms id='_' obligation='normative'>
|
2381
|
-
<title>Terms and definitions</title>
|
2382
|
-
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
2383
|
-
<term id='_'>
|
2384
|
-
<preferred>Term1</preferred>
|
2385
|
-
</term>
|
2386
|
-
</terms>
|
2387
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2388
|
-
<title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
2389
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2390
|
-
<title>Introduction</title>
|
2391
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2392
|
-
<title>Intro 1</title>
|
2393
|
-
</clause>
|
2394
|
-
</clause>
|
2395
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2396
|
-
<title>Intro 2</title>
|
2397
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2398
|
-
<title>Intro 3</title>
|
2399
|
-
</clause>
|
2400
|
-
</clause>
|
2401
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2402
|
-
<title>Intro 4</title>
|
2403
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2404
|
-
<title>Intro 5</title>
|
2405
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2406
|
-
<title>Term1</title>
|
2407
|
-
</clause>
|
2408
|
-
</clause>
|
2409
|
-
</clause>
|
2410
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2411
|
-
<title>Normal Terms</title>
|
2412
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2413
|
-
<title>Term2</title>
|
2414
|
-
</clause>
|
2415
|
-
</clause>
|
2416
|
-
<definitions id='_' obligation='normative'>
|
2417
|
-
<title>Symbols and abbreviated terms</title>
|
2418
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2419
|
-
<title>General</title>
|
2420
|
-
</clause>
|
2421
|
-
<definitions id='_' type='symbols' obligation='normative'>
|
2422
|
-
<title>Symbols</title>
|
2423
|
-
</definitions>
|
2424
|
-
</definitions>
|
2425
|
-
</clause>
|
2426
|
-
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
2427
|
-
<title>Abbreviated terms</title>
|
2428
|
-
</definitions>
|
2429
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2430
|
-
<title>Clause 4</title>
|
2431
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2432
|
-
<title>Introduction</title>
|
2433
|
-
</clause>
|
2434
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2435
|
-
<title>Clause 4.2</title>
|
2436
|
-
</clause>
|
2437
|
-
</clause>
|
2438
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2439
|
-
<title>Terms and Definitions</title>
|
2440
|
-
</clause>
|
2441
|
-
</sections>
|
2442
|
-
<annex id='_' inline-header='false' obligation='normative'>
|
2443
|
-
<title>Annex</title>
|
2444
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2445
|
-
<title>Annex A.1</title>
|
2446
|
-
</clause>
|
2447
|
-
</annex>
|
2448
|
-
<bibliography>
|
2449
|
-
<references id='_' normative='true' obligation='informative'>
|
2450
|
-
<title>Normative references</title>
|
2451
|
-
<p id='_'>There are no normative references in this document.</p>
|
2452
|
-
</references>
|
2453
|
-
<references id='_' normative='false' obligation='informative'>
|
2454
|
-
<title>Bibliography</title>
|
2455
|
-
</references>
|
2456
|
-
<references id='_' normative='false' obligation='informative'>
|
2457
|
-
<title>Bibliography</title>
|
2458
|
-
</references>
|
2459
|
-
<clause id='_' obligation='informative'>
|
2460
|
-
<title>Bibliography</title>
|
2461
|
-
<references id='_' normative='false' obligation='informative'>
|
2462
|
-
<title>Bibliography Subsection</title>
|
2463
|
-
</references>
|
2464
|
-
</clause>
|
2465
|
-
</bibliography>
|
2466
|
-
</standard-document>
|
2467
|
-
OUTPUT
|
2468
|
-
end
|
2469
|
-
|
2470
|
-
it "processes section names, French" do
|
2471
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2472
|
-
#{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":language: fr\n:script: Latn\n:nodoc:")}
|
2473
|
-
.Foreword
|
2474
|
-
|
2475
|
-
Text
|
2476
|
-
|
2477
|
-
[abstract]
|
2478
|
-
== Abstract
|
2479
|
-
|
2480
|
-
Text
|
2481
|
-
|
2482
|
-
[heading=introduction]
|
2483
|
-
== Introduction
|
2484
|
-
|
2485
|
-
=== Introduction Subsection
|
2486
|
-
|
2487
|
-
[heading=acknowledgements]
|
2488
|
-
== Acknowledgements
|
2489
|
-
|
2490
|
-
[.preface]
|
2491
|
-
== Dedication
|
2492
|
-
|
2493
|
-
[heading=scope]
|
2494
|
-
== Scope
|
2495
|
-
|
2496
|
-
Text
|
2497
|
-
|
2498
|
-
[bibliography,heading=normative references]
|
2499
|
-
== Normative References
|
2500
|
-
|
2501
|
-
[bibliography,normative=true]
|
2502
|
-
== Normative References 2
|
2503
|
-
|
2504
|
-
[heading=terms and definitions]
|
2505
|
-
== Terms and Definitions
|
2506
|
-
|
2507
|
-
=== Term1
|
2508
|
-
|
2509
|
-
[heading="terms and definitions"]
|
2510
|
-
== Terms, Definitions, Symbols and Abbreviated Terms
|
2511
|
-
|
2512
|
-
[.nonterm]
|
2513
|
-
=== Introduction
|
2514
|
-
|
2515
|
-
==== Intro 1
|
2516
|
-
|
2517
|
-
=== Intro 2
|
2518
|
-
|
2519
|
-
[.nonterm]
|
2520
|
-
==== Intro 3
|
2521
|
-
|
2522
|
-
=== Intro 4
|
2523
|
-
|
2524
|
-
==== Intro 5
|
2525
|
-
|
2526
|
-
===== Term1
|
2527
|
-
|
2528
|
-
=== Normal Terms
|
2529
|
-
|
2530
|
-
==== Term2
|
2531
|
-
|
2532
|
-
[heading=symbols and abbreviated terms]
|
2533
|
-
=== Symbols and Abbreviated Terms
|
2534
|
-
|
2535
|
-
[.nonterm]
|
2536
|
-
==== General
|
2537
|
-
|
2538
|
-
[heading=symbols]
|
2539
|
-
==== Symbols 1
|
2540
|
-
|
2541
|
-
[heading=abbreviated terms]
|
2542
|
-
== Abbreviated Terms
|
2543
|
-
|
2544
|
-
== Clause 4
|
2545
|
-
|
2546
|
-
=== Introduction
|
2547
|
-
|
2548
|
-
=== Clause 4.2
|
2549
|
-
|
2550
|
-
== Terms and Definitions
|
2551
|
-
|
2552
|
-
[appendix]
|
2553
|
-
== Annex
|
2554
|
-
|
2555
|
-
=== Annex A.1
|
2556
|
-
|
2557
|
-
[bibliography,heading=bibliography]
|
2558
|
-
== Bibliography
|
2559
|
-
|
2560
|
-
[bibliography,normative=false]
|
2561
|
-
== Bibliography 2
|
2562
|
-
|
2563
|
-
=== Bibliography Subsection
|
2564
|
-
|
2565
|
-
INPUT
|
2566
|
-
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
2567
|
-
<bibdata type='standard'>
|
2568
|
-
<title language='en' format='text/plain'>Document title</title>
|
2569
|
-
<language>fr</language>
|
2570
|
-
<script>Latn</script>
|
2571
|
-
<abstract>
|
2572
|
-
<p>Text</p>
|
2573
|
-
</abstract>
|
2574
|
-
<status>
|
2575
|
-
<stage>published</stage>
|
2576
|
-
</status>
|
2577
|
-
<copyright>
|
2578
|
-
<from>2020</from>
|
2579
|
-
</copyright>
|
2580
|
-
<ext>
|
2581
|
-
<doctype>article</doctype>
|
2582
|
-
</ext>
|
2583
|
-
</bibdata>
|
2584
|
-
<preface>
|
2585
|
-
<abstract id='_'>
|
2586
|
-
<title>Résumé</title>
|
2587
|
-
<p id='_'>Text</p>
|
2588
|
-
</abstract>
|
2589
|
-
<foreword id='_' obligation='informative'>
|
2590
|
-
<title>Avant-propos</title>
|
2591
|
-
<p id='_'>Text</p>
|
2592
|
-
</foreword>
|
2593
|
-
<introduction id='_' obligation='informative'>
|
2594
|
-
<title>Introduction</title>
|
2595
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
2596
|
-
<title>Introduction Subsection</title>
|
2597
|
-
</clause>
|
2598
|
-
</introduction>
|
2599
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
2600
|
-
<title>Dedication</title>
|
2601
|
-
</clause>
|
2602
|
-
<acknowledgements id='_' obligation='informative'>
|
2603
|
-
<title>Remerciements</title>
|
2604
|
-
</acknowledgements>
|
2605
|
-
</preface>
|
2606
|
-
<sections>
|
2607
|
-
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
2608
|
-
<title>Domaine d’application</title>
|
2609
|
-
<p id='_'>Text</p>
|
2610
|
-
</clause>
|
2611
|
-
<terms id='_' obligation='normative'>
|
2612
|
-
<title>Terms et définitions</title>
|
2613
|
-
<p id='_'>
|
2614
|
-
Pour les besoins du présent document, les termes et définitions suivants
|
2615
|
-
s’appliquent.
|
2616
|
-
</p>
|
2617
|
-
<term id='_'>
|
2618
|
-
<preferred>Term1</preferred>
|
2619
|
-
</term>
|
2620
|
-
</terms>
|
2621
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2622
|
-
<title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
2623
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2624
|
-
<title>Introduction</title>
|
2625
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2626
|
-
<title>Intro 1</title>
|
2627
|
-
</clause>
|
2628
|
-
</clause>
|
2629
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2630
|
-
<title>Intro 2</title>
|
2631
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2632
|
-
<title>Intro 3</title>
|
2633
|
-
</clause>
|
2634
|
-
</clause>
|
2635
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2636
|
-
<title>Intro 4</title>
|
2637
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2638
|
-
<title>Intro 5</title>
|
2639
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2640
|
-
<title>Term1</title>
|
2641
|
-
</clause>
|
2642
|
-
</clause>
|
2643
|
-
</clause>
|
2644
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2645
|
-
<title>Normal Terms</title>
|
2646
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2647
|
-
<title>Term2</title>
|
2648
|
-
</clause>
|
2649
|
-
</clause>
|
2650
|
-
<definitions id='_' obligation='normative'>
|
2651
|
-
<title>Symboles et termes abrégés</title>
|
2652
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2653
|
-
<title>General</title>
|
2654
|
-
</clause>
|
2655
|
-
<definitions id='_' type='symbols' obligation='normative'>
|
2656
|
-
<title>Symboles</title>
|
2657
|
-
</definitions>
|
2658
|
-
</definitions>
|
2659
|
-
</clause>
|
2660
|
-
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
2661
|
-
<title>Termes abrégés</title>
|
2662
|
-
</definitions>
|
2663
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2664
|
-
<title>Clause 4</title>
|
2665
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2666
|
-
<title>Introduction</title>
|
2667
|
-
</clause>
|
2668
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2669
|
-
<title>Clause 4.2</title>
|
2670
|
-
</clause>
|
2671
|
-
</clause>
|
2672
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2673
|
-
<title>Terms and Definitions</title>
|
2674
|
-
</clause>
|
2675
|
-
</sections>
|
2676
|
-
<annex id='_' inline-header='false' obligation='normative'>
|
2677
|
-
<title>Annex</title>
|
2678
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2679
|
-
<title>Annex A.1</title>
|
2680
|
-
</clause>
|
2681
|
-
</annex>
|
2682
|
-
<bibliography>
|
2683
|
-
<references id='_' normative='true' obligation='informative'>
|
2684
|
-
<title>Références normatives</title>
|
2685
|
-
<p id='_'>Le présent document ne contient aucune référence normative.</p>
|
2686
|
-
</references>
|
2687
|
-
<references id='_' normative='false' obligation='informative'>
|
2688
|
-
<title>Bibliographie</title>
|
2689
|
-
</references>
|
2690
|
-
<references id='_' normative='false' obligation='informative'>
|
2691
|
-
<title>Bibliography</title>
|
2692
|
-
</references>
|
2693
|
-
<clause id='_' obligation='informative'>
|
2694
|
-
<title>Bibliography</title>
|
2695
|
-
<references id='_' normative='false' obligation='informative'>
|
2696
|
-
<title>Bibliography Subsection</title>
|
2697
|
-
</references>
|
2698
|
-
</clause>
|
2699
|
-
</bibliography>
|
2700
|
-
</standard-document>
|
2701
|
-
OUTPUT
|
2702
|
-
end
|
2703
|
-
|
2704
|
-
it "processes section names, Simplified Chinese" do
|
2705
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2706
|
-
#{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":language: zh\n:script: Hans\n:nodoc:")}
|
2707
|
-
.Foreword
|
2708
|
-
|
2709
|
-
Text
|
2710
|
-
|
2711
|
-
[abstract]
|
2712
|
-
== Abstract
|
2713
|
-
|
2714
|
-
Text
|
2715
|
-
|
2716
|
-
[heading=introduction]
|
2717
|
-
== Introduction
|
2718
|
-
|
2719
|
-
=== Introduction Subsection
|
2720
|
-
|
2721
|
-
[heading=acknowledgements]
|
2722
|
-
== Acknowledgements
|
2723
|
-
|
2724
|
-
[.preface]
|
2725
|
-
== Dedication
|
2726
|
-
|
2727
|
-
[heading=scope]
|
2728
|
-
== Scope
|
2729
|
-
|
2730
|
-
Text
|
2731
|
-
|
2732
|
-
[bibliography,heading=normative references]
|
2733
|
-
== Normative References
|
2734
|
-
|
2735
|
-
[bibliography,normative=true]
|
2736
|
-
== Normative References 2
|
2737
|
-
|
2738
|
-
[heading=terms and definitions]
|
2739
|
-
== Terms and Definitions
|
2740
|
-
|
2741
|
-
=== Term1
|
2742
|
-
|
2743
|
-
[heading="terms and definitions"]
|
2744
|
-
== Terms, Definitions, Symbols and Abbreviated Terms
|
2745
|
-
|
2746
|
-
[.nonterm]
|
2747
|
-
=== Introduction
|
2748
|
-
|
2749
|
-
==== Intro 1
|
2750
|
-
|
2751
|
-
=== Intro 2
|
2752
|
-
|
2753
|
-
[.nonterm]
|
2754
|
-
==== Intro 3
|
2755
|
-
|
2756
|
-
=== Intro 4
|
2757
|
-
|
2758
|
-
==== Intro 5
|
2759
|
-
|
2760
|
-
===== Term1
|
2761
|
-
|
2762
|
-
=== Normal Terms
|
2763
|
-
|
2764
|
-
==== Term2
|
2765
|
-
|
2766
|
-
[heading=symbols and abbreviated terms]
|
2767
|
-
=== Symbols and Abbreviated Terms
|
2768
|
-
|
2769
|
-
[.nonterm]
|
2770
|
-
==== General
|
2771
|
-
|
2772
|
-
[heading=symbols]
|
2773
|
-
==== Symbols 1
|
2774
|
-
|
2775
|
-
[heading=abbreviated terms]
|
2776
|
-
== Abbreviated Terms
|
2777
|
-
|
2778
|
-
== Clause 4
|
2779
|
-
|
2780
|
-
=== Introduction
|
2781
|
-
|
2782
|
-
=== Clause 4.2
|
2783
|
-
|
2784
|
-
== Terms and Definitions
|
2785
|
-
|
2786
|
-
[appendix]
|
2787
|
-
== Annex
|
2788
|
-
|
2789
|
-
=== Annex A.1
|
2790
|
-
|
2791
|
-
[bibliography,heading=bibliography]
|
2792
|
-
== Bibliography
|
2793
|
-
|
2794
|
-
[bibliography,normative=false]
|
2795
|
-
== Bibliography 2
|
2796
|
-
|
2797
|
-
=== Bibliography Subsection
|
2798
|
-
|
2799
|
-
INPUT
|
2800
|
-
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
2801
|
-
<bibdata type='standard'>
|
2802
|
-
<title language='en' format='text/plain'>Document title</title>
|
2803
|
-
<language>zh</language>
|
2804
|
-
<script>Hans</script>
|
2805
|
-
<abstract>
|
2806
|
-
<p>Text</p>
|
2807
|
-
</abstract>
|
2808
|
-
<status>
|
2809
|
-
<stage>published</stage>
|
2810
|
-
</status>
|
2811
|
-
<copyright>
|
2812
|
-
<from>2020</from>
|
2813
|
-
</copyright>
|
2814
|
-
<ext>
|
2815
|
-
<doctype>article</doctype>
|
2816
|
-
</ext>
|
2817
|
-
</bibdata>
|
2818
|
-
<preface>
|
2819
|
-
<abstract id='_'>
|
2820
|
-
<title>摘要</title>
|
2821
|
-
<p id='_'>Text</p>
|
2822
|
-
</abstract>
|
2823
|
-
<foreword id='_' obligation='informative'>
|
2824
|
-
<title>前言</title>
|
2825
|
-
<p id='_'>Text</p>
|
2826
|
-
</foreword>
|
2827
|
-
<introduction id='_' obligation='informative'>
|
2828
|
-
<title>引言</title>
|
2829
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
2830
|
-
<title>Introduction Subsection</title>
|
2831
|
-
</clause>
|
2832
|
-
</introduction>
|
2833
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
2834
|
-
<title>Dedication</title>
|
2835
|
-
</clause>
|
2836
|
-
<acknowledgements id='_' obligation='informative'>
|
2837
|
-
<title>致謝</title>
|
2838
|
-
</acknowledgements>
|
2839
|
-
</preface>
|
2840
|
-
<sections>
|
2841
|
-
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
2842
|
-
<title>范围</title>
|
2843
|
-
<p id='_'>Text</p>
|
2844
|
-
</clause>
|
2845
|
-
<terms id='_' obligation='normative'>
|
2846
|
-
<title>术语和定义</title>
|
2847
|
-
<p id='_'>下列术语和定义适用于本文件。</p>
|
2848
|
-
<term id='_'>
|
2849
|
-
<preferred>Term1</preferred>
|
2850
|
-
</term>
|
2851
|
-
</terms>
|
2852
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2853
|
-
<title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
2854
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2855
|
-
<title>Introduction</title>
|
2856
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2857
|
-
<title>Intro 1</title>
|
2858
|
-
</clause>
|
2859
|
-
</clause>
|
2860
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2861
|
-
<title>Intro 2</title>
|
2862
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2863
|
-
<title>Intro 3</title>
|
2864
|
-
</clause>
|
2865
|
-
</clause>
|
2866
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2867
|
-
<title>Intro 4</title>
|
2868
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2869
|
-
<title>Intro 5</title>
|
2870
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2871
|
-
<title>Term1</title>
|
2872
|
-
</clause>
|
2873
|
-
</clause>
|
2874
|
-
</clause>
|
2875
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2876
|
-
<title>Normal Terms</title>
|
2877
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2878
|
-
<title>Term2</title>
|
2879
|
-
</clause>
|
2880
|
-
</clause>
|
2881
|
-
<definitions id='_' obligation='normative'>
|
2882
|
-
<title>符号、代号和缩略语</title>
|
2883
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2884
|
-
<title>General</title>
|
2885
|
-
</clause>
|
2886
|
-
<definitions id='_' type='symbols' obligation='normative'>
|
2887
|
-
<title>符号</title>
|
2888
|
-
</definitions>
|
2889
|
-
</definitions>
|
2890
|
-
</clause>
|
2891
|
-
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
2892
|
-
<title>代号和缩略语</title>
|
2893
|
-
</definitions>
|
2894
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2895
|
-
<title>Clause 4</title>
|
2896
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2897
|
-
<title>Introduction</title>
|
2898
|
-
</clause>
|
2899
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2900
|
-
<title>Clause 4.2</title>
|
2901
|
-
</clause>
|
2902
|
-
</clause>
|
2903
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2904
|
-
<title>Terms and Definitions</title>
|
2905
|
-
</clause>
|
2906
|
-
</sections>
|
2907
|
-
<annex id='_' inline-header='false' obligation='normative'>
|
2908
|
-
<title>Annex</title>
|
2909
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
2910
|
-
<title>Annex A.1</title>
|
2911
|
-
</clause>
|
2912
|
-
</annex>
|
2913
|
-
<bibliography>
|
2914
|
-
<references id='_' normative='true' obligation='informative'>
|
2915
|
-
<title>规范性引用文件</title>
|
2916
|
-
<p id='_'>本文件并没有规范性引用文件。</p>
|
2917
|
-
</references>
|
2918
|
-
<references id='_' normative='false' obligation='informative'>
|
2919
|
-
<title>参考文献</title>
|
2920
|
-
</references>
|
2921
|
-
<references id='_' normative='false' obligation='informative'>
|
2922
|
-
<title>Bibliography</title>
|
2923
|
-
</references>
|
2924
|
-
<clause id='_' obligation='informative'>
|
2925
|
-
<title>Bibliography</title>
|
2926
|
-
<references id='_' normative='false' obligation='informative'>
|
2927
|
-
<title>Bibliography Subsection</title>
|
2928
|
-
</references>
|
2929
|
-
</clause>
|
2930
|
-
</bibliography>
|
2931
|
-
</standard-document>
|
2932
|
-
OUTPUT
|
2933
|
-
end
|
2934
|
-
|
2935
|
-
it "processes section names, internationalisation file" do
|
2936
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2937
|
-
#{ASCIIDOC_BLANK_HDR.sub(/:nodoc:/, ":i18nyaml: spec/assets/i18n.yaml")}
|
2938
|
-
.Foreword
|
2939
|
-
|
2940
|
-
Text
|
2941
|
-
|
2942
|
-
[abstract]
|
2943
|
-
== Abstract
|
2944
|
-
|
2945
|
-
Text
|
2946
|
-
|
2947
|
-
[heading=introduction]
|
2948
|
-
== Introduction
|
2949
|
-
|
2950
|
-
=== Introduction Subsection
|
2951
|
-
|
2952
|
-
[heading=acknowledgements]
|
2953
|
-
== Acknowledgements
|
2954
|
-
|
2955
|
-
[.preface]
|
2956
|
-
== Dedication
|
2957
|
-
|
2958
|
-
[heading=scope]
|
2959
|
-
== Scope
|
2960
|
-
|
2961
|
-
Text
|
2962
|
-
|
2963
|
-
[bibliography,heading=normative references]
|
2964
|
-
== Normative References
|
2965
|
-
|
2966
|
-
[bibliography,normative=true]
|
2967
|
-
== Normative References 2
|
2968
|
-
|
2969
|
-
[heading=terms and definitions]
|
2970
|
-
== Terms and Definitions
|
2971
|
-
|
2972
|
-
=== Term1
|
2973
|
-
|
2974
|
-
[heading="terms and definitions"]
|
2975
|
-
== Terms, Definitions, Symbols and Abbreviated Terms
|
2976
|
-
|
2977
|
-
[.nonterm]
|
2978
|
-
=== Introduction
|
2979
|
-
|
2980
|
-
==== Intro 1
|
2981
|
-
|
2982
|
-
=== Intro 2
|
2983
|
-
|
2984
|
-
[.nonterm]
|
2985
|
-
==== Intro 3
|
2986
|
-
|
2987
|
-
=== Intro 4
|
2988
|
-
|
2989
|
-
==== Intro 5
|
2990
|
-
|
2991
|
-
===== Term1
|
2992
|
-
|
2993
|
-
=== Normal Terms
|
2994
|
-
|
2995
|
-
==== Term2
|
2996
|
-
|
2997
|
-
[heading=symbols and abbreviated terms]
|
2998
|
-
=== Symbols and Abbreviated Terms
|
2999
|
-
|
3000
|
-
[.nonterm]
|
3001
|
-
==== General
|
3002
|
-
|
3003
|
-
[heading=symbols]
|
3004
|
-
==== Symbols 1
|
3005
|
-
|
3006
|
-
[heading=abbreviated terms]
|
3007
|
-
== Abbreviated Terms
|
3008
|
-
|
3009
|
-
== Clause 4
|
3010
|
-
|
3011
|
-
=== Introduction
|
3012
|
-
|
3013
|
-
=== Clause 4.2
|
3014
|
-
|
3015
|
-
== Terms and Definitions
|
3016
|
-
|
3017
|
-
[appendix]
|
3018
|
-
== Annex
|
3019
|
-
|
3020
|
-
=== Annex A.1
|
3021
|
-
|
3022
|
-
[bibliography,heading=bibliography]
|
3023
|
-
== Bibliography
|
3024
|
-
|
3025
|
-
[bibliography,normative=false]
|
3026
|
-
== Bibliography 2
|
3027
|
-
|
3028
|
-
=== Bibliography Subsection
|
3029
|
-
|
3030
|
-
INPUT
|
3031
|
-
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
3032
|
-
<bibdata type='standard'>
|
3033
|
-
<title language='en' format='text/plain'>Document title</title>
|
3034
|
-
<language>en</language>
|
3035
|
-
<script>Latn</script>
|
3036
|
-
<abstract>
|
3037
|
-
<p>Text</p>
|
3038
|
-
</abstract>
|
3039
|
-
<status>
|
3040
|
-
<stage>published</stage>
|
3041
|
-
</status>
|
3042
|
-
<copyright>
|
3043
|
-
<from>2020</from>
|
3044
|
-
</copyright>
|
3045
|
-
<ext>
|
3046
|
-
<doctype>article</doctype>
|
3047
|
-
</ext>
|
3048
|
-
</bibdata>
|
3049
|
-
<preface>
|
3050
|
-
<abstract id='_'>
|
3051
|
-
<title>Abstract</title>
|
3052
|
-
<p id='_'>Text</p>
|
3053
|
-
</abstract>
|
3054
|
-
<foreword id='_' obligation='informative'>
|
3055
|
-
<title>Antaŭparolo</title>
|
3056
|
-
<p id='_'>Text</p>
|
3057
|
-
</foreword>
|
3058
|
-
<introduction id='_' obligation='informative'>
|
3059
|
-
<title>Enkonduko</title>
|
3060
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
3061
|
-
<title>Introduction Subsection</title>
|
3062
|
-
</clause>
|
3063
|
-
</introduction>
|
3064
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
3065
|
-
<title>Dedication</title>
|
3066
|
-
</clause>
|
3067
|
-
<acknowledgements id='_' obligation='informative'>
|
3068
|
-
<title>Acknowledgements</title>
|
3069
|
-
</acknowledgements>
|
3070
|
-
</preface>
|
3071
|
-
<sections>
|
3072
|
-
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
3073
|
-
<title>Amplekso</title>
|
3074
|
-
<p id='_'>Text</p>
|
3075
|
-
</clause>
|
3076
|
-
<terms id='_' obligation='normative'>
|
3077
|
-
<title>Terms and definitions</title>
|
3078
|
-
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
3079
|
-
<term id='_'>
|
3080
|
-
<preferred>Term1</preferred>
|
3081
|
-
</term>
|
3082
|
-
</terms>
|
3083
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
3084
|
-
<title>Terms, Definitions, Symbols and Abbreviated Terms</title>
|
3085
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
3086
|
-
<title>Introduction</title>
|
3087
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
3088
|
-
<title>Intro 1</title>
|
3089
|
-
</clause>
|
3090
|
-
</clause>
|
3091
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
3092
|
-
<title>Intro 2</title>
|
3093
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
3094
|
-
<title>Intro 3</title>
|
3095
|
-
</clause>
|
3096
|
-
</clause>
|
3097
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
3098
|
-
<title>Intro 4</title>
|
3099
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
3100
|
-
<title>Intro 5</title>
|
3101
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
3102
|
-
<title>Term1</title>
|
3103
|
-
</clause>
|
3104
|
-
</clause>
|
3105
|
-
</clause>
|
3106
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
3107
|
-
<title>Normal Terms</title>
|
3108
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
3109
|
-
<title>Term2</title>
|
3110
|
-
</clause>
|
3111
|
-
</clause>
|
3112
|
-
<definitions id='_' obligation='normative'>
|
3113
|
-
<title>Symbols and abbreviated terms</title>
|
3114
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
3115
|
-
<title>General</title>
|
3116
|
-
</clause>
|
3117
|
-
<definitions id='_' type='symbols' obligation='normative'>
|
3118
|
-
<title>Simboloj kai mallongigitaj terminoj</title>
|
3119
|
-
</definitions>
|
3120
|
-
</definitions>
|
3121
|
-
</clause>
|
3122
|
-
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
3123
|
-
<title>Abbreviated terms</title>
|
3124
|
-
</definitions>
|
3125
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
3126
|
-
<title>Clause 4</title>
|
3127
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
3128
|
-
<title>Introduction</title>
|
3129
|
-
</clause>
|
3130
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
3131
|
-
<title>Clause 4.2</title>
|
3132
|
-
</clause>
|
3133
|
-
</clause>
|
3134
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
3135
|
-
<title>Terms and Definitions</title>
|
3136
|
-
</clause>
|
3137
|
-
</sections>
|
3138
|
-
<annex id='_' inline-header='false' obligation='normative'>
|
3139
|
-
<title>Annex</title>
|
3140
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
3141
|
-
<title>Annex A.1</title>
|
3142
|
-
</clause>
|
3143
|
-
</annex>
|
3144
|
-
<bibliography>
|
3145
|
-
<references id='_' normative='true' obligation='informative'>
|
3146
|
-
<title>Normaj citaĵoj</title>
|
3147
|
-
<p id='_'>There are no normative references in this document.</p>
|
3148
|
-
</references>
|
3149
|
-
<references id='_' normative='false' obligation='informative'>
|
3150
|
-
<title>Bibliografio</title>
|
3151
|
-
</references>
|
3152
|
-
<references id='_' normative='false' obligation='informative'>
|
3153
|
-
<title>Bibliography</title>
|
3154
|
-
</references>
|
3155
|
-
<clause id='_' obligation='informative'>
|
3156
|
-
<title>Bibliography</title>
|
3157
|
-
<references id='_' normative='false' obligation='informative'>
|
3158
|
-
<title>Bibliography Subsection</title>
|
3159
|
-
</references>
|
3160
|
-
</clause>
|
3161
|
-
</bibliography>
|
3162
|
-
</standard-document>
|
3163
|
-
OUTPUT
|
3164
|
-
end
|
3165
|
-
|
3166
|
-
it "fixes illegal anchors" do
|
3167
|
-
input = <<~INPUT
|
3168
|
-
#{ASCIIDOC_BLANK_HDR}
|
3169
|
-
|
3170
|
-
[[a:b]]
|
3171
|
-
== A
|
3172
|
-
<</:ab>>
|
3173
|
-
<<:>>
|
3174
|
-
<<1>>
|
3175
|
-
<<1:>>
|
3176
|
-
<<1#b>>
|
3177
|
-
<<:a#b:>>
|
1859
|
+
[[a:b]]
|
1860
|
+
== A
|
1861
|
+
<</:ab>>
|
1862
|
+
<<:>>
|
1863
|
+
<<1>>
|
1864
|
+
<<1:>>
|
1865
|
+
<<1#b>>
|
1866
|
+
<<:a#b:>>
|
3178
1867
|
|
3179
1868
|
INPUT
|
3180
1869
|
expect(xmlpp(Asciidoctor.convert(input, backend: :standoc, header_footer: true).gsub(/<p id="_[^"]+">/, "").gsub('</p>', ""))).to be_equivalent_to (<<~"OUTPUT")
|
@@ -3214,9 +1903,216 @@ expect{Asciidoctor.convert(input, backend: :standoc, header_footer: true)}.to ou
|
|
3214
1903
|
expect{Asciidoctor.convert(input, backend: :standoc, header_footer: true)}.to output(%r{normalised identifier in <xref target="_a#b_"/> from :a#b:}).to_stderr
|
3215
1904
|
end
|
3216
1905
|
|
1906
|
+
it "moves title footnotes to bibdata" do
|
1907
|
+
input = <<~INPUT
|
1908
|
+
= Document title footnote:[ABC] footnote:[DEF]
|
1909
|
+
Author
|
1910
|
+
:docfile: test.adoc
|
1911
|
+
:nodoc:
|
1912
|
+
:novalid:
|
1913
|
+
:no-isobib:
|
1914
|
+
|
1915
|
+
INPUT
|
1916
|
+
expect(xmlpp(Asciidoctor.convert(input, backend: :standoc, header_footer: true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1917
|
+
<standard-document xmlns='https://www.metanorma.org/ns/standoc' type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
1918
|
+
<bibdata type='standard'>
|
1919
|
+
<title language='en' format='text/plain'>Document title</title>
|
1920
|
+
<note type='title-footnote'>
|
1921
|
+
<p>ABC</p>
|
1922
|
+
</note>
|
1923
|
+
<note type='title-footnote'>
|
1924
|
+
<p>DEF</p>
|
1925
|
+
</note>
|
1926
|
+
<language>en</language>
|
1927
|
+
<script>Latn</script>
|
1928
|
+
<status>
|
1929
|
+
<stage>published</stage>
|
1930
|
+
</status>
|
1931
|
+
<copyright>
|
1932
|
+
<from>2020</from>
|
1933
|
+
</copyright>
|
1934
|
+
<ext>
|
1935
|
+
<doctype>article</doctype>
|
1936
|
+
</ext>
|
1937
|
+
</bibdata>
|
1938
|
+
<sections> </sections>
|
1939
|
+
</standard-document>
|
1940
|
+
OUTPUT
|
1941
|
+
|
1942
|
+
end
|
1943
|
+
it "customises italicisation of MathML" do
|
1944
|
+
input = <<~INPUT
|
1945
|
+
= Document title
|
1946
|
+
Author
|
1947
|
+
:stem:
|
1948
|
+
|
1949
|
+
[stem]
|
1950
|
+
++++
|
1951
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1952
|
+
<mi>A</mi>
|
1953
|
+
<mo>+</mo>
|
1954
|
+
<mi>a</mi>
|
1955
|
+
<mo>+</mo>
|
1956
|
+
<mi>Α</mi>
|
1957
|
+
<mo>+</mo>
|
1958
|
+
<mi>α</mi>
|
1959
|
+
<mo>+</mo>
|
1960
|
+
<mi>AB</mi>
|
1961
|
+
<mstyle mathvariant="italic">
|
1962
|
+
<mrow>
|
1963
|
+
<mi>Α</mi>
|
1964
|
+
</mrow>
|
1965
|
+
</mstyle>
|
1966
|
+
</math>
|
1967
|
+
++++
|
1968
|
+
INPUT
|
1969
|
+
|
1970
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1971
|
+
#{BLANK_HDR}
|
1972
|
+
<sections>
|
1973
|
+
<formula id='_'>
|
1974
|
+
<stem type='MathML'>
|
1975
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1976
|
+
<mi>A</mi>
|
1977
|
+
<mo>+</mo>
|
1978
|
+
<mi>a</mi>
|
1979
|
+
<mo>+</mo>
|
1980
|
+
<mi>Α</mi>
|
1981
|
+
<mo>+</mo>
|
1982
|
+
<mi>α</mi>
|
1983
|
+
<mo>+</mo>
|
1984
|
+
<mi>AB</mi>
|
1985
|
+
<mstyle mathvariant='italic'>
|
1986
|
+
<mrow>
|
1987
|
+
<mi>Α</mi>
|
1988
|
+
</mrow>
|
1989
|
+
</mstyle>
|
1990
|
+
</math>
|
1991
|
+
</stem>
|
1992
|
+
</formula>
|
1993
|
+
</sections>
|
1994
|
+
</standard-document>
|
1995
|
+
OUTPUT
|
1996
|
+
mock_mathml_italicise({ uppergreek: false, upperroman: true, lowergreek: true, lowerroman: true })
|
1997
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1998
|
+
#{BLANK_HDR}
|
1999
|
+
<sections>
|
2000
|
+
<formula id='_'>
|
2001
|
+
<stem type='MathML'>
|
2002
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
2003
|
+
<mi>A</mi>
|
2004
|
+
<mo>+</mo>
|
2005
|
+
<mi>a</mi>
|
2006
|
+
<mo>+</mo>
|
2007
|
+
<mi mathvariant="normal">Α</mi>
|
2008
|
+
<mo>+</mo>
|
2009
|
+
<mi>α</mi>
|
2010
|
+
<mo>+</mo>
|
2011
|
+
<mi>AB</mi>
|
2012
|
+
<mstyle mathvariant='italic'>
|
2013
|
+
<mrow>
|
2014
|
+
<mi>Α</mi>
|
2015
|
+
</mrow>
|
2016
|
+
</mstyle>
|
2017
|
+
</math>
|
2018
|
+
</stem>
|
2019
|
+
</formula>
|
2020
|
+
</sections>
|
2021
|
+
</standard-document>
|
2022
|
+
OUTPUT
|
2023
|
+
mock_mathml_italicise({ uppergreek: true, upperroman: false, lowergreek: true, lowerroman: true })
|
2024
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2025
|
+
#{BLANK_HDR}
|
2026
|
+
<sections>
|
2027
|
+
<formula id='_'>
|
2028
|
+
<stem type='MathML'>
|
2029
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
2030
|
+
<mi mathvariant="normal">A</mi>
|
2031
|
+
<mo>+</mo>
|
2032
|
+
<mi>a</mi>
|
2033
|
+
<mo>+</mo>
|
2034
|
+
<mi>Α</mi>
|
2035
|
+
<mo>+</mo>
|
2036
|
+
<mi>α</mi>
|
2037
|
+
<mo>+</mo>
|
2038
|
+
<mi>AB</mi>
|
2039
|
+
<mstyle mathvariant='italic'>
|
2040
|
+
<mrow>
|
2041
|
+
<mi>Α</mi>
|
2042
|
+
</mrow>
|
2043
|
+
</mstyle>
|
2044
|
+
</math>
|
2045
|
+
</stem>
|
2046
|
+
</formula>
|
2047
|
+
</sections>
|
2048
|
+
</standard-document>
|
2049
|
+
OUTPUT
|
2050
|
+
mock_mathml_italicise({ uppergreek: true, upperroman: true, lowergreek: false, lowerroman: true })
|
2051
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2052
|
+
#{BLANK_HDR}
|
2053
|
+
<sections>
|
2054
|
+
<formula id='_'>
|
2055
|
+
<stem type='MathML'>
|
2056
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
2057
|
+
<mi>A</mi>
|
2058
|
+
<mo>+</mo>
|
2059
|
+
<mi>a</mi>
|
2060
|
+
<mo>+</mo>
|
2061
|
+
<mi>Α</mi>
|
2062
|
+
<mo>+</mo>
|
2063
|
+
<mi mathvariant="normal">α</mi>
|
2064
|
+
<mo>+</mo>
|
2065
|
+
<mi>AB</mi>
|
2066
|
+
<mstyle mathvariant='italic'>
|
2067
|
+
<mrow>
|
2068
|
+
<mi>Α</mi>
|
2069
|
+
</mrow>
|
2070
|
+
</mstyle>
|
2071
|
+
</math>
|
2072
|
+
</stem>
|
2073
|
+
</formula>
|
2074
|
+
</sections>
|
2075
|
+
</standard-document>
|
2076
|
+
OUTPUT
|
2077
|
+
mock_mathml_italicise({ uppergreek: true, upperroman: true, lowergreek: true, lowerroman: false })
|
2078
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
2079
|
+
#{BLANK_HDR}
|
2080
|
+
<sections>
|
2081
|
+
<formula id='_'>
|
2082
|
+
<stem type='MathML'>
|
2083
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
2084
|
+
<mi>A</mi>
|
2085
|
+
<mo>+</mo>
|
2086
|
+
<mi mathvariant="normal">a</mi>
|
2087
|
+
<mo>+</mo>
|
2088
|
+
<mi>Α</mi>
|
2089
|
+
<mo>+</mo>
|
2090
|
+
<mi>α</mi>
|
2091
|
+
<mo>+</mo>
|
2092
|
+
<mi>AB</mi>
|
2093
|
+
<mstyle mathvariant='italic'>
|
2094
|
+
<mrow>
|
2095
|
+
<mi>Α</mi>
|
2096
|
+
</mrow>
|
2097
|
+
</mstyle>
|
2098
|
+
</math>
|
2099
|
+
</stem>
|
2100
|
+
</formula>
|
2101
|
+
</sections>
|
2102
|
+
</standard-document>
|
2103
|
+
OUTPUT
|
2104
|
+
mock_mathml_italicise({ uppergreek: true, upperroman: true, lowergreek: true, lowerroman: true })
|
2105
|
+
|
2106
|
+
|
2107
|
+
end
|
3217
2108
|
|
3218
2109
|
private
|
3219
2110
|
|
2111
|
+
def mock_mathml_italicise(x)
|
2112
|
+
allow_any_instance_of(::Asciidoctor::Standoc::Cleanup).to receive(:mathml_mi_italics).and_return(x)
|
2113
|
+
end
|
2114
|
+
|
2115
|
+
|
3220
2116
|
def mock_iecbib_get_iec60050_103_01
|
3221
2117
|
expect(Iecbib::IecBibliography).to receive(:get).with("IEC 60050-103", nil, {keep_year: true}) do
|
3222
2118
|
IsoBibItem::XMLParser.from_xml(<<~"OUTPUT")
|