metanorma-standoc 1.8.6 → 1.9.2
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/.gitignore +2 -0
- data/.rubocop.yml +5 -3
- data/Gemfile.devel +0 -0
- data/lib/asciidoctor/standoc/base.rb +41 -36
- data/lib/asciidoctor/standoc/biblio.rng +4 -6
- data/lib/asciidoctor/standoc/blocks.rb +44 -14
- data/lib/asciidoctor/standoc/blocks_notes.rb +41 -24
- data/lib/asciidoctor/standoc/cleanup.rb +33 -78
- data/lib/asciidoctor/standoc/cleanup_block.rb +77 -62
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +51 -29
- data/lib/asciidoctor/standoc/cleanup_footnotes.rb +1 -0
- data/lib/asciidoctor/standoc/cleanup_image.rb +71 -0
- data/lib/asciidoctor/standoc/cleanup_maths.rb +37 -28
- data/lib/asciidoctor/standoc/cleanup_ref.rb +24 -15
- data/lib/asciidoctor/standoc/cleanup_ref_dl.rb +1 -1
- data/lib/asciidoctor/standoc/cleanup_reqt.rb +47 -0
- data/lib/asciidoctor/standoc/cleanup_section.rb +21 -15
- data/lib/asciidoctor/standoc/converter.rb +10 -3
- data/lib/asciidoctor/standoc/datamodel/plantuml_renderer.rb +67 -66
- data/lib/asciidoctor/standoc/front.rb +35 -18
- data/lib/asciidoctor/standoc/front_contributor.rb +5 -5
- data/lib/asciidoctor/standoc/inline.rb +1 -1
- data/lib/asciidoctor/standoc/isodoc.rng +304 -1
- data/lib/asciidoctor/standoc/lists.rb +4 -2
- data/lib/asciidoctor/standoc/macros.rb +50 -23
- data/lib/asciidoctor/standoc/macros_form.rb +63 -0
- data/lib/asciidoctor/standoc/ref.rb +87 -112
- data/lib/asciidoctor/standoc/ref_date_id.rb +62 -0
- data/lib/asciidoctor/standoc/ref_sect.rb +22 -19
- data/lib/asciidoctor/standoc/section.rb +3 -1
- data/lib/asciidoctor/standoc/terms.rb +27 -16
- data/lib/asciidoctor/standoc/utils.rb +35 -9
- data/lib/asciidoctor/standoc/validate.rb +30 -28
- data/lib/metanorma-standoc.rb +0 -1
- data/lib/metanorma/standoc/version.rb +5 -5
- data/metanorma-standoc.gemspec +11 -11
- data/spec/asciidoctor/base_spec.rb +78 -8
- data/spec/asciidoctor/blocks_spec.rb +832 -727
- data/spec/asciidoctor/cleanup_sections_spec.rb +52 -15
- data/spec/asciidoctor/cleanup_spec.rb +1860 -1874
- data/spec/asciidoctor/inline_spec.rb +272 -273
- data/spec/asciidoctor/isobib_cache_spec.rb +406 -358
- data/spec/asciidoctor/macros_spec.rb +539 -437
- data/spec/asciidoctor/macros_yaml2text_spec.rb +1 -1
- data/spec/asciidoctor/refs_spec.rb +135 -7
- data/spec/asciidoctor/section_spec.rb +743 -690
- data/spec/assets/html-override.css +1 -0
- data/spec/assets/word-override.css +1 -0
- data/spec/spec_helper.rb +11 -9
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +60 -60
- data/spec/vcr_cassettes/isobib_get_123.yml +14 -14
- data/spec/vcr_cassettes/isobib_get_123_1.yml +30 -30
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +42 -42
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +15 -15
- data/spec/vcr_cassettes/isobib_get_124.yml +15 -15
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +14 -14
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +53 -49
- metadata +72 -68
- data/.rubocop.ribose.yml +0 -66
- data/.rubocop.tb.yml +0 -650
- data/spec/asciidoctor/macros_lutaml_spec.rb +0 -80
@@ -3,7 +3,7 @@ require "relaton_iso"
|
|
3
3
|
require "relaton_ietf"
|
4
4
|
|
5
5
|
RSpec.describe Asciidoctor::Standoc do
|
6
|
-
|
6
|
+
it "processes simple ISO reference" do
|
7
7
|
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp( <<~"OUTPUT")
|
8
8
|
#{ASCIIDOC_BLANK_HDR}
|
9
9
|
[bibliography]
|
@@ -99,8 +99,8 @@ RSpec.describe Asciidoctor::Standoc do
|
|
99
99
|
end
|
100
100
|
|
101
101
|
it "repairs simple fetched ISO reference" do
|
102
|
-
mock_isobib_get_123_no_docid
|
103
|
-
mock_isobib_get_123_no_docid_lbl
|
102
|
+
mock_isobib_get_123_no_docid(2)
|
103
|
+
mock_isobib_get_123_no_docid_lbl(2)
|
104
104
|
input = <<~"INPUT"
|
105
105
|
#{ISOBIB_BLANK_HDR}
|
106
106
|
|
@@ -1770,6 +1770,134 @@ OUTPUT
|
|
1770
1770
|
OUTPUT
|
1771
1771
|
end
|
1772
1772
|
|
1773
|
+
it "overrides normative status of bibliographies" do
|
1774
|
+
mock_isobib_get_123_no_docid(1)
|
1775
|
+
mock_isobib_get_123_no_docid_lbl(1)
|
1776
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp( <<~"OUTPUT")
|
1777
|
+
#{ISOBIB_BLANK_HDR}
|
1778
|
+
[bibliography,normative=false]
|
1779
|
+
== Normative References
|
1780
|
+
|
1781
|
+
* [[[iso123,ISO 123]]] _Standard_
|
1782
|
+
|
1783
|
+
[bibliography,normative=true]
|
1784
|
+
== Bibliography
|
1785
|
+
|
1786
|
+
* [[[iso124,(1)ISO 123]]] _Standard_
|
1787
|
+
INPUT
|
1788
|
+
#{BLANK_HDR}
|
1789
|
+
<sections> </sections>
|
1790
|
+
<bibliography>
|
1791
|
+
<references id='_' normative='false' obligation='informative'>
|
1792
|
+
<title>Bibliography</title>
|
1793
|
+
<bibitem type='standard' id='iso123'>
|
1794
|
+
<uri type='src'>https://www.iso.org/standard/23281.html</uri>
|
1795
|
+
<uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
|
1796
|
+
<uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
|
1797
|
+
<date type='published'>
|
1798
|
+
<on>2001</on>
|
1799
|
+
</date>
|
1800
|
+
<contributor>
|
1801
|
+
<role type='publisher'/>
|
1802
|
+
<organization>
|
1803
|
+
<name>International Organization for Standardization</name>
|
1804
|
+
<abbreviation>ISO</abbreviation>
|
1805
|
+
<uri>www.iso.org</uri>
|
1806
|
+
</organization>
|
1807
|
+
</contributor>
|
1808
|
+
<edition>3</edition>
|
1809
|
+
<language>en</language>
|
1810
|
+
<language>fr</language>
|
1811
|
+
<script>Latn</script>
|
1812
|
+
<status>
|
1813
|
+
<stage>Published</stage>
|
1814
|
+
</status>
|
1815
|
+
<copyright>
|
1816
|
+
<from>2001</from>
|
1817
|
+
<owner>
|
1818
|
+
<organization>
|
1819
|
+
<name>ISO</name>
|
1820
|
+
<abbreviation/>
|
1821
|
+
</organization>
|
1822
|
+
</owner>
|
1823
|
+
</copyright>
|
1824
|
+
<relation type='obsoletes'>
|
1825
|
+
<bibitem type='standard'>
|
1826
|
+
<formattedref format='text/plain'>ISO 123:1985</formattedref>
|
1827
|
+
</bibitem>
|
1828
|
+
</relation>
|
1829
|
+
<relation type='updates'>
|
1830
|
+
<bibitem type='standard'>
|
1831
|
+
<formattedref format='text/plain'>ISO 123:2001</formattedref>
|
1832
|
+
</bibitem>
|
1833
|
+
</relation>
|
1834
|
+
<docidentifier>ISO 123</docidentifier>
|
1835
|
+
<title>
|
1836
|
+
<em>Standard</em>
|
1837
|
+
</title>
|
1838
|
+
</bibitem>
|
1839
|
+
</references>
|
1840
|
+
<references id='_' normative='true' obligation='informative'>
|
1841
|
+
<title>Normative references</title>
|
1842
|
+
<p id='_'>
|
1843
|
+
The following documents are referred to in the text in such a way that
|
1844
|
+
some or all of their content constitutes requirements of this document.
|
1845
|
+
For dated references, only the edition cited applies. For undated
|
1846
|
+
references, the latest edition of the referenced document (including any
|
1847
|
+
amendments) applies.
|
1848
|
+
</p>
|
1849
|
+
<bibitem type='standard' id='iso124'>
|
1850
|
+
<uri type='src'>https://www.iso.org/standard/23281.html</uri>
|
1851
|
+
<uri type='obp'>https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>
|
1852
|
+
<uri type='rss'>https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>
|
1853
|
+
<date type='published'>
|
1854
|
+
<on>2001</on>
|
1855
|
+
</date>
|
1856
|
+
<contributor>
|
1857
|
+
<role type='publisher'/>
|
1858
|
+
<organization>
|
1859
|
+
<name>International Organization for Standardization</name>
|
1860
|
+
<abbreviation>ISO</abbreviation>
|
1861
|
+
<uri>www.iso.org</uri>
|
1862
|
+
</organization>
|
1863
|
+
</contributor>
|
1864
|
+
<edition>3</edition>
|
1865
|
+
<language>en</language>
|
1866
|
+
<language>fr</language>
|
1867
|
+
<script>Latn</script>
|
1868
|
+
<status>
|
1869
|
+
<stage>Published</stage>
|
1870
|
+
</status>
|
1871
|
+
<copyright>
|
1872
|
+
<from>2001</from>
|
1873
|
+
<owner>
|
1874
|
+
<organization>
|
1875
|
+
<name>ISO</name>
|
1876
|
+
<abbreviation/>
|
1877
|
+
</organization>
|
1878
|
+
</owner>
|
1879
|
+
</copyright>
|
1880
|
+
<relation type='obsoletes'>
|
1881
|
+
<bibitem type='standard'>
|
1882
|
+
<formattedref format='text/plain'>ISO 123:1985</formattedref>
|
1883
|
+
</bibitem>
|
1884
|
+
</relation>
|
1885
|
+
<relation type='updates'>
|
1886
|
+
<bibitem type='standard'>
|
1887
|
+
<formattedref format='text/plain'>ISO 123:2001</formattedref>
|
1888
|
+
</bibitem>
|
1889
|
+
</relation>
|
1890
|
+
<docidentifier>ISO 123</docidentifier>
|
1891
|
+
<docidentifier type='metanorma'>[1]</docidentifier>
|
1892
|
+
<title>
|
1893
|
+
<em>Standard</em>
|
1894
|
+
</title>
|
1895
|
+
</bibitem>
|
1896
|
+
</references>
|
1897
|
+
</bibliography>
|
1898
|
+
</standard-document>
|
1899
|
+
OUTPUT
|
1900
|
+
end
|
1773
1901
|
|
1774
1902
|
private
|
1775
1903
|
|
@@ -1781,20 +1909,20 @@ OUTPUT
|
|
1781
1909
|
end
|
1782
1910
|
end
|
1783
1911
|
|
1784
|
-
def mock_isobib_get_123_no_docid
|
1912
|
+
def mock_isobib_get_123_no_docid(n)
|
1785
1913
|
expect(RelatonIso::IsoBibliography).to receive(:get).with("ISO 123", nil, {:lang=>"en", :title=>"<em>Standard</em>", usrlbl: nil}) do
|
1786
1914
|
RelatonBib::XMLParser.from_xml(<<~"OUTPUT")
|
1787
1915
|
<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</bibitem>
|
1788
1916
|
OUTPUT
|
1789
|
-
end.exactly(
|
1917
|
+
end.exactly(n).times
|
1790
1918
|
end
|
1791
1919
|
|
1792
|
-
def mock_isobib_get_123_no_docid_lbl
|
1920
|
+
def mock_isobib_get_123_no_docid_lbl(n)
|
1793
1921
|
expect(RelatonIso::IsoBibliography).to receive(:get).with("ISO 123", nil, {:lang=>"en", :title=>"<em>Standard</em>", usrlbl: "(1)"}) do
|
1794
1922
|
RelatonBib::XMLParser.from_xml(<<~"OUTPUT")
|
1795
1923
|
<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</bibitem>
|
1796
1924
|
OUTPUT
|
1797
|
-
end.exactly(
|
1925
|
+
end.exactly(n).times
|
1798
1926
|
end
|
1799
1927
|
|
1800
1928
|
def mock_isobib_get_124
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe Asciidoctor::Standoc do
|
4
4
|
it "processes sections" do
|
5
|
-
|
5
|
+
input = <<~INPUT
|
6
6
|
#{ASCIIDOC_BLANK_HDR}
|
7
7
|
.Foreword
|
8
8
|
|
@@ -18,7 +18,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
18
18
|
=== Introduction Subsection
|
19
19
|
|
20
20
|
== Acknowledgements
|
21
|
-
|
21
|
+
|
22
22
|
[.preface]
|
23
23
|
== Dedication
|
24
24
|
|
@@ -95,116 +95,115 @@ RSpec.describe Asciidoctor::Standoc do
|
|
95
95
|
[index,type=thematic]
|
96
96
|
== Thematic Index
|
97
97
|
INPUT
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
</
|
110
|
-
</
|
111
|
-
|
112
|
-
|
113
|
-
</
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
</
|
118
|
-
|
119
|
-
|
120
|
-
<
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
<
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
</
|
132
|
-
</
|
133
|
-
<clause id="_" obligation="normative"
|
134
|
-
<
|
135
|
-
<clause id="_" inline-header="false" obligation="normative">
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
</
|
141
|
-
<
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
</
|
147
|
-
<
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
</
|
154
|
-
|
155
|
-
</
|
156
|
-
<
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
</
|
161
|
-
</
|
162
|
-
|
163
|
-
|
164
|
-
</
|
165
|
-
|
166
|
-
|
167
|
-
</
|
168
|
-
|
169
|
-
|
170
|
-
</
|
171
|
-
|
172
|
-
|
173
|
-
</
|
174
|
-
|
175
|
-
|
176
|
-
</
|
177
|
-
|
178
|
-
|
179
|
-
</
|
180
|
-
|
181
|
-
</
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
</
|
187
|
-
|
188
|
-
|
189
|
-
</
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
</
|
194
|
-
</
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
</indexsect>
|
199
|
-
|
200
|
-
<title>Thematic Index</title>
|
201
|
-
</indexsect>
|
202
|
-
</standard-document>
|
98
|
+
output = <<~OUTPUT
|
99
|
+
#{BLANK_HDR.sub(/<status>/, '<abstract> <p>Text</p> </abstract><status>')}
|
100
|
+
<preface><abstract id="_">
|
101
|
+
<title>Abstract</title>
|
102
|
+
<p id="_">Text</p>
|
103
|
+
</abstract><foreword id='_' obligation="informative">
|
104
|
+
<title>Foreword</title>
|
105
|
+
<p id="_">Text</p>
|
106
|
+
</foreword><introduction id="_" obligation="informative">
|
107
|
+
<title>Introduction</title>
|
108
|
+
<clause id="_" inline-header="false" obligation="informative">
|
109
|
+
<title>Introduction Subsection</title>
|
110
|
+
</clause>
|
111
|
+
</introduction>
|
112
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
113
|
+
<title>Dedication</title>
|
114
|
+
</clause>
|
115
|
+
<acknowledgements id='_' obligation='informative'>
|
116
|
+
<title>Acknowledgements</title>
|
117
|
+
</acknowledgements>
|
118
|
+
</preface><sections>
|
119
|
+
<clause id="_" inline-header="false" obligation="normative" type="scope">
|
120
|
+
<title>Scope</title>
|
121
|
+
<p id="_">Text</p>
|
122
|
+
</clause>
|
123
|
+
<terms id="_" obligation="normative">
|
124
|
+
<title>Terms and definitions</title>
|
125
|
+
<p id="_">For the purposes of this document,
|
126
|
+
the following terms and definitions apply.</p>
|
127
|
+
<term id="term-term1">
|
128
|
+
<preferred>Term1</preferred>
|
129
|
+
</term>
|
130
|
+
</terms>
|
131
|
+
<clause id="_" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title>
|
132
|
+
<p id='_'>Boilerplate text</p>
|
133
|
+
<clause id="_" inline-header="false" obligation="normative">
|
134
|
+
<title>Introduction</title>
|
135
|
+
<clause id="_" inline-header="false" obligation="normative">
|
136
|
+
<title>Intro 1</title>
|
137
|
+
</clause>
|
138
|
+
</clause>
|
139
|
+
<terms id="_" obligation="normative">
|
140
|
+
<title>Intro 2</title>
|
141
|
+
<clause id="_" inline-header="false" obligation="normative">
|
142
|
+
<title>Intro 3</title>
|
143
|
+
</clause>
|
144
|
+
</terms>
|
145
|
+
<clause id="_" obligation="normative">
|
146
|
+
<title>Intro 4</title>
|
147
|
+
<terms id="_" obligation="normative">
|
148
|
+
<title>Intro 5</title>
|
149
|
+
<term id="term-term1-1">
|
150
|
+
<preferred>Term1</preferred>
|
151
|
+
</term>
|
152
|
+
</terms>
|
153
|
+
</clause>
|
154
|
+
<terms id="_" obligation="normative">
|
155
|
+
<title>Normal Terms</title>
|
156
|
+
<term id="term-term2">
|
157
|
+
<preferred>Term2</preferred>
|
158
|
+
</term>
|
159
|
+
</terms>
|
160
|
+
<definitions id="_" obligation="normative"><title>Symbols and abbreviated terms</title><clause id="_" inline-header="false" obligation="normative">
|
161
|
+
<title>General</title>
|
162
|
+
</clause>
|
163
|
+
<definitions id="_" obligation="normative" type="symbols">
|
164
|
+
<title>Symbols</title>
|
165
|
+
</definitions></definitions></clause>
|
166
|
+
<definitions id="_" obligation="normative" type="abbreviated_terms">
|
167
|
+
<title>Abbreviated terms</title>
|
168
|
+
</definitions>
|
169
|
+
<clause id="_" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="_" inline-header="false" obligation="normative">
|
170
|
+
<title>Introduction</title>
|
171
|
+
</clause>
|
172
|
+
<clause id="_" inline-header="false" obligation="normative">
|
173
|
+
<title>Clause 4.2</title>
|
174
|
+
</clause></clause>
|
175
|
+
<clause id="_" inline-header="false" obligation="normative">
|
176
|
+
<title>Terms and Definitions</title>
|
177
|
+
</clause>
|
178
|
+
</sections><annex id="_" inline-header="false" obligation="normative">
|
179
|
+
<title>Annex</title>
|
180
|
+
<clause id="_" inline-header="false" obligation="normative">
|
181
|
+
<title>Annex A.1</title>
|
182
|
+
</clause>
|
183
|
+
</annex><bibliography><references id="_" obligation="informative" normative="true">
|
184
|
+
<title>Normative references</title>
|
185
|
+
<p id="_">There are no normative references in this document.</p>
|
186
|
+
</references><clause id="_" obligation="informative">
|
187
|
+
<title>Bibliography</title>
|
188
|
+
<references id="_" obligation="informative" normative="false">
|
189
|
+
<title>Bibliography Subsection</title>
|
190
|
+
</references>
|
191
|
+
</clause></bibliography>
|
192
|
+
<indexsect id='_'>
|
193
|
+
<title>Index</title>
|
194
|
+
<p id='_'>This is an index</p>
|
195
|
+
</indexsect>
|
196
|
+
<indexsect id='_' type='thematic'>
|
197
|
+
<title>Thematic Index</title>
|
198
|
+
</indexsect>
|
199
|
+
</standard-document>
|
203
200
|
OUTPUT
|
201
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
|
202
|
+
.to be_equivalent_to xmlpp(output)
|
204
203
|
end
|
205
204
|
|
206
|
-
|
207
|
-
|
205
|
+
it "processes sections with number attributes" do
|
206
|
+
input = <<~INPUT
|
208
207
|
#{ASCIIDOC_BLANK_HDR}
|
209
208
|
[number=1bis]
|
210
209
|
== Scope
|
@@ -268,81 +267,84 @@ RSpec.describe Asciidoctor::Standoc do
|
|
268
267
|
[number=20bis]
|
269
268
|
=== Bibliography Subsection
|
270
269
|
INPUT
|
271
|
-
|
272
|
-
|
273
|
-
<
|
274
|
-
<
|
275
|
-
|
276
|
-
|
277
|
-
<terms id='_' number='3bis' obligation='normative'>
|
278
|
-
<title>Terms and definitions</title>
|
279
|
-
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
280
|
-
<term id='term-term1' number='4bis'>
|
281
|
-
<preferred>Term1</preferred>
|
282
|
-
</term>
|
283
|
-
</terms>
|
284
|
-
<terms id='_' number='5bis' obligation='normative'>
|
285
|
-
<title>Terms, definitions, symbols and abbreviated terms</title>
|
286
|
-
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
287
|
-
<clause id='_' number='6bis' inline-header='false' obligation='normative'>
|
288
|
-
<title>Introduction</title>
|
289
|
-
<clause id='_' number='7bis' inline-header='false' obligation='normative'>
|
290
|
-
<title>Intro 1</title>
|
291
|
-
</clause>
|
270
|
+
output = <<~OUTPUT
|
271
|
+
#{BLANK_HDR}
|
272
|
+
<sections>
|
273
|
+
<clause id='_' number='1bis' type='scope' inline-header='false' obligation='normative'>
|
274
|
+
<title>Scope</title>
|
275
|
+
<p id='_'>Text</p>
|
292
276
|
</clause>
|
293
|
-
<
|
294
|
-
<
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
277
|
+
<terms id='_' number='3bis' obligation='normative'>
|
278
|
+
<title>Terms and definitions</title>
|
279
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
280
|
+
<term id='term-term1' number='4bis'>
|
281
|
+
<preferred>Term1</preferred>
|
282
|
+
</term>
|
283
|
+
</terms>
|
284
|
+
<terms id='_' number='5bis' obligation='normative'>
|
285
|
+
<title>Terms, definitions, symbols and abbreviated terms</title>
|
286
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
287
|
+
<clause id='_' number='6bis' inline-header='false' obligation='normative'>
|
288
|
+
<title>Introduction</title>
|
289
|
+
<clause id='_' number='7bis' inline-header='false' obligation='normative'>
|
290
|
+
<title>Intro 1</title>
|
291
|
+
</clause>
|
300
292
|
</clause>
|
301
|
-
<
|
302
|
-
<
|
293
|
+
<term id='term-intro-2' number='8bis'>
|
294
|
+
<preferred>Intro 2</preferred>
|
295
|
+
</term>
|
296
|
+
<definitions id='_' number='9bis' obligation='normative'>
|
297
|
+
<title>Symbols and abbreviated terms</title>
|
298
|
+
<clause id='_' number='10bis' inline-header='false' obligation='normative'>
|
299
|
+
<title>General</title>
|
300
|
+
</clause>
|
301
|
+
<definitions id='_' number='11bis' type='symbols' obligation='normative'>
|
302
|
+
<title>Symbols</title>
|
303
|
+
</definitions>
|
303
304
|
</definitions>
|
305
|
+
</terms>
|
306
|
+
<definitions id='_' number='12bis' type='abbreviated_terms' obligation='normative'>
|
307
|
+
<title>Abbreviated terms</title>
|
304
308
|
</definitions>
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
309
|
+
<clause id='_' number='13bis' inline-header='false' obligation='normative'>
|
310
|
+
<title>Clause 4</title>
|
311
|
+
<clause id='_' number='14bis' inline-header='false' obligation='normative'>
|
312
|
+
<title>Introduction</title>
|
313
|
+
</clause>
|
314
|
+
<clause id='_' number='15bis' inline-header='false' obligation='normative'>
|
315
|
+
<title>Clause 4.2</title>
|
316
|
+
</clause>
|
313
317
|
</clause>
|
314
|
-
<clause id='_' number='
|
315
|
-
<title>
|
318
|
+
<clause id='_' number='16bis' inline-header='false' obligation='normative'>
|
319
|
+
<title>Terms and Definitions</title>
|
316
320
|
</clause>
|
317
|
-
</
|
318
|
-
<
|
319
|
-
<title>
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
<
|
325
|
-
<
|
326
|
-
|
327
|
-
|
328
|
-
<bibliography>
|
329
|
-
<references id='_' number='2bis' normative='true' obligation='informative'>
|
330
|
-
<title>Normative references</title>
|
331
|
-
<p id='_'>There are no normative references in this document.</p>
|
332
|
-
</references>
|
333
|
-
<clause id='_' number='19bis' obligation='informative'>
|
334
|
-
<title>Bibliography</title>
|
335
|
-
<references id='_' number='20bis' normative='false' obligation='informative'>
|
336
|
-
<title>Bibliography Subsection</title>
|
321
|
+
</sections>
|
322
|
+
<annex id='_' number='17bis' inline-header='false' obligation='normative'>
|
323
|
+
<title>Annex</title>
|
324
|
+
<clause id='_' number='18bis' inline-header='false' obligation='normative'>
|
325
|
+
<title>Annex A.1</title>
|
326
|
+
</clause>
|
327
|
+
</annex>
|
328
|
+
<bibliography>
|
329
|
+
<references id='_' number='2bis' normative='true' obligation='informative'>
|
330
|
+
<title>Normative references</title>
|
331
|
+
<p id='_'>There are no normative references in this document.</p>
|
337
332
|
</references>
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
333
|
+
<clause id='_' number='19bis' obligation='informative'>
|
334
|
+
<title>Bibliography</title>
|
335
|
+
<references id='_' number='20bis' normative='false' obligation='informative'>
|
336
|
+
<title>Bibliography Subsection</title>
|
337
|
+
</references>
|
338
|
+
</clause>
|
339
|
+
</bibliography>
|
340
|
+
</standard-document>
|
341
|
+
OUTPUT
|
342
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
|
343
|
+
.to be_equivalent_to xmlpp(output)
|
344
|
+
end
|
343
345
|
|
344
|
-
|
345
|
-
|
346
|
+
it "processes sections with language and script attributes" do
|
347
|
+
input = <<~INPUT
|
346
348
|
#{ASCIIDOC_BLANK_HDR}
|
347
349
|
[language=en,script=Latn]
|
348
350
|
== Foreword
|
@@ -446,109 +448,108 @@ RSpec.describe Asciidoctor::Standoc do
|
|
446
448
|
[language=en,script=Latn]
|
447
449
|
=== Bibliography Subsection
|
448
450
|
INPUT
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
</
|
465
|
-
|
466
|
-
|
467
|
-
</
|
468
|
-
</
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
<clause id="_"
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
</references>
|
545
|
-
</clause></bibliography>
|
546
|
-
</standard-document>
|
451
|
+
output = <<~OUTPUT
|
452
|
+
#{BLANK_HDR.sub(/<status>/, '<abstract> <p>Text</p> </abstract><status>')}
|
453
|
+
<preface><abstract id="_" language="en" script="Latn">
|
454
|
+
<title>Abstract</title>
|
455
|
+
<p id="_">Text</p>
|
456
|
+
</abstract><foreword id='_' language='en' script='Latn' obligation='informative'>
|
457
|
+
<title>Foreword</title>
|
458
|
+
<p id="_">Text</p>
|
459
|
+
</foreword><introduction id="_" language="en" script="Latn" obligation="informative">
|
460
|
+
<title>Introduction</title>
|
461
|
+
<clause id="_" language="en" script="Latn" inline-header="false" obligation="informative">
|
462
|
+
<title>Introduction Subsection</title>
|
463
|
+
</clause>
|
464
|
+
</introduction>
|
465
|
+
<clause id='_' language='en' script='Latn' inline-header='false' obligation='informative'>
|
466
|
+
<title>Dedication</title>
|
467
|
+
</clause>
|
468
|
+
<acknowledgements id='_' language='en' script='Latn' obligation='informative'>
|
469
|
+
<title>Acknowledgements</title>
|
470
|
+
</acknowledgements>
|
471
|
+
</preface><sections>
|
472
|
+
<clause id="_" language="en" script="Latn" inline-header="false" obligation="normative" type="scope">
|
473
|
+
<title>Scope</title>
|
474
|
+
<p id="_">Text</p>
|
475
|
+
</clause>
|
476
|
+
<terms id="_" language="en" script="Latn" obligation="normative">
|
477
|
+
<title>Terms and definitions</title>
|
478
|
+
<p id="_">For the purposes of this document,
|
479
|
+
the following terms and definitions apply.</p>
|
480
|
+
<term id="term-term1" language="en" script="Latn">
|
481
|
+
<preferred>Term1</preferred>
|
482
|
+
</term>
|
483
|
+
</terms>
|
484
|
+
<clause id="_" language="en" script="Latn" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title>
|
485
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
486
|
+
<clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
487
|
+
<title>Introduction</title>
|
488
|
+
<clause id="_" inline-header="false" obligation="normative">
|
489
|
+
<title>Intro 1</title>
|
490
|
+
</clause>
|
491
|
+
</clause>
|
492
|
+
<terms id="_" language="en" script="Latn" obligation="normative">
|
493
|
+
<title>Intro 2</title>
|
494
|
+
<clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
495
|
+
<title>Intro 3</title>
|
496
|
+
</clause>
|
497
|
+
</terms>
|
498
|
+
<clause id="_" language="en" script="Latn" obligation="normative">
|
499
|
+
<title>Intro 4</title>
|
500
|
+
<terms id="_" language="en" script="Latn" obligation="normative">
|
501
|
+
<title>Intro 5</title>
|
502
|
+
<term id="term-term1-1">
|
503
|
+
<preferred>Term1</preferred>
|
504
|
+
</term>
|
505
|
+
</terms>
|
506
|
+
</clause>
|
507
|
+
<terms id="_" language="en" script="Latn" obligation="normative">
|
508
|
+
<title>Normal Terms</title>
|
509
|
+
<term id="term-term2">
|
510
|
+
<preferred>Term2</preferred>
|
511
|
+
</term>
|
512
|
+
</terms>
|
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">
|
514
|
+
<title>General</title>
|
515
|
+
</clause>
|
516
|
+
<definitions id="_" obligation="normative" type="symbols">
|
517
|
+
<title>Symbols</title>
|
518
|
+
</definitions></definitions></clause>
|
519
|
+
<definitions id="_" language="en" script="Latn" obligation="normative" type="abbreviated_terms">
|
520
|
+
<title>Abbreviated terms</title>
|
521
|
+
</definitions>
|
522
|
+
<clause id="_" language="en" script="Latn" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
523
|
+
<title>Introduction</title>
|
524
|
+
</clause>
|
525
|
+
<clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
526
|
+
<title>Clause 4.2</title>
|
527
|
+
</clause></clause>
|
528
|
+
<clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
529
|
+
<title>Terms and Definitions</title>
|
530
|
+
</clause>
|
531
|
+
</sections><annex id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
532
|
+
<title>Annex</title>
|
533
|
+
<clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
534
|
+
<title>Annex A.1</title>
|
535
|
+
</clause>
|
536
|
+
</annex><bibliography><references id="_" language="en" script="Latn" obligation="informative" normative="true">
|
537
|
+
<title>Normative references</title>
|
538
|
+
<p id="_">There are no normative references in this document.</p>
|
539
|
+
</references><clause id="_" language="en" script="Latn" obligation="informative">
|
540
|
+
<title>Bibliography</title>
|
541
|
+
<references id="_" language="en" script="Latn" obligation="informative" normative="false">
|
542
|
+
<title>Bibliography Subsection</title>
|
543
|
+
</references>
|
544
|
+
</clause></bibliography>
|
545
|
+
</standard-document>
|
547
546
|
OUTPUT
|
548
|
-
|
547
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
|
548
|
+
.to be_equivalent_to xmlpp(output)
|
549
|
+
end
|
549
550
|
|
550
551
|
it "processes sections with title and type attributes" do
|
551
|
-
|
552
|
+
input = <<~INPUT
|
552
553
|
#{ASCIIDOC_BLANK_HDR}
|
553
554
|
.Foreword
|
554
555
|
|
@@ -606,84 +607,87 @@ RSpec.describe Asciidoctor::Standoc do
|
|
606
607
|
|
607
608
|
=== Bibliography Subsection
|
608
609
|
INPUT
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
</
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
</
|
610
|
+
output = <<~OUTPUT
|
611
|
+
#{BLANK_HDR.sub(/<status>/, '<abstract> <p>Text</p> </abstract><status>')}
|
612
|
+
<preface>
|
613
|
+
<abstract id='_'>
|
614
|
+
<title>Abstract</title>
|
615
|
+
<p id='_'>Text</p>
|
616
|
+
</abstract>
|
617
|
+
<foreword id='_' obligation='informative'>
|
618
|
+
<title>Foreword</title>
|
619
|
+
<p id='_'>Text</p>
|
620
|
+
</foreword>
|
621
|
+
<introduction id='_' obligation='informative'>
|
622
|
+
<title>Introduction</title>
|
623
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
624
|
+
<title>Introduction Subsection</title>
|
625
|
+
</clause>
|
626
|
+
</introduction>
|
627
|
+
<acknowledgements id='_' obligation='informative'>
|
628
|
+
<title>Acknowledgements</title>
|
629
|
+
</acknowledgements>
|
630
|
+
</preface>
|
631
|
+
<sections>
|
632
|
+
<terms id='_' obligation='normative'>
|
633
|
+
<title>Terms and definitions</title>
|
634
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
635
|
+
<term id='term-term1'>
|
636
|
+
<preferred>Term1</preferred>
|
637
|
+
</term>
|
638
|
+
</terms>
|
639
|
+
<clause id='_' obligation='normative'>
|
640
|
+
<title>Terms, definitions and symbols</title>
|
641
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
642
|
+
<terms id='_' obligation='normative'>
|
643
|
+
<title>Normal Terms</title>
|
644
|
+
<term id='term-term2'>
|
645
|
+
<preferred>Term2</preferred>
|
646
|
+
</term>
|
647
|
+
</terms>
|
648
|
+
<definitions id='_' obligation="normative" type="symbols">
|
649
|
+
<title>Symbols</title>
|
650
|
+
</definitions>
|
651
|
+
</clause>
|
652
|
+
<definitions id='_' obligation="normative" type="abbreviated_terms">
|
653
|
+
<title>Abbreviated terms</title>
|
654
|
+
</definitions>
|
655
|
+
<clause id='_' inline-header='false' obligation='normative' type="ABC">
|
656
|
+
<title>Clause 4</title>
|
657
|
+
<clause id='_' inline-header='false' obligation='normative' type="DEF">
|
658
|
+
<title>Introduction</title>
|
659
|
+
</clause>
|
660
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
661
|
+
<title>Clause 4.2</title>
|
662
|
+
</clause>
|
663
|
+
</clause>
|
664
|
+
</sections>
|
665
|
+
<annex id='_' inline-header='false' obligation='normative'>
|
666
|
+
<title>Annex</title>
|
667
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
668
|
+
<title>Annex A.1</title>
|
669
|
+
</clause>
|
670
|
+
</annex>
|
671
|
+
<bibliography>
|
672
|
+
<references id='_' obligation='informative' normative="true">
|
673
|
+
<title>Normative references</title>
|
674
|
+
<p id="_">There are no normative references in this document.</p>
|
675
|
+
</references>
|
676
|
+
<clause id='_' obligation='informative'>
|
677
|
+
<title>Bibliography</title>
|
678
|
+
<references id='_' obligation='informative' normative="false">
|
679
|
+
<title>Bibliography Subsection</title>
|
680
|
+
</references>
|
681
|
+
</clause>
|
682
|
+
</bibliography>
|
683
|
+
</standard-document>
|
682
684
|
OUTPUT
|
685
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
|
686
|
+
.to be_equivalent_to xmlpp(output)
|
683
687
|
end
|
684
688
|
|
685
689
|
it "varies terms & symbols title" do
|
686
|
-
|
690
|
+
input = <<~INPUT
|
687
691
|
#{ASCIIDOC_BLANK_HDR}
|
688
692
|
[heading="terms, definitions, symbols and abbreviated terms"]
|
689
693
|
== Terms, Definitions, Symbols Section
|
@@ -692,56 +696,61 @@ RSpec.describe Asciidoctor::Standoc do
|
|
692
696
|
|
693
697
|
=== Symbols
|
694
698
|
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
</
|
710
|
-
|
711
|
-
|
699
|
+
INPUT
|
700
|
+
output = <<~OUTPUT
|
701
|
+
#{BLANK_HDR}
|
702
|
+
<sections>
|
703
|
+
<terms id='_' obligation='normative'>
|
704
|
+
<title>Terms, definitions and symbols</title>
|
705
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
706
|
+
<term id='term-term'>
|
707
|
+
<preferred>Term</preferred>
|
708
|
+
</term>
|
709
|
+
<definitions id='_' obligation="normative" type="symbols">
|
710
|
+
<title>Symbols</title>
|
711
|
+
</definitions>
|
712
|
+
</terms>
|
713
|
+
</sections>
|
714
|
+
</standard-document>
|
715
|
+
OUTPUT
|
716
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
|
717
|
+
.to be_equivalent_to xmlpp(output)
|
718
|
+
end
|
712
719
|
|
713
720
|
it "varies terms & abbreviated terms title" do
|
714
|
-
|
721
|
+
input = <<~INPUT
|
715
722
|
#{ASCIIDOC_BLANK_HDR}
|
716
723
|
[heading="terms, definitions, symbols and abbreviated terms"]
|
717
724
|
== Terms, Definitions, Abbreviated Terms Section
|
718
725
|
|
719
726
|
=== Term
|
720
|
-
|
727
|
+
|
721
728
|
[heading="abbreviated terms"]
|
722
729
|
=== Symbols
|
723
730
|
|
724
|
-
|
731
|
+
INPUT
|
732
|
+
output = <<~OUTPUT
|
725
733
|
#{BLANK_HDR}
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
</standard-document>
|
739
|
-
|
740
|
-
|
741
|
-
|
734
|
+
<sections>
|
735
|
+
<terms id='_' obligation='normative'>
|
736
|
+
<title>Terms, definitions and abbreviated terms</title>
|
737
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
738
|
+
<term id='term-term'>
|
739
|
+
<preferred>Term</preferred>
|
740
|
+
</term>
|
741
|
+
<definitions id='_' obligation="normative" type="abbreviated_terms">
|
742
|
+
<title>Abbreviated terms</title>
|
743
|
+
</definitions>
|
744
|
+
</terms>
|
745
|
+
</sections>
|
746
|
+
</standard-document>
|
747
|
+
OUTPUT
|
748
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
|
749
|
+
.to be_equivalent_to xmlpp(output)
|
750
|
+
end
|
742
751
|
|
743
752
|
it "processes section obligations" do
|
744
|
-
|
753
|
+
input = <<~INPUT
|
745
754
|
#{ASCIIDOC_BLANK_HDR}
|
746
755
|
[obligation=informative]
|
747
756
|
== Clause 1
|
@@ -753,26 +762,29 @@ RSpec.describe Asciidoctor::Standoc do
|
|
753
762
|
|
754
763
|
[appendix,obligation=informative]
|
755
764
|
== Annex
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
765
|
+
INPUT
|
766
|
+
output = <<~OUTPUT
|
767
|
+
#{BLANK_HDR}
|
768
|
+
<sections><clause id="_" inline-header="false" obligation="informative">
|
769
|
+
<title>Clause 1</title>
|
770
|
+
<clause id="_" inline-header="false" obligation="informative">
|
771
|
+
<title>Clause 1a</title>
|
772
|
+
</clause>
|
773
|
+
</clause>
|
774
|
+
<clause id="_" inline-header="false" obligation="normative">
|
775
|
+
<title>Clause 2</title>
|
776
|
+
</clause>
|
777
|
+
</sections><annex id="_" inline-header="false" obligation="informative">
|
778
|
+
<title>Annex</title>
|
779
|
+
</annex>
|
780
|
+
</standard-document>
|
781
|
+
OUTPUT
|
782
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
|
783
|
+
.to be_equivalent_to xmlpp(output)
|
772
784
|
end
|
773
785
|
|
774
|
-
|
775
|
-
|
786
|
+
it "processes inline headers" do
|
787
|
+
input = <<~INPUT
|
776
788
|
#{ASCIIDOC_BLANK_HDR}
|
777
789
|
== Clause 1
|
778
790
|
|
@@ -784,46 +796,52 @@ RSpec.describe Asciidoctor::Standoc do
|
|
784
796
|
|
785
797
|
[%inline-header]
|
786
798
|
=== Clause Aa
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
799
|
+
INPUT
|
800
|
+
output = <<~OUTPUT
|
801
|
+
#{BLANK_HDR}
|
802
|
+
<sections><clause id="_" inline-header="false" obligation="normative">
|
803
|
+
<title>Clause 1</title>
|
804
|
+
<clause id="_" inline-header="true" obligation="normative">
|
805
|
+
<title>Clause 1a</title>
|
806
|
+
</clause>
|
807
|
+
</clause>
|
808
|
+
</sections><annex id="_" inline-header="false" obligation="normative">
|
809
|
+
<title>Annex A</title>
|
810
|
+
<clause id="_" inline-header="true" obligation="normative">
|
811
|
+
<title>Clause Aa</title>
|
812
|
+
</clause>
|
813
|
+
</annex>
|
814
|
+
</standard-document>
|
815
|
+
OUTPUT
|
816
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
|
817
|
+
.to be_equivalent_to xmlpp(output)
|
818
|
+
end
|
804
819
|
|
805
820
|
it "processes blank headers" do
|
806
|
-
|
821
|
+
input = <<~INPUT
|
807
822
|
#{ASCIIDOC_BLANK_HDR}
|
808
823
|
== Clause 1
|
809
824
|
|
810
825
|
=== {blank}
|
811
826
|
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
827
|
+
INPUT
|
828
|
+
output = <<~OUTPUT
|
829
|
+
#{BLANK_HDR}
|
830
|
+
<sections>
|
831
|
+
<clause id="_" inline-header="false" obligation="normative">
|
832
|
+
<title>Clause 1</title>
|
833
|
+
<clause id="_" inline-header="false" obligation="normative">
|
834
|
+
</clause>
|
835
|
+
</clause>
|
836
|
+
</sections>
|
837
|
+
</standard-document>
|
838
|
+
OUTPUT
|
839
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
|
840
|
+
.to be_equivalent_to xmlpp(output)
|
823
841
|
end
|
824
842
|
|
825
|
-
|
826
|
-
|
843
|
+
it "processes terminal nodes in terms with term subsection names" do
|
844
|
+
input = <<~INPUT
|
827
845
|
#{ASCIIDOC_BLANK_HDR}
|
828
846
|
|
829
847
|
== Terms, definitions, symbols and abbreviated terms
|
@@ -832,27 +850,29 @@ RSpec.describe Asciidoctor::Standoc do
|
|
832
850
|
|
833
851
|
=== Symbols
|
834
852
|
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
</
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
853
|
+
INPUT
|
854
|
+
output = <<~OUTPUT
|
855
|
+
#{BLANK_HDR}
|
856
|
+
<sections>
|
857
|
+
<terms id='_' obligation='normative'>
|
858
|
+
<title>Terms, definitions and symbols</title>
|
859
|
+
<p id='_'>No terms and definitions are listed in this document.</p>
|
860
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
861
|
+
<title>Terms and definitions</title>
|
862
|
+
</clause>
|
863
|
+
<definitions id='_' obligation="normative" type="symbols">
|
864
|
+
<title>Symbols</title>
|
865
|
+
</definitions>
|
866
|
+
</terms>
|
867
|
+
</sections>
|
868
|
+
</standard-document>
|
869
|
+
OUTPUT
|
870
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
|
871
|
+
.to be_equivalent_to xmlpp(output)
|
872
|
+
end
|
873
|
+
|
874
|
+
it "processes terms & definitions with external source" do
|
875
|
+
input = <<~INPUT
|
856
876
|
#{ASCIIDOC_BLANK_HDR}
|
857
877
|
|
858
878
|
Foreword
|
@@ -862,27 +882,29 @@ RSpec.describe Asciidoctor::Standoc do
|
|
862
882
|
|
863
883
|
=== Term1
|
864
884
|
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
</
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
885
|
+
INPUT
|
886
|
+
output = <<~OUTPUT
|
887
|
+
#{BLANK_HDR}
|
888
|
+
<termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/>
|
889
|
+
<preface><foreword id='_' obligation="informative">
|
890
|
+
<title>Foreword</title>
|
891
|
+
<p id="_">Foreword</p>
|
892
|
+
</foreword></preface><sections>
|
893
|
+
<terms id="_" obligation="normative">
|
894
|
+
<title>Terms and definitions</title><p id="_">For the purposes of this document, the terms and definitions
|
895
|
+
given in <eref bibitemid="iso1234"/> and <eref bibitemid="iso5678"/> and the following apply.</p>
|
896
|
+
<term id="term-term1">
|
897
|
+
<preferred>Term1</preferred>
|
898
|
+
</term>
|
899
|
+
</terms></sections>
|
900
|
+
</standard-document>
|
901
|
+
OUTPUT
|
902
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
|
903
|
+
.to be_equivalent_to xmlpp(output)
|
904
|
+
end
|
905
|
+
|
906
|
+
it "processes empty terms & definitions" do
|
907
|
+
input = <<~INPUT
|
886
908
|
#{ASCIIDOC_BLANK_HDR}
|
887
909
|
|
888
910
|
Foreword
|
@@ -890,23 +912,25 @@ RSpec.describe Asciidoctor::Standoc do
|
|
890
912
|
== Terms and Definitions
|
891
913
|
|
892
914
|
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
OUTPUT
|
905
|
-
end
|
915
|
+
INPUT
|
916
|
+
output = <<~OUTPUT
|
917
|
+
#{BLANK_HDR}
|
918
|
+
<preface><foreword id='_' obligation="informative">
|
919
|
+
<title>Foreword</title>
|
920
|
+
<p id="_">Foreword</p>
|
921
|
+
</foreword></preface><sections>
|
922
|
+
<terms id="_" obligation="normative">
|
923
|
+
<title>Terms and definitions</title><p id="_">No terms and definitions are listed in this document.</p>
|
924
|
+
</terms></sections>
|
925
|
+
</standard-document>
|
906
926
|
|
927
|
+
OUTPUT
|
928
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
|
929
|
+
.to be_equivalent_to xmlpp(output)
|
930
|
+
end
|
907
931
|
|
908
|
-
|
909
|
-
|
932
|
+
it "processes empty terms & definitions with external source" do
|
933
|
+
input = <<~INPUT
|
910
934
|
#{ASCIIDOC_BLANK_HDR}
|
911
935
|
|
912
936
|
Foreword
|
@@ -914,27 +938,27 @@ RSpec.describe Asciidoctor::Standoc do
|
|
914
938
|
[source="iso1234,iso5678"]
|
915
939
|
== Terms and Definitions
|
916
940
|
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
941
|
+
INPUT
|
942
|
+
output = <<~OUTPUT
|
943
|
+
#{BLANK_HDR}
|
944
|
+
<termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/>
|
945
|
+
<preface><foreword id='_' obligation="informative">
|
946
|
+
<title>Foreword</title>
|
947
|
+
<p id="_">Foreword</p>
|
948
|
+
</foreword></preface><sections>
|
949
|
+
<terms id="_" obligation="normative">
|
950
|
+
<title>Terms and definitions</title>
|
951
|
+
<p id="_">For the purposes of this document,
|
952
|
+
the terms and definitions given in <eref bibitemid="iso1234"/> and <eref bibitemid="iso5678"/> apply.</p>
|
953
|
+
</terms></sections>
|
954
|
+
</standard-document>
|
955
|
+
OUTPUT
|
956
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
|
957
|
+
.to be_equivalent_to xmlpp(output)
|
958
|
+
end
|
935
959
|
|
936
|
-
|
937
|
-
|
960
|
+
it "processes term document sources in French" do
|
961
|
+
input = <<~INPUT
|
938
962
|
= Document title
|
939
963
|
Author
|
940
964
|
:docfile: test.adoc
|
@@ -948,26 +972,26 @@ RSpec.describe Asciidoctor::Standoc do
|
|
948
972
|
[source="iso1234,iso5678"]
|
949
973
|
== Terms and Definitions
|
950
974
|
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
<
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
975
|
+
INPUT
|
976
|
+
output = <<~OUTPUT
|
977
|
+
#{BLANK_HDR.sub(%r{<language>en</language>}, '<language>fr</language>')}
|
978
|
+
<termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/>
|
979
|
+
<preface><foreword id='_' obligation="informative">
|
980
|
+
<title>Avant-propos</title>
|
981
|
+
<p id="_">Foreword</p>
|
982
|
+
</foreword></preface><sections>
|
983
|
+
<terms id="_" obligation="normative">
|
984
|
+
<title>Terms et définitions</title>
|
985
|
+
<p id="_">Pour les besoins du présent document, les termes et définitions de <eref bibitemid="iso1234"/> et <eref bibitemid="iso5678"/> s’appliquent.</p>
|
986
|
+
</terms></sections>
|
987
|
+
</standard-document>
|
988
|
+
OUTPUT
|
989
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
|
990
|
+
.to be_equivalent_to xmlpp(output)
|
991
|
+
end
|
968
992
|
|
969
|
-
|
970
|
-
|
993
|
+
it "processes term document sources in Chinese" do
|
994
|
+
input = <<~INPUT
|
971
995
|
= Document title
|
972
996
|
Author
|
973
997
|
:docfile: test.adoc
|
@@ -982,163 +1006,192 @@ RSpec.describe Asciidoctor::Standoc do
|
|
982
1006
|
[source="iso1234,iso5678"]
|
983
1007
|
== Terms and Definitions
|
984
1008
|
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
===
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
</
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
<
|
1075
|
-
|
1076
|
-
<
|
1077
|
-
<
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
</
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
[
|
1112
|
-
[[
|
1113
|
-
==
|
1114
|
-
|
1115
|
-
[
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
</
|
1141
|
-
|
1142
|
-
|
1009
|
+
INPUT
|
1010
|
+
output = <<~OUTPUT
|
1011
|
+
#{BLANK_HDR.sub(%r{<language>en</language>}, '<language>zh</language>').sub(%r{<script>Latn</script>}, '<script>Hans</script>')}
|
1012
|
+
<termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/><preface><foreword id='_' obligation="informative">
|
1013
|
+
<title>前言</title>
|
1014
|
+
<p id="_">Foreword</p>
|
1015
|
+
</foreword></preface><sections>
|
1016
|
+
<terms id="_" obligation="normative">
|
1017
|
+
<title>术语和定义</title><p id="_"><eref bibitemid="iso1234"/>和<eref bibitemid="iso5678"/>界定的术语和定义适用于本文件。</p>
|
1018
|
+
</terms></sections>
|
1019
|
+
</standard-document>
|
1020
|
+
OUTPUT
|
1021
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
|
1022
|
+
.to be_equivalent_to xmlpp(output)
|
1023
|
+
end
|
1024
|
+
|
1025
|
+
it "warn about external source for terms & definitions that does not point anywhere" do
|
1026
|
+
input = <<~INPUT
|
1027
|
+
#{ASCIIDOC_BLANK_HDR}
|
1028
|
+
|
1029
|
+
[source="iso712"]
|
1030
|
+
== Terms and Definitions
|
1031
|
+
=== Term2
|
1032
|
+
INPUT
|
1033
|
+
expect { Asciidoctor.convert(input, backend: :standoc, header_footer: true) }
|
1034
|
+
.to output(/not referenced/).to_stderr
|
1035
|
+
end
|
1036
|
+
|
1037
|
+
it "treats terminal terms subclause named as terms clause as a normal clause" do
|
1038
|
+
input = <<~INPUT
|
1039
|
+
#{ASCIIDOC_BLANK_HDR}
|
1040
|
+
[[tda]]
|
1041
|
+
== Terms, definitions, symbols and abbreviations
|
1042
|
+
|
1043
|
+
[[terms]]
|
1044
|
+
=== Terms and definitions
|
1045
|
+
|
1046
|
+
=== Symbols
|
1047
|
+
|
1048
|
+
INPUT
|
1049
|
+
output = <<~OUTPUT
|
1050
|
+
#{BLANK_HDR}
|
1051
|
+
<sections>
|
1052
|
+
<terms id='tda' obligation='normative'>
|
1053
|
+
<title>Terms, definitions and symbols</title>
|
1054
|
+
<p id='_'>No terms and definitions are listed in this document.</p>
|
1055
|
+
<clause id='terms' inline-header='false' obligation='normative'>
|
1056
|
+
<title>Terms and definitions</title>
|
1057
|
+
</clause>
|
1058
|
+
<definitions id='_' obligation="normative" type="symbols">
|
1059
|
+
<title>Symbols</title>
|
1060
|
+
</definitions>
|
1061
|
+
</terms>
|
1062
|
+
</sections>
|
1063
|
+
</standard-document>
|
1064
|
+
OUTPUT
|
1065
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
|
1066
|
+
.to be_equivalent_to xmlpp(output)
|
1067
|
+
end
|
1068
|
+
|
1069
|
+
it "treats non-terminal terms subclause named as terms clause as a terms clause" do
|
1070
|
+
input = <<~INPUT
|
1071
|
+
#{ASCIIDOC_BLANK_HDR}
|
1072
|
+
== Scope
|
1073
|
+
|
1074
|
+
[[tda]]
|
1075
|
+
== Terms, definitions, symbols and abbreviations
|
1076
|
+
|
1077
|
+
[[terms]]
|
1078
|
+
=== Terms and definitions
|
1079
|
+
|
1080
|
+
[[terms-concepts]]
|
1081
|
+
==== Basic concepts
|
1082
|
+
|
1083
|
+
[[term-date]]
|
1084
|
+
===== date
|
1085
|
+
|
1086
|
+
_time_ (<<term-time>>) on the _calendar_ (<<term-calendar>>) _time scale_ (<<term-time-scale>>)
|
1087
|
+
|
1088
|
+
INPUT
|
1089
|
+
output = <<~OUTPUT
|
1090
|
+
#{BLANK_HDR}
|
1091
|
+
<sections>
|
1092
|
+
<clause id='_' inline-header='false' obligation='normative' type="scope">
|
1093
|
+
<title>Scope</title>
|
1094
|
+
</clause>
|
1095
|
+
<clause id='tda' obligation='normative'>
|
1096
|
+
<title>Terms and definitions</title>
|
1097
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
1098
|
+
<clause id='terms' obligation='normative'>
|
1099
|
+
<title>Terms and definitions</title>
|
1100
|
+
<terms id='terms-concepts' obligation='normative'>
|
1101
|
+
<title>Basic concepts</title>
|
1102
|
+
<term id='term-date'>
|
1103
|
+
<preferred>date</preferred>
|
1104
|
+
<definition>
|
1105
|
+
<p id='_'>
|
1106
|
+
<em>time</em>
|
1107
|
+
(
|
1108
|
+
<xref target='term-time'/>
|
1109
|
+
) on the
|
1110
|
+
<em>calendar</em>
|
1111
|
+
(
|
1112
|
+
<xref target='term-calendar'/>
|
1113
|
+
)
|
1114
|
+
<em>time scale</em>
|
1115
|
+
(
|
1116
|
+
<xref target='term-time-scale'/>
|
1117
|
+
)
|
1118
|
+
</p>
|
1119
|
+
</definition>
|
1120
|
+
</term>
|
1121
|
+
</terms>
|
1122
|
+
</clause>
|
1123
|
+
</clause>
|
1124
|
+
</sections>
|
1125
|
+
</standard-document>
|
1126
|
+
OUTPUT
|
1127
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
|
1128
|
+
.to be_equivalent_to xmlpp(output)
|
1129
|
+
end
|
1130
|
+
|
1131
|
+
it "leaves alone special titles in preface or appendix" do
|
1132
|
+
input = <<~INPUT
|
1133
|
+
#{ASCIIDOC_BLANK_HDR}
|
1134
|
+
|
1135
|
+
[.preface]
|
1136
|
+
[[t1]]
|
1137
|
+
== Terms and definitions
|
1138
|
+
|
1139
|
+
[[t2]]
|
1140
|
+
=== Term1
|
1141
|
+
|
1142
|
+
[appendix,language=fr]
|
1143
|
+
[[sym]]
|
1144
|
+
== Symbols and abbreviated terms
|
1145
|
+
|
1146
|
+
[.appendix]
|
1147
|
+
[[app]]
|
1148
|
+
[bibliography]
|
1149
|
+
== Normative Reference
|
1150
|
+
INPUT
|
1151
|
+
output = <<~OUTPUT
|
1152
|
+
#{BLANK_HDR}
|
1153
|
+
<preface>
|
1154
|
+
<terms id='t1' obligation='normative'>
|
1155
|
+
<title>Terms and definitions</title>
|
1156
|
+
<term id='t2'>
|
1157
|
+
<preferred>Term1</preferred>
|
1158
|
+
</term>
|
1159
|
+
</terms>
|
1160
|
+
</preface>
|
1161
|
+
<sections> </sections>
|
1162
|
+
<annex id='_' obligation='' language='fr' script=''>
|
1163
|
+
<definitions id='sym' language='fr' obligation="normative">
|
1164
|
+
<title>Symbols and abbreviated terms</title>
|
1165
|
+
</definitions>
|
1166
|
+
</annex>
|
1167
|
+
<annex id='_' obligation='' language='' script=''>
|
1168
|
+
<references id='app' obligation='informative' normative="false">
|
1169
|
+
<title>Bibliography</title>
|
1170
|
+
</references>
|
1171
|
+
</annex>
|
1172
|
+
</standard-document>
|
1173
|
+
OUTPUT
|
1174
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
|
1175
|
+
.to be_equivalent_to xmlpp(output)
|
1176
|
+
end
|
1177
|
+
|
1178
|
+
it "recognises special titles despite following indexterms" do
|
1179
|
+
input = <<~INPUT
|
1180
|
+
#{ASCIIDOC_BLANK_HDR}
|
1181
|
+
|
1182
|
+
== Scope (((indexterm)))
|
1183
|
+
INPUT
|
1184
|
+
output = <<~OUTPUT
|
1185
|
+
#{BLANK_HDR}
|
1186
|
+
<sections>
|
1187
|
+
<clause id='_' type='scope' inline-header='false' obligation='normative'>
|
1188
|
+
<title>Scope</title>
|
1189
|
+
</clause>
|
1190
|
+
</sections>
|
1191
|
+
</standard-document>
|
1192
|
+
OUTPUT
|
1193
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
|
1194
|
+
.to be_equivalent_to xmlpp(output)
|
1195
|
+
end
|
1143
1196
|
|
1144
1197
|
end
|