metanorma-standoc 1.10.5 → 1.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +19 -23
- data/Rakefile +1 -1
- data/lib/asciidoctor/standoc/base.rb +14 -17
- data/lib/asciidoctor/standoc/basicdoc.rng +21 -4
- data/lib/asciidoctor/standoc/blocks.rb +26 -23
- data/lib/asciidoctor/standoc/blocks_notes.rb +17 -22
- data/lib/asciidoctor/standoc/cleanup.rb +46 -12
- data/lib/asciidoctor/standoc/cleanup_block.rb +5 -70
- data/lib/asciidoctor/standoc/cleanup_image.rb +6 -7
- data/lib/asciidoctor/standoc/cleanup_inline.rb +44 -102
- data/lib/asciidoctor/standoc/cleanup_maths.rb +5 -6
- data/lib/asciidoctor/standoc/cleanup_ref.rb +5 -0
- data/lib/asciidoctor/standoc/cleanup_reqt.rb +51 -33
- data/lib/asciidoctor/standoc/cleanup_section_names.rb +5 -5
- data/lib/asciidoctor/standoc/cleanup_symbols.rb +48 -0
- data/lib/asciidoctor/standoc/cleanup_table.rb +68 -0
- data/lib/asciidoctor/standoc/cleanup_terms.rb +38 -78
- data/lib/asciidoctor/standoc/cleanup_terms_designations.rb +162 -0
- data/lib/asciidoctor/standoc/cleanup_text.rb +5 -2
- data/lib/asciidoctor/standoc/cleanup_xref.rb +107 -0
- data/lib/asciidoctor/standoc/converter.rb +15 -0
- data/lib/asciidoctor/standoc/inline.rb +7 -5
- data/lib/asciidoctor/standoc/isodoc.rng +435 -78
- data/lib/asciidoctor/standoc/lists.rb +15 -15
- data/lib/asciidoctor/standoc/macros.rb +14 -43
- data/lib/asciidoctor/standoc/macros_note.rb +45 -0
- data/lib/asciidoctor/standoc/macros_plantuml.rb +29 -14
- data/lib/asciidoctor/standoc/macros_terms.rb +82 -20
- data/lib/asciidoctor/standoc/ref_sect.rb +24 -17
- data/lib/asciidoctor/standoc/reqt.rb +2 -2
- data/lib/asciidoctor/standoc/reqt.rng +23 -2
- data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +50 -11
- data/lib/asciidoctor/standoc/terms.rb +21 -3
- data/lib/asciidoctor/standoc/utils.rb +36 -23
- data/lib/asciidoctor/standoc/validate.rb +45 -27
- data/lib/asciidoctor/standoc/validate_section.rb +5 -2
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +1 -1
- data/spec/asciidoctor/base_spec.rb +4 -36
- data/spec/asciidoctor/blank_spec.rb +37 -0
- data/spec/asciidoctor/blocks_spec.rb +296 -47
- data/spec/asciidoctor/cleanup_blocks_spec.rb +1018 -0
- data/spec/asciidoctor/cleanup_sections_spec.rb +153 -12
- data/spec/asciidoctor/cleanup_spec.rb +179 -1265
- data/spec/asciidoctor/cleanup_terms_spec.rb +990 -0
- data/spec/asciidoctor/inline_spec.rb +38 -2
- data/spec/asciidoctor/lists_spec.rb +6 -6
- data/spec/asciidoctor/macros_plantuml_spec.rb +37 -2
- data/spec/asciidoctor/macros_spec.rb +226 -138
- data/spec/asciidoctor/refs_spec.rb +4 -26
- data/spec/asciidoctor/section_spec.rb +18 -18
- data/spec/asciidoctor/validate_spec.rb +109 -1
- data/spec/assets/xref_error.adoc +1 -0
- data/spec/fixtures/datamodel_description_sections_tree.xml +327 -326
- data/spec/spec_helper.rb +6 -7
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +51 -51
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +13 -13
- data/spec/vcr_cassettes/isobib_get_123.yml +13 -13
- data/spec/vcr_cassettes/isobib_get_123_1.yml +26 -26
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +34 -34
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +12 -12
- data/spec/vcr_cassettes/isobib_get_124.yml +13 -13
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +16 -16
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +51 -49
- metadata +13 -5
@@ -999,6 +999,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
999
999
|
<docidentifier type='IETF'>RFC 8341</docidentifier>
|
1000
1000
|
<docidentifier type='rfc-anchor'>RFC8341</docidentifier>
|
1001
1001
|
<docidentifier type='DOI'>10.17487/RFC8341</docidentifier>
|
1002
|
+
<docnumber>RFC8341</docnumber>
|
1002
1003
|
<date type='published'>
|
1003
1004
|
<on>2018-03</on>
|
1004
1005
|
</date>
|
@@ -1008,12 +1009,6 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1008
1009
|
<name>
|
1009
1010
|
<completename language='en'>A. Bierman</completename>
|
1010
1011
|
</name>
|
1011
|
-
<affiliation>
|
1012
|
-
<organization>
|
1013
|
-
<name>Internet Engineering Task Force</name>
|
1014
|
-
<abbreviation>IETF</abbreviation>
|
1015
|
-
</organization>
|
1016
|
-
</affiliation>
|
1017
1012
|
</person>
|
1018
1013
|
</contributor>
|
1019
1014
|
<contributor>
|
@@ -1022,12 +1017,6 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1022
1017
|
<name>
|
1023
1018
|
<completename language='en'>M. Bjorklund</completename>
|
1024
1019
|
</name>
|
1025
|
-
<affiliation>
|
1026
|
-
<organization>
|
1027
|
-
<name>Internet Engineering Task Force</name>
|
1028
|
-
<abbreviation>IETF</abbreviation>
|
1029
|
-
</organization>
|
1030
|
-
</affiliation>
|
1031
1020
|
</person>
|
1032
1021
|
</contributor>
|
1033
1022
|
<contributor>
|
@@ -1070,6 +1059,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1070
1059
|
<docidentifier type='metanorma'>[1]</docidentifier>
|
1071
1060
|
<docidentifier type='rfc-anchor'>RFC8341</docidentifier>
|
1072
1061
|
<docidentifier type='DOI'>10.17487/RFC8341</docidentifier>
|
1062
|
+
<docnumber>RFC8341</docnumber>
|
1073
1063
|
<date type='published'>
|
1074
1064
|
<on>2018-03</on>
|
1075
1065
|
</date>
|
@@ -1079,12 +1069,6 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1079
1069
|
<name>
|
1080
1070
|
<completename language='en'>A. Bierman</completename>
|
1081
1071
|
</name>
|
1082
|
-
<affiliation>
|
1083
|
-
<organization>
|
1084
|
-
<name>Internet Engineering Task Force</name>
|
1085
|
-
<abbreviation>IETF</abbreviation>
|
1086
|
-
</organization>
|
1087
|
-
</affiliation>
|
1088
1072
|
</person>
|
1089
1073
|
</contributor>
|
1090
1074
|
<contributor>
|
@@ -1093,12 +1077,6 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1093
1077
|
<name>
|
1094
1078
|
<completename language='en'>M. Bjorklund</completename>
|
1095
1079
|
</name>
|
1096
|
-
<affiliation>
|
1097
|
-
<organization>
|
1098
|
-
<name>Internet Engineering Task Force</name>
|
1099
|
-
<abbreviation>IETF</abbreviation>
|
1100
|
-
</organization>
|
1101
|
-
</affiliation>
|
1102
1080
|
</person>
|
1103
1081
|
</contributor>
|
1104
1082
|
<contributor>
|
@@ -1684,7 +1662,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1684
1662
|
def mock_isobib_get_123_no_docid(n)
|
1685
1663
|
expect(RelatonIso::IsoBibliography).to receive(:get).with("ISO 123", nil, { lang: "en", title: "<em>Standard</em>", usrlbl: nil }) do
|
1686
1664
|
RelatonBib::XMLParser.from_xml(<<~"OUTPUT")
|
1687
|
-
<bibitem type=\"standard\" id=\"ISO123\">\n <uri type=\"src\">https://www.iso.org/standard/23281.html</uri>\n <uri type=\"obp\">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>\n <uri type=\"rss\">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>\n <date type=\"published\">\n <on>2001</on>\n </date>\n <contributor>\n <role type=\"publisher\"/>\n <organization>\n <name>International Organization for Standardization</name>\n <abbreviation>ISO</abbreviation>\n <uri>www.iso.org</uri>\n </organization>\n </contributor>\n <edition>3</edition>\n <language>en</language>\n <language>fr</language>\n <script>Latn</script>\n <status><stage>Published</stage></status>\n <copyright>\n <from>2001</from>\n <owner>\n <organization>\n <name>ISO</name>\n <abbreviation></abbreviation>\n </organization>\n </owner>\n </copyright>\n <relation type=\"obsoletes\">\n <bibitem type="standard">\n <formattedref format="text/plain">ISO 123:1985</formattedref>\n </bibitem>\n </relation>\n <relation type=\"updates\">\n <bibitem type="standard">\n <formattedref format="text/plain">ISO 123:2001</formattedref>\n </bibitem>\n </relation>\n
|
1665
|
+
<bibitem type=\"standard\" id=\"ISO123\">\n <uri type=\"src\">https://www.iso.org/standard/23281.html</uri>\n <uri type=\"obp\">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>\n <uri type=\"rss\">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>\n <date type=\"published\">\n <on>2001</on>\n </date>\n <contributor>\n <role type=\"publisher\"/>\n <organization>\n <name>International Organization for Standardization</name>\n <abbreviation>ISO</abbreviation>\n <uri>www.iso.org</uri>\n </organization>\n </contributor>\n <edition>3</edition>\n <language>en</language>\n <language>fr</language>\n <script>Latn</script>\n <status><stage>Published</stage></status>\n <copyright>\n <from>2001</from>\n <owner>\n <organization>\n <name>ISO</name>\n <abbreviation></abbreviation>\n </organization>\n </owner>\n </copyright>\n <relation type=\"obsoletes\">\n <bibitem type="standard">\n <formattedref format="text/plain">ISO 123:1985</formattedref>\n </bibitem>\n </relation>\n <relation type=\"updates\">\n <bibitem type="standard">\n <formattedref format="text/plain">ISO 123:2001</formattedref>\n </bibitem>\n </relation>\n<ext></fred></ext></bibitem>
|
1688
1666
|
OUTPUT
|
1689
1667
|
end.exactly(n).times
|
1690
1668
|
end
|
@@ -1692,7 +1670,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1692
1670
|
def mock_isobib_get_123_no_docid_lbl(n)
|
1693
1671
|
expect(RelatonIso::IsoBibliography).to receive(:get).with("ISO 123", nil, { lang: "en", title: "<em>Standard</em>", usrlbl: "(1)" }) do
|
1694
1672
|
RelatonBib::XMLParser.from_xml(<<~"OUTPUT")
|
1695
|
-
<bibitem type=\"standard\" id=\"ISO123\">\n <uri type=\"src\">https://www.iso.org/standard/23281.html</uri>\n <uri type=\"obp\">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>\n <uri type=\"rss\">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>\n <date type=\"published\">\n <on>2001</on>\n </date>\n <contributor>\n <role type=\"publisher\"/>\n <organization>\n <name>International Organization for Standardization</name>\n <abbreviation>ISO</abbreviation>\n <uri>www.iso.org</uri>\n </organization>\n </contributor>\n <edition>3</edition>\n <language>en</language>\n <language>fr</language>\n <script>Latn</script>\n <status><stage>Published</stage></status>\n <copyright>\n <from>2001</from>\n <owner>\n <organization>\n <name>ISO</name>\n <abbreviation></abbreviation>\n </organization>\n </owner>\n </copyright>\n <relation type=\"obsoletes\">\n <bibitem type="standard">\n <formattedref format="text/plain">ISO 123:1985</formattedref>\n </bibitem>\n </relation>\n <relation type=\"updates\">\n <bibitem type="standard">\n <formattedref format="text/plain">ISO 123:2001</formattedref>\n </bibitem>\n </relation>\n
|
1673
|
+
<bibitem type=\"standard\" id=\"ISO123\">\n <uri type=\"src\">https://www.iso.org/standard/23281.html</uri>\n <uri type=\"obp\">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>\n <uri type=\"rss\">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>\n <date type=\"published\">\n <on>2001</on>\n </date>\n <contributor>\n <role type=\"publisher\"/>\n <organization>\n <name>International Organization for Standardization</name>\n <abbreviation>ISO</abbreviation>\n <uri>www.iso.org</uri>\n </organization>\n </contributor>\n <edition>3</edition>\n <language>en</language>\n <language>fr</language>\n <script>Latn</script>\n <status><stage>Published</stage></status>\n <copyright>\n <from>2001</from>\n <owner>\n <organization>\n <name>ISO</name>\n <abbreviation></abbreviation>\n </organization>\n </owner>\n </copyright>\n <relation type=\"obsoletes\">\n <bibitem type="standard">\n <formattedref format="text/plain">ISO 123:1985</formattedref>\n </bibitem>\n </relation>\n <relation type=\"updates\">\n <bibitem type="standard">\n <formattedref format="text/plain">ISO 123:2001</formattedref>\n </bibitem>\n </relation>\n<ext></fred></ext></bibitem>
|
1696
1674
|
OUTPUT
|
1697
1675
|
end.exactly(n).times
|
1698
1676
|
end
|
@@ -125,7 +125,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
125
125
|
<p id="_">For the purposes of this document,
|
126
126
|
the following terms and definitions apply.</p>
|
127
127
|
<term id="term-term1">
|
128
|
-
<preferred>Term1</preferred>
|
128
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
129
129
|
</term>
|
130
130
|
</terms>
|
131
131
|
<clause id="_" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title>
|
@@ -147,14 +147,14 @@ RSpec.describe Asciidoctor::Standoc do
|
|
147
147
|
<terms id="_" obligation="normative">
|
148
148
|
<title>Intro 5</title>
|
149
149
|
<term id="term-term1-1">
|
150
|
-
<preferred>Term1</preferred>
|
150
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
151
151
|
</term>
|
152
152
|
</terms>
|
153
153
|
</clause>
|
154
154
|
<terms id="_" obligation="normative">
|
155
155
|
<title>Normal Terms</title>
|
156
156
|
<term id="term-term2">
|
157
|
-
<preferred>Term2</preferred>
|
157
|
+
<preferred><expression><name>Term2</name></expression></preferred>
|
158
158
|
</term>
|
159
159
|
</terms>
|
160
160
|
<definitions id="_" obligation="normative"><title>Symbols and abbreviated terms</title><clause id="_" inline-header="false" obligation="normative">
|
@@ -278,7 +278,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
278
278
|
<title>Terms and definitions</title>
|
279
279
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
280
280
|
<term id='term-term1' number='4bis'>
|
281
|
-
<preferred>Term1</preferred>
|
281
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
282
282
|
</term>
|
283
283
|
</terms>
|
284
284
|
<terms id='_' number='5bis' obligation='normative'>
|
@@ -291,7 +291,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
291
291
|
</clause>
|
292
292
|
</clause>
|
293
293
|
<term id='term-intro-2' number='8bis'>
|
294
|
-
<preferred>Intro 2</preferred>
|
294
|
+
<preferred><expression><name>Intro 2</name></expression></preferred>
|
295
295
|
</term>
|
296
296
|
<definitions id='_' number='9bis' obligation='normative'>
|
297
297
|
<title>Symbols and abbreviated terms</title>
|
@@ -478,7 +478,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
478
478
|
<p id="_">For the purposes of this document,
|
479
479
|
the following terms and definitions apply.</p>
|
480
480
|
<term id="term-term1" language="en" script="Latn">
|
481
|
-
<preferred>Term1</preferred>
|
481
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
482
482
|
</term>
|
483
483
|
</terms>
|
484
484
|
<clause id="_" language="en" script="Latn" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title>
|
@@ -500,14 +500,14 @@ RSpec.describe Asciidoctor::Standoc do
|
|
500
500
|
<terms id="_" language="en" script="Latn" obligation="normative">
|
501
501
|
<title>Intro 5</title>
|
502
502
|
<term id="term-term1-1">
|
503
|
-
<preferred>Term1</preferred>
|
503
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
504
504
|
</term>
|
505
505
|
</terms>
|
506
506
|
</clause>
|
507
507
|
<terms id="_" language="en" script="Latn" obligation="normative">
|
508
508
|
<title>Normal Terms</title>
|
509
509
|
<term id="term-term2">
|
510
|
-
<preferred>Term2</preferred>
|
510
|
+
<preferred><expression><name>Term2</name></expression></preferred>
|
511
511
|
</term>
|
512
512
|
</terms>
|
513
513
|
<definitions id="_" language="en" script="Latn" obligation="normative"><title>Symbols and abbreviated terms</title><clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
@@ -633,7 +633,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
633
633
|
<title>Terms and definitions</title>
|
634
634
|
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
635
635
|
<term id='term-term1'>
|
636
|
-
<preferred>Term1</preferred>
|
636
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
637
637
|
</term>
|
638
638
|
</terms>
|
639
639
|
<clause id='_' obligation='normative'>
|
@@ -642,7 +642,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
642
642
|
<terms id='_' obligation='normative'>
|
643
643
|
<title>Normal Terms</title>
|
644
644
|
<term id='term-term2'>
|
645
|
-
<preferred>Term2</preferred>
|
645
|
+
<preferred><expression><name>Term2</name></expression></preferred>
|
646
646
|
</term>
|
647
647
|
</terms>
|
648
648
|
<definitions id='_' obligation="normative" type="symbols">
|
@@ -704,7 +704,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
704
704
|
<title>Terms, definitions and symbols</title>
|
705
705
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
706
706
|
<term id='term-term'>
|
707
|
-
<preferred>Term</preferred>
|
707
|
+
<preferred><expression><name>Term</name></expression></preferred>
|
708
708
|
</term>
|
709
709
|
<definitions id='_' obligation="normative" type="symbols">
|
710
710
|
<title>Symbols</title>
|
@@ -736,7 +736,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
736
736
|
<title>Terms, definitions and abbreviated terms</title>
|
737
737
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
738
738
|
<term id='term-term'>
|
739
|
-
<preferred>Term</preferred>
|
739
|
+
<preferred><expression><name>Term</name></expression></preferred>
|
740
740
|
</term>
|
741
741
|
<definitions id='_' obligation="normative" type="abbreviated_terms">
|
742
742
|
<title>Abbreviated terms</title>
|
@@ -769,7 +769,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
769
769
|
<title>Terms, definitions, symbols and abbreviated terms</title>
|
770
770
|
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
771
771
|
<term id='term-term'>
|
772
|
-
<preferred>Term</preferred>
|
772
|
+
<preferred><expression><name>Term</name></expression></preferred>
|
773
773
|
</term>
|
774
774
|
<definitions id='_' type='abbreviated_terms' obligation='normative'>
|
775
775
|
<title>Abbreviated terms</title>
|
@@ -930,7 +930,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
930
930
|
<title>Terms and definitions</title><p id="_">For the purposes of this document, the terms and definitions
|
931
931
|
given in <eref bibitemid="iso1234"/> and <eref bibitemid="iso5678"/> and the following apply.</p>
|
932
932
|
<term id="term-term1">
|
933
|
-
<preferred>Term1</preferred>
|
933
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
934
934
|
</term>
|
935
935
|
</terms></sections>
|
936
936
|
</standard-document>
|
@@ -1136,8 +1136,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1136
1136
|
<terms id='terms-concepts' obligation='normative'>
|
1137
1137
|
<title>Basic concepts</title>
|
1138
1138
|
<term id='term-date'>
|
1139
|
-
<preferred>date</preferred>
|
1140
|
-
<definition>
|
1139
|
+
<preferred><expression><name>date</name></expression></preferred>
|
1140
|
+
<definition><verbaldefinition>
|
1141
1141
|
<p id='_'>
|
1142
1142
|
<em>time</em>
|
1143
1143
|
(
|
@@ -1152,7 +1152,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1152
1152
|
<xref target='term-time-scale'/>
|
1153
1153
|
)
|
1154
1154
|
</p>
|
1155
|
-
</definition>
|
1155
|
+
</verbaldefinition></definition>
|
1156
1156
|
</term>
|
1157
1157
|
</terms>
|
1158
1158
|
</clause>
|
@@ -1190,7 +1190,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
1190
1190
|
<terms id='t1' obligation='normative'>
|
1191
1191
|
<title>Terms and definitions</title>
|
1192
1192
|
<term id='t2'>
|
1193
|
-
<preferred>Term1</preferred>
|
1193
|
+
<preferred><expression><name>Term1</name></expression></preferred>
|
1194
1194
|
</term>
|
1195
1195
|
</terms>
|
1196
1196
|
</preface>
|
@@ -329,7 +329,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
329
329
|
INPUT
|
330
330
|
expect(File.read("test.err"))
|
331
331
|
.not_to include "does not match IEV 103-01-02"
|
332
|
-
FileUtils.mv File.expand_path("~/.iev.pstore1"),
|
332
|
+
FileUtils.mv File.expand_path("~/.iev.pstore1"),
|
333
|
+
File.expand_path("~/.iev/cache"), force: true
|
333
334
|
end
|
334
335
|
|
335
336
|
# it "No warning if attributes on formatted strong or stem extraneous to Metanomra XML" do
|
@@ -340,6 +341,31 @@ RSpec.describe Asciidoctor::Standoc do
|
|
340
341
|
# INPUT
|
341
342
|
# end
|
342
343
|
|
344
|
+
it "warns and aborts if concept attributes are malformed" do
|
345
|
+
FileUtils.rm_f "test.xml"
|
346
|
+
FileUtils.rm_f "test.err"
|
347
|
+
begin
|
348
|
+
input = <<~INPUT
|
349
|
+
= Document title
|
350
|
+
Author
|
351
|
+
:docfile: test.adoc
|
352
|
+
:nodoc:
|
353
|
+
|
354
|
+
== Symbols and Abbreviated Terms
|
355
|
+
[[def]]DEF:: def
|
356
|
+
|
357
|
+
{{<<def>>,term,option="noital"}}
|
358
|
+
INPUT
|
359
|
+
expect do
|
360
|
+
Asciidoctor.convert(input, *OPTIONS)
|
361
|
+
end.to raise_error(RuntimeError)
|
362
|
+
rescue SystemExit, RuntimeError
|
363
|
+
end
|
364
|
+
expect(File.read("test.err"))
|
365
|
+
.to include 'processing {{<<def>>,term,option="noital"}}: error processing ,term,option="noital" as CSV'
|
366
|
+
expect(File.exist?("test.xml")).to be false
|
367
|
+
end
|
368
|
+
|
343
369
|
it "warns and aborts if concept/xref does not point to term or definition" do
|
344
370
|
FileUtils.rm_f "test.xml"
|
345
371
|
FileUtils.rm_f "test.err"
|
@@ -373,6 +399,39 @@ RSpec.describe Asciidoctor::Standoc do
|
|
373
399
|
expect(File.exist?("test.xml")).to be false
|
374
400
|
end
|
375
401
|
|
402
|
+
it "warns and aborts if related/xref does not point to term or definition" do
|
403
|
+
FileUtils.rm_f "test.xml"
|
404
|
+
FileUtils.rm_f "test.err"
|
405
|
+
begin
|
406
|
+
input = <<~INPUT
|
407
|
+
= Document title
|
408
|
+
Author
|
409
|
+
:docfile: test.adoc
|
410
|
+
:nodoc:
|
411
|
+
|
412
|
+
[[abc]]
|
413
|
+
== Clause 1
|
414
|
+
[[ghi]]A:: B
|
415
|
+
|
416
|
+
== Symbols and Abbreviated Terms
|
417
|
+
[[def]]DEF:: def
|
418
|
+
|
419
|
+
related:see[<<abc>>,term]
|
420
|
+
related:see[<<def>>,term]
|
421
|
+
related:see[<<ghi>>,term]
|
422
|
+
INPUT
|
423
|
+
expect { Asciidoctor.convert(input, *OPTIONS) }.to raise_error(SystemExit)
|
424
|
+
rescue SystemExit
|
425
|
+
end
|
426
|
+
expect(File.read("test.err"))
|
427
|
+
.to include "Related term is pointing to abc, which is not a term or symbol"
|
428
|
+
expect(File.read("test.err"))
|
429
|
+
.not_to include "Related term is pointing to def, which is not a term or symbol"
|
430
|
+
expect(File.read("test.err"))
|
431
|
+
.to include "Related term is pointing to ghi, which is not a term or symbol"
|
432
|
+
expect(File.exist?("test.xml")).to be false
|
433
|
+
end
|
434
|
+
|
376
435
|
it "warns and aborts if id used twice" do
|
377
436
|
FileUtils.rm_f "test.xml"
|
378
437
|
FileUtils.rm_f "test.err"
|
@@ -467,4 +526,53 @@ RSpec.describe Asciidoctor::Standoc do
|
|
467
526
|
expect(File.read("test.err"))
|
468
527
|
.to include "Could not resolve footnoteblock:[id1]"
|
469
528
|
end
|
529
|
+
|
530
|
+
it "Warning if xref/@target does not point to a real identifier" do
|
531
|
+
FileUtils.rm_f "test.err"
|
532
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
533
|
+
= Document title
|
534
|
+
Author
|
535
|
+
:docfile: test.adoc
|
536
|
+
:no-pdf:
|
537
|
+
|
538
|
+
<<id1>>
|
539
|
+
|
540
|
+
[[id2]]
|
541
|
+
[NOTE]
|
542
|
+
--
|
543
|
+
|===
|
544
|
+
|a |b
|
545
|
+
|
546
|
+
|c |d
|
547
|
+
|===
|
548
|
+
|
549
|
+
* A
|
550
|
+
* B
|
551
|
+
* C
|
552
|
+
--
|
553
|
+
INPUT
|
554
|
+
expect(File.read("test.err"))
|
555
|
+
.to include "Crossreference target id1 is undefined"
|
556
|
+
end
|
557
|
+
|
558
|
+
it "Warning if metadata deflist not after a designation" do
|
559
|
+
FileUtils.rm_f "test.err"
|
560
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
561
|
+
= Document title
|
562
|
+
Author
|
563
|
+
:docfile: test.adoc
|
564
|
+
:no-pdf:
|
565
|
+
|
566
|
+
== Terms and definitions
|
567
|
+
|
568
|
+
=== Term 1
|
569
|
+
|
570
|
+
Definition
|
571
|
+
|
572
|
+
[%metadata]
|
573
|
+
language:: fr
|
574
|
+
INPUT
|
575
|
+
expect(File.read("test.err"))
|
576
|
+
.to include "Metadata definition list does not follow a term designation"
|
577
|
+
end
|
470
578
|
end
|