metanorma-standoc 1.11.1 → 1.11.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/standoc/blocks.rb +1 -1
- data/lib/asciidoctor/standoc/cleanup.rb +1 -1
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +28 -20
- data/lib/asciidoctor/standoc/cleanup_ref_dl.rb +25 -15
- data/lib/asciidoctor/standoc/cleanup_section_names.rb +2 -2
- data/lib/asciidoctor/standoc/cleanup_terms.rb +23 -19
- data/lib/asciidoctor/standoc/cleanup_terms_designations.rb +31 -14
- data/lib/asciidoctor/standoc/datamodel/attributes_table_preprocessor.rb +6 -6
- data/lib/asciidoctor/standoc/inline.rb +13 -11
- data/lib/asciidoctor/standoc/isodoc.rng +42 -17
- data/lib/asciidoctor/standoc/ref.rb +101 -75
- data/lib/asciidoctor/standoc/ref_date_id.rb +30 -1
- data/lib/asciidoctor/standoc/ref_sect.rb +16 -6
- data/lib/asciidoctor/standoc/reqt.rb +1 -1
- data/lib/asciidoctor/standoc/section.rb +1 -1
- data/lib/asciidoctor/standoc/validate.rb +1 -1
- data/lib/isodoc/html/htmlstyle.css +1 -1
- data/lib/isodoc/html/htmlstyle.scss +1 -1
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +2 -2
- data/spec/asciidoctor/blocks_spec.rb +15 -15
- data/spec/asciidoctor/cleanup_sections_spec.rb +1 -1
- data/spec/asciidoctor/cleanup_spec.rb +4 -4
- data/spec/asciidoctor/cleanup_terms_spec.rb +248 -63
- data/spec/asciidoctor/datamodel/attributes_table_preprocessor_spec.rb +21 -21
- data/spec/asciidoctor/datamodel/diagram_preprocessor_spec.rb +16 -16
- data/spec/asciidoctor/inline_spec.rb +5 -5
- data/spec/asciidoctor/isobib_cache_spec.rb +4 -8
- data/spec/asciidoctor/macros_spec.rb +2 -2
- data/spec/asciidoctor/refs_spec.rb +842 -664
- data/spec/asciidoctor/section_spec.rb +2 -2
- data/spec/spec_helper.rb +0 -1
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +176 -176
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +12 -12
- data/spec/vcr_cassettes/isobib_get_123.yml +12 -12
- data/spec/vcr_cassettes/isobib_get_123_1.yml +24 -24
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +34 -34
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +11 -11
- data/spec/vcr_cassettes/isobib_get_124.yml +13 -13
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +14 -14
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +46 -46
- metadata +5 -5
@@ -15,11 +15,12 @@ RSpec.describe Asciidoctor::Standoc do
|
|
15
15
|
script:: Latn
|
16
16
|
type:: prefix
|
17
17
|
isInternational:: true
|
18
|
-
|
18
|
+
abbreviation-type:: acronym
|
19
19
|
pronunciation:: fəɹst
|
20
20
|
domain:: Hydraulics
|
21
21
|
subject:: pipes
|
22
|
-
|
22
|
+
field-of-application:: Field
|
23
|
+
usage-info:: This is usage.
|
23
24
|
|
24
25
|
[.source]
|
25
26
|
<<ISO2191,section=1>>
|
@@ -32,7 +33,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
32
33
|
type:: suffix
|
33
34
|
domain:: Hydraulics1
|
34
35
|
subject: pipes1
|
35
|
-
|
36
|
+
usage-info:: This is usage 1.
|
36
37
|
absent:: true
|
37
38
|
|
38
39
|
deprecated:[Fourth Designation]
|
@@ -41,12 +42,14 @@ RSpec.describe Asciidoctor::Standoc do
|
|
41
42
|
language:: jp
|
42
43
|
script:: Japn
|
43
44
|
type:: full
|
45
|
+
field-of-application:: Field
|
44
46
|
grammar::
|
45
47
|
gender::: masculine, feminine
|
48
|
+
number::: singular, plural
|
46
49
|
isPreposition::: false
|
47
50
|
isNoun::: true
|
48
|
-
|
49
|
-
|
51
|
+
grammar-value::: irregular declension
|
52
|
+
geographic-area:: AUS
|
50
53
|
|
51
54
|
related:see[<<second>>,Fifth Designation]
|
52
55
|
|
@@ -55,7 +58,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
55
58
|
grammar::
|
56
59
|
gender::: neuter
|
57
60
|
isVerb::: true
|
58
|
-
|
61
|
+
geographic-area:: GRC
|
59
62
|
|
60
63
|
[.source]
|
61
64
|
<<ISO2191,section=2>>
|
@@ -69,7 +72,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
69
72
|
=== Second Term
|
70
73
|
|
71
74
|
[%metadata]
|
72
|
-
|
75
|
+
usage-info::
|
73
76
|
+
|
74
77
|
--
|
75
78
|
Usage Info 1.
|
@@ -88,9 +91,11 @@ RSpec.describe Asciidoctor::Standoc do
|
|
88
91
|
<preferred language='fr' script='Latn' type='prefix' isInternational="true">
|
89
92
|
<expression>
|
90
93
|
<name>First Designation</name>
|
91
|
-
<
|
94
|
+
<abbreviation-type>acronym</abbreviation-type>
|
92
95
|
<pronunciation>fəɹst</pronunciation>
|
93
96
|
</expression>
|
97
|
+
<field-of-application>Field</field-of-application>
|
98
|
+
<usage-info>This is usage.</usage-info>
|
94
99
|
<termsource status='identical' type='authoritative'>
|
95
100
|
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
96
101
|
<localityStack>
|
@@ -105,21 +110,25 @@ RSpec.describe Asciidoctor::Standoc do
|
|
105
110
|
<expression>
|
106
111
|
<name>Third Designation</name>
|
107
112
|
</expression>
|
113
|
+
<usage-info>This is usage 1.</usage-info>
|
108
114
|
</admitted>
|
109
|
-
<deprecates language='jp' script='Japn' type='full'
|
115
|
+
<deprecates language='jp' script='Japn' type='full' geographic-area="AUS">
|
110
116
|
<expression>
|
111
117
|
<name>Fourth Designation</name>
|
112
118
|
<grammar>
|
113
119
|
<gender>masculine</gender>
|
114
120
|
<gender>feminine</gender>
|
121
|
+
<number>singular</number>
|
122
|
+
<number>plural</number>
|
115
123
|
<isPreposition>false</isPreposition>
|
116
124
|
<isNoun>true</isNoun>
|
117
|
-
<
|
125
|
+
<grammar-value>irregular declension</grammar-value>
|
118
126
|
</grammar>
|
119
127
|
</expression>
|
128
|
+
<field-of-application>Field</field-of-application>
|
120
129
|
</deprecates>
|
121
130
|
<related type='abbreviation'>
|
122
|
-
<preferred
|
131
|
+
<preferred geographic-area="GRC">
|
123
132
|
<expression>
|
124
133
|
<name>Fifth Designation</name>
|
125
134
|
<grammar>
|
@@ -140,10 +149,9 @@ RSpec.describe Asciidoctor::Standoc do
|
|
140
149
|
</related>
|
141
150
|
<domain>Hydraulics</domain>
|
142
151
|
<subject>pipes</subject>
|
143
|
-
<
|
144
|
-
<definition><verbaldefinition>
|
152
|
+
<definition><verbal-definition>
|
145
153
|
<p id='_'>Definition</p>
|
146
|
-
</
|
154
|
+
</verbal-definition></definition>
|
147
155
|
<termsource status='identical' type='authoritative'>
|
148
156
|
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
149
157
|
<localityStack>
|
@@ -159,11 +167,11 @@ RSpec.describe Asciidoctor::Standoc do
|
|
159
167
|
<expression>
|
160
168
|
<name>Second Term</name>
|
161
169
|
</expression>
|
162
|
-
|
163
|
-
<usageinfo>
|
170
|
+
<usage-info>
|
164
171
|
<p id='_'>Usage Info 1.</p>
|
165
172
|
<p id='_'>Usage Info 2.</p>
|
166
|
-
</
|
173
|
+
</usage-info>
|
174
|
+
</preferred>
|
167
175
|
</term>
|
168
176
|
</terms>
|
169
177
|
</sections>
|
@@ -255,9 +263,9 @@ RSpec.describe Asciidoctor::Standoc do
|
|
255
263
|
<tt>seventh-designation</tt>
|
256
264
|
</strong>
|
257
265
|
</related>
|
258
|
-
<definition><
|
266
|
+
<definition><verbal-definition>
|
259
267
|
<p id='_'>Definition</p>
|
260
|
-
</
|
268
|
+
</verbal-definition></definition>
|
261
269
|
</term>
|
262
270
|
</terms>
|
263
271
|
<clause id='_' inline-header='false' obligation='normative'>
|
@@ -361,9 +369,9 @@ RSpec.describe Asciidoctor::Standoc do
|
|
361
369
|
</preferred>
|
362
370
|
<xref target='second'/>
|
363
371
|
</related>
|
364
|
-
<definition><
|
372
|
+
<definition><verbal-definition>
|
365
373
|
<p id='_'>Definition</p>
|
366
|
-
</
|
374
|
+
</verbal-definition></definition>
|
367
375
|
</term>
|
368
376
|
</terms>
|
369
377
|
</sections>
|
@@ -424,9 +432,9 @@ RSpec.describe Asciidoctor::Standoc do
|
|
424
432
|
<related type='see'>
|
425
433
|
<xref target='second'/>
|
426
434
|
</related>
|
427
|
-
<definition><
|
435
|
+
<definition><verbal-definition>
|
428
436
|
<p id='_'>Definition</p>
|
429
|
-
</
|
437
|
+
</verbal-definition></definition>
|
430
438
|
</term>
|
431
439
|
</terms>
|
432
440
|
</sections>
|
@@ -526,13 +534,13 @@ RSpec.describe Asciidoctor::Standoc do
|
|
526
534
|
<xref target='second'/>
|
527
535
|
</related>
|
528
536
|
<definition>
|
529
|
-
<
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
</
|
537
|
+
<verbal-definition>
|
538
|
+
<figure id='_'>
|
539
|
+
<name>Caption</name>
|
540
|
+
<pre id='_'><LITERAL> FIGURATIVE</pre>
|
541
|
+
</figure>
|
542
|
+
<p id='_'>Definition</p>
|
543
|
+
</verbal-definition>
|
536
544
|
</definition>
|
537
545
|
</term>
|
538
546
|
</terms>
|
@@ -555,11 +563,11 @@ RSpec.describe Asciidoctor::Standoc do
|
|
555
563
|
script:: Latn
|
556
564
|
type:: prefix
|
557
565
|
isInternational:: true
|
558
|
-
|
566
|
+
abbreviation-type:: acronym
|
559
567
|
pronunciation:: fəɹst
|
560
568
|
domain:: Hydraulics
|
561
569
|
subject:: pipes
|
562
|
-
|
570
|
+
usage-info:: This is usage.
|
563
571
|
|
564
572
|
related:see[Fifth Designation]
|
565
573
|
|
@@ -578,7 +586,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
578
586
|
gender::: masculine, feminine
|
579
587
|
isPreposition::: false
|
580
588
|
isNoun::: true
|
581
|
-
|
589
|
+
grammar-value::: irregular declension
|
582
590
|
|
583
591
|
alt:[Third Designation]
|
584
592
|
|
@@ -588,7 +596,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
588
596
|
type:: suffix
|
589
597
|
domain:: Hydraulics1
|
590
598
|
subject: pipes1
|
591
|
-
|
599
|
+
usage-info:: This is usage 1.
|
592
600
|
|
593
601
|
preferred:[Second Designation]
|
594
602
|
|
@@ -608,9 +616,10 @@ RSpec.describe Asciidoctor::Standoc do
|
|
608
616
|
<preferred language='fr' script='Latn' type='prefix' isInternational="true">
|
609
617
|
<expression>
|
610
618
|
<name>First Designation</name>
|
611
|
-
<
|
619
|
+
<abbreviation-type>acronym</abbreviation-type>
|
612
620
|
<pronunciation>fəɹst</pronunciation>
|
613
621
|
</expression>
|
622
|
+
<usage-info>This is usage.</usage-info>
|
614
623
|
</preferred>
|
615
624
|
<preferred type='abbreviation'>
|
616
625
|
<expression>
|
@@ -621,6 +630,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
621
630
|
<expression>
|
622
631
|
<name>Third Designation</name>
|
623
632
|
</expression>
|
633
|
+
<usage-info>This is usage 1.</usage-info>
|
624
634
|
</admitted>
|
625
635
|
<deprecates language='jp' script='Japn' type='full'>
|
626
636
|
<expression>
|
@@ -630,7 +640,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
630
640
|
<gender>feminine</gender>
|
631
641
|
<isPreposition>false</isPreposition>
|
632
642
|
<isNoun>true</isNoun>
|
633
|
-
<
|
643
|
+
<grammar-value>irregular declension</grammar-value>
|
634
644
|
</grammar>
|
635
645
|
</expression>
|
636
646
|
</deprecates>
|
@@ -644,10 +654,9 @@ RSpec.describe Asciidoctor::Standoc do
|
|
644
654
|
</related>
|
645
655
|
<domain>Hydraulics</domain>
|
646
656
|
<subject>pipes</subject>
|
647
|
-
<
|
648
|
-
<definition><verbaldefinition>
|
657
|
+
<definition><verbal-definition>
|
649
658
|
<p id='_'>Definition</p>
|
650
|
-
</
|
659
|
+
</verbal-definition></definition>
|
651
660
|
</term>
|
652
661
|
</terms>
|
653
662
|
</sections>
|
@@ -690,7 +699,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
690
699
|
<mn>91</mn>
|
691
700
|
</mrow>
|
692
701
|
</msub></math></stem></name></letter-symbol></admitted>
|
693
|
-
<definition><
|
702
|
+
<definition><verbal-definition><p id="_">Time</p></verbal-definition></definition></term>
|
694
703
|
</terms>
|
695
704
|
</sections>
|
696
705
|
</standard-document>
|
@@ -722,15 +731,14 @@ RSpec.describe Asciidoctor::Standoc do
|
|
722
731
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
723
732
|
<term id="term-tempus">
|
724
733
|
<preferred><expression><name>Tempus</name></expression></preferred>
|
725
|
-
<domain>relativity</domain><definition><
|
734
|
+
<domain>relativity</domain><definition><verbal-definition><p id="_"> Time</p></verbal-definition></definition>
|
726
735
|
</term>
|
727
736
|
<term id='term-tempus1'>
|
728
737
|
<preferred><expression><name>Tempus1</name></expression></preferred>
|
729
738
|
<domain>relativity2</domain>
|
730
|
-
<definition><
|
739
|
+
<definition><verbal-definition>
|
731
740
|
<p id='_'>Time2</p>
|
732
|
-
|
733
|
-
</verbaldefinition></definition>
|
741
|
+
</verbal-definition></definition>
|
734
742
|
</term>
|
735
743
|
</terms>
|
736
744
|
</sections>
|
@@ -785,8 +793,26 @@ RSpec.describe Asciidoctor::Standoc do
|
|
785
793
|
<mn>90</mn>
|
786
794
|
</mrow>
|
787
795
|
</msub></math></stem></name></letter-symbol></preferred>
|
796
|
+
<admitted>
|
797
|
+
<letter-symbol>
|
798
|
+
<name>
|
799
|
+
<stem type='MathML'>
|
800
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
801
|
+
<msub>
|
802
|
+
<mrow>
|
803
|
+
<mi>t</mi>
|
804
|
+
</mrow>
|
805
|
+
<mrow>
|
806
|
+
<mi>A</mi>
|
807
|
+
</mrow>
|
808
|
+
</msub>
|
809
|
+
</math>
|
810
|
+
</stem>
|
811
|
+
</name>
|
812
|
+
</letter-symbol>
|
813
|
+
</admitted>
|
788
814
|
<definition>
|
789
|
-
<
|
815
|
+
<verbal-definition>
|
790
816
|
<p id="_">This paragraph is extraneous</p>
|
791
817
|
<ul id='_'>
|
792
818
|
<li>
|
@@ -805,17 +831,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
805
831
|
</dd>
|
806
832
|
</dl>
|
807
833
|
<p id='_'>This is a concluding paragraph</p>
|
808
|
-
</
|
809
|
-
<nonverbalrepresentation><formula id="_">
|
810
|
-
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub>
|
811
|
-
<mrow>
|
812
|
-
<mi>t</mi>
|
813
|
-
</mrow>
|
814
|
-
<mrow>
|
815
|
-
<mi>A</mi>
|
816
|
-
</mrow>
|
817
|
-
</msub></math></stem>
|
818
|
-
</formula></nonverbalrepresentation>
|
834
|
+
</verbal-definition>
|
819
835
|
</definition>
|
820
836
|
</term>
|
821
837
|
</terms>
|
@@ -856,7 +872,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
856
872
|
<title>Terms and definitions</title>
|
857
873
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
858
874
|
<term id="term-term"><preferred><expression><name>Term</name></expression></preferred>
|
859
|
-
<definition><
|
875
|
+
<definition><verbal-definition><p id='_'>Definition</p></verbal-definition></definition>
|
860
876
|
<termnote id="_">
|
861
877
|
<p id="_">Note</p>
|
862
878
|
</termnote><termnote id="_">
|
@@ -895,7 +911,10 @@ RSpec.describe Asciidoctor::Standoc do
|
|
895
911
|
|
896
912
|
[.source]
|
897
913
|
<<ISO2191,section=1>>
|
914
|
+
--
|
898
915
|
|
916
|
+
[.definition]
|
917
|
+
--
|
899
918
|
|===
|
900
919
|
| A | B
|
901
920
|
|
@@ -938,7 +957,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
938
957
|
</expression>
|
939
958
|
</preferred>
|
940
959
|
<definition>
|
941
|
-
<
|
960
|
+
<verbal-definition>
|
942
961
|
<p id='_'>Definition</p>
|
943
962
|
<termsource status='identical' type='authoritative'>
|
944
963
|
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
@@ -949,8 +968,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
949
968
|
</localityStack>
|
950
969
|
</origin>
|
951
970
|
</termsource>
|
952
|
-
</
|
953
|
-
<
|
971
|
+
</verbal-definition>
|
972
|
+
<non-verbal-representation>
|
954
973
|
<table id='_'>
|
955
974
|
<thead>
|
956
975
|
<tr>
|
@@ -965,7 +984,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
965
984
|
</tr>
|
966
985
|
</tbody>
|
967
986
|
</table>
|
968
|
-
</
|
987
|
+
</non-verbal-representation>
|
969
988
|
</definition>
|
970
989
|
<termsource status='identical' type='authoritative'>
|
971
990
|
<origin bibitemid='ISO2191' type='inline' citeas=''>
|
@@ -984,7 +1003,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
984
1003
|
</expression>
|
985
1004
|
</preferred>
|
986
1005
|
<definition>
|
987
|
-
<
|
1006
|
+
<non-verbal-representation>
|
988
1007
|
<figure id='_'>
|
989
1008
|
<pre id='_'>Literal</pre>
|
990
1009
|
</figure>
|
@@ -1006,7 +1025,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1006
1025
|
</localityStack>
|
1007
1026
|
</origin>
|
1008
1027
|
</termsource>
|
1009
|
-
</
|
1028
|
+
</non-verbal-representation>
|
1010
1029
|
</definition>
|
1011
1030
|
</term>
|
1012
1031
|
</terms>
|
@@ -1017,4 +1036,170 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1017
1036
|
.to be_equivalent_to xmlpp(output)
|
1018
1037
|
end
|
1019
1038
|
|
1039
|
+
it "differentiates stem expressions before, after, and within verbal definitions" do
|
1040
|
+
input = <<~INPUT
|
1041
|
+
#{ASCIIDOC_BLANK_HDR}
|
1042
|
+
|
1043
|
+
== Terms and definitions
|
1044
|
+
|
1045
|
+
=== Term
|
1046
|
+
|
1047
|
+
stem:[lambda]
|
1048
|
+
|
1049
|
+
[.definition]
|
1050
|
+
--
|
1051
|
+
|
1052
|
+
Definition
|
1053
|
+
|
1054
|
+
stem:[mu]
|
1055
|
+
--
|
1056
|
+
|
1057
|
+
[.definition]
|
1058
|
+
--
|
1059
|
+
|
1060
|
+
stem:[nu]
|
1061
|
+
--
|
1062
|
+
|
1063
|
+
INPUT
|
1064
|
+
output = <<~OUTPUT
|
1065
|
+
#{BLANK_HDR}
|
1066
|
+
<sections>
|
1067
|
+
<terms id='_' obligation='normative'>
|
1068
|
+
<title>Terms and definitions</title>
|
1069
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
1070
|
+
<term id='term-term'>
|
1071
|
+
<preferred>
|
1072
|
+
<expression>
|
1073
|
+
<name>Term</name>
|
1074
|
+
</expression>
|
1075
|
+
</preferred>
|
1076
|
+
<admitted>
|
1077
|
+
<letter-symbol>
|
1078
|
+
<name>
|
1079
|
+
<stem type='MathML'>
|
1080
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1081
|
+
<mi>λ</mi>
|
1082
|
+
</math>
|
1083
|
+
</stem>
|
1084
|
+
</name>
|
1085
|
+
</letter-symbol>
|
1086
|
+
</admitted>
|
1087
|
+
<definition>
|
1088
|
+
<verbal-definition>
|
1089
|
+
<p id='_'>Definition</p>
|
1090
|
+
<p id='_'>
|
1091
|
+
<stem type='MathML'>
|
1092
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1093
|
+
<mi>μ</mi>
|
1094
|
+
</math>
|
1095
|
+
</stem>
|
1096
|
+
</p>
|
1097
|
+
</verbal-definition>
|
1098
|
+
</definition>
|
1099
|
+
<definition>
|
1100
|
+
<verbal-definition>
|
1101
|
+
<p id='_'>
|
1102
|
+
<stem type='MathML'>
|
1103
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1104
|
+
<mi>ν</mi>
|
1105
|
+
</math>
|
1106
|
+
</stem>
|
1107
|
+
</p>
|
1108
|
+
</verbal-definition>
|
1109
|
+
</definition>
|
1110
|
+
</term>
|
1111
|
+
</terms>
|
1112
|
+
</sections>
|
1113
|
+
</standard-document>
|
1114
|
+
OUTPUT
|
1115
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1116
|
+
.to be_equivalent_to xmlpp(output)
|
1117
|
+
end
|
1118
|
+
|
1119
|
+
it "differentiates formuals before, after, and within verbal definitions" do
|
1120
|
+
input = <<~INPUT
|
1121
|
+
#{ASCIIDOC_BLANK_HDR}
|
1122
|
+
|
1123
|
+
== Terms and definitions
|
1124
|
+
|
1125
|
+
=== Term
|
1126
|
+
|
1127
|
+
[stem]
|
1128
|
+
++++
|
1129
|
+
lambda
|
1130
|
+
++++
|
1131
|
+
|
1132
|
+
[.definition]
|
1133
|
+
--
|
1134
|
+
|
1135
|
+
Definition
|
1136
|
+
|
1137
|
+
[stem]
|
1138
|
+
++++
|
1139
|
+
mu
|
1140
|
+
++++
|
1141
|
+
--
|
1142
|
+
|
1143
|
+
[.definition]
|
1144
|
+
--
|
1145
|
+
|
1146
|
+
[stem]
|
1147
|
+
++++
|
1148
|
+
nu
|
1149
|
+
++++
|
1150
|
+
--
|
1151
|
+
|
1152
|
+
INPUT
|
1153
|
+
output = <<~OUTPUT
|
1154
|
+
#{BLANK_HDR}
|
1155
|
+
<sections>
|
1156
|
+
<terms id='_' obligation='normative'>
|
1157
|
+
<title>Terms and definitions</title>
|
1158
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
1159
|
+
<term id='term-term'>
|
1160
|
+
<preferred>
|
1161
|
+
<expression>
|
1162
|
+
<name>Term</name>
|
1163
|
+
</expression>
|
1164
|
+
</preferred>
|
1165
|
+
<admitted>
|
1166
|
+
<letter-symbol>
|
1167
|
+
<name>
|
1168
|
+
<stem type='MathML'>
|
1169
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1170
|
+
<mi>λ</mi>
|
1171
|
+
</math>
|
1172
|
+
</stem>
|
1173
|
+
</name>
|
1174
|
+
</letter-symbol>
|
1175
|
+
</admitted>
|
1176
|
+
<definition>
|
1177
|
+
<verbal-definition>
|
1178
|
+
<p id='_'>Definition</p>
|
1179
|
+
<formula id='_'>
|
1180
|
+
<stem type='MathML'>
|
1181
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1182
|
+
<mi>μ</mi>
|
1183
|
+
</math>
|
1184
|
+
</stem>
|
1185
|
+
</formula>
|
1186
|
+
</verbal-definition>
|
1187
|
+
<non-verbal-representation>
|
1188
|
+
<formula id='_'>
|
1189
|
+
<stem type='MathML'>
|
1190
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
1191
|
+
<mi>ν</mi>
|
1192
|
+
</math>
|
1193
|
+
</stem>
|
1194
|
+
</formula>
|
1195
|
+
</non-verbal-representation>
|
1196
|
+
</definition>
|
1197
|
+
</term>
|
1198
|
+
</terms>
|
1199
|
+
</sections>
|
1200
|
+
</standard-document>
|
1201
|
+
OUTPUT
|
1202
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
1203
|
+
.to be_equivalent_to xmlpp(output)
|
1204
|
+
end
|
1020
1205
|
end
|
@@ -1,20 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "spec_helper"
|
4
4
|
|
5
5
|
RSpec.describe Asciidoctor::Standoc::Datamodel::AttributesTablePreprocessor do
|
6
|
-
describe
|
7
|
-
context
|
6
|
+
describe "#process" do
|
7
|
+
context "when simple models without relations" do
|
8
8
|
let(:datamodel_file) do
|
9
|
-
examples_path(
|
9
|
+
examples_path("datamodel/address_class_profile.adoc")
|
10
10
|
end
|
11
11
|
let(:result_file) do
|
12
|
-
examples_path(
|
12
|
+
examples_path("datamodel/address_class_profile.xml")
|
13
13
|
end
|
14
14
|
let(:output) do
|
15
15
|
[
|
16
16
|
BLANK_HDR,
|
17
|
-
File.read(fixtures_path(
|
17
|
+
File.read(fixtures_path("macros_datamodel/address_class_profile.xml")),
|
18
18
|
]
|
19
19
|
.join
|
20
20
|
end
|
@@ -27,7 +27,7 @@ RSpec.describe Asciidoctor::Standoc::Datamodel::AttributesTablePreprocessor do
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
-
it
|
30
|
+
it "correctly renders input" do
|
31
31
|
Asciidoctor.convert_file(datamodel_file,
|
32
32
|
backend: :standoc,
|
33
33
|
safe: :safe,
|
@@ -37,18 +37,18 @@ RSpec.describe Asciidoctor::Standoc::Datamodel::AttributesTablePreprocessor do
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
context
|
40
|
+
context "when complex relations" do
|
41
41
|
let(:datamodel_file) do
|
42
|
-
examples_path(
|
42
|
+
examples_path("datamodel/address_component_profile.adoc")
|
43
43
|
end
|
44
44
|
let(:result_file) do
|
45
|
-
examples_path(
|
45
|
+
examples_path("datamodel/address_component_profile.xml")
|
46
46
|
end
|
47
47
|
let(:output) do
|
48
|
-
path = fixtures_path(
|
48
|
+
path = fixtures_path("macros_datamodel/address_component_profile.xml")
|
49
49
|
[
|
50
50
|
BLANK_HDR,
|
51
|
-
File.read(path)
|
51
|
+
File.read(path),
|
52
52
|
]
|
53
53
|
.join("\n")
|
54
54
|
end
|
@@ -56,14 +56,14 @@ RSpec.describe Asciidoctor::Standoc::Datamodel::AttributesTablePreprocessor do
|
|
56
56
|
after do
|
57
57
|
%w[doc html xml err].each do |extention|
|
58
58
|
path = examples_path(
|
59
|
-
"datamodel/address_component_profile.#{extention}"
|
59
|
+
"datamodel/address_component_profile.#{extention}",
|
60
60
|
)
|
61
61
|
FileUtils.rm_f(path)
|
62
62
|
FileUtils.rm_f("address_component_profile.#{extention}")
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
-
it
|
66
|
+
it "correctly renders input" do
|
67
67
|
Asciidoctor.convert_file(datamodel_file,
|
68
68
|
backend: :standoc,
|
69
69
|
safe: :safe,
|
@@ -73,32 +73,32 @@ RSpec.describe Asciidoctor::Standoc::Datamodel::AttributesTablePreprocessor do
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
-
context
|
76
|
+
context "when missing definition" do
|
77
77
|
let(:datamodel_file) do
|
78
|
-
examples_path(
|
78
|
+
examples_path("datamodel/blank_definition_profile.adoc")
|
79
79
|
end
|
80
80
|
let(:result_file) do
|
81
|
-
examples_path(
|
81
|
+
examples_path("datamodel/blank_definition_profile.xml")
|
82
82
|
end
|
83
83
|
let(:output) do
|
84
|
-
path = fixtures_path(
|
84
|
+
path = fixtures_path("macros_datamodel/blank_definition_profile.xml")
|
85
85
|
[
|
86
86
|
BLANK_HDR,
|
87
|
-
File.read(path)
|
87
|
+
File.read(path),
|
88
88
|
].join("\n")
|
89
89
|
end
|
90
90
|
|
91
91
|
after do
|
92
92
|
%w[doc html xml err].each do |extention|
|
93
93
|
path = examples_path(
|
94
|
-
"datamodel/blank_definition_profile.#{extention}"
|
94
|
+
"datamodel/blank_definition_profile.#{extention}",
|
95
95
|
)
|
96
96
|
FileUtils.rm_f(path)
|
97
97
|
FileUtils.rm_f("blank_definition_profile.#{extention}")
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
101
|
-
it
|
101
|
+
it "correctly renders input" do
|
102
102
|
Asciidoctor.convert_file(datamodel_file,
|
103
103
|
backend: :standoc,
|
104
104
|
safe: :safe,
|