metanorma-standoc 1.8.5 → 1.9.1
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 -1
- 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 +27 -12
- data/lib/asciidoctor/standoc/blocks_notes.rb +20 -14
- data/lib/asciidoctor/standoc/cleanup.rb +32 -78
- data/lib/asciidoctor/standoc/cleanup_block.rb +56 -59
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +32 -21
- 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 +21 -13
- 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 +3 -1
- 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 +130 -1
- data/lib/asciidoctor/standoc/lists.rb +4 -2
- data/lib/asciidoctor/standoc/macros.rb +40 -13
- 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 +12 -12
- data/lib/asciidoctor/standoc/terms.rb +10 -6
- data/lib/asciidoctor/standoc/utils.rb +32 -6
- data/lib/asciidoctor/standoc/validate.rb +12 -12
- 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 +10 -0
- data/spec/asciidoctor/cleanup_sections_spec.rb +14 -14
- data/spec/asciidoctor/cleanup_spec.rb +1860 -1874
- data/spec/asciidoctor/inline_spec.rb +272 -273
- data/spec/asciidoctor/macros_spec.rb +8 -2
- data/spec/asciidoctor/refs_spec.rb +135 -7
- data/spec/asciidoctor/section_spec.rb +670 -687
- 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 +16 -16
- data/spec/vcr_cassettes/isobib_get_123_1.yml +32 -32
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +41 -41
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +15 -15
- data/spec/vcr_cassettes/isobib_get_124.yml +17 -17
- 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 +71 -68
- data/.rubocop.ribose.yml +0 -66
- data/.rubocop.tb.yml +0 -650
- data/spec/asciidoctor/macros_lutaml_spec.rb +0 -80
@@ -9,14 +9,15 @@ RSpec.describe Asciidoctor::Standoc do
|
|
9
9
|
domain:[term1]
|
10
10
|
inherit:[<<ref1>>]
|
11
11
|
autonumber:table[3]
|
12
|
+
add:[a <<clause>>] del:[B]
|
12
13
|
|
13
14
|
[bibliography]
|
14
15
|
== Bibliography
|
15
16
|
* [[[ref1,XYZ 123]]] _Title_
|
16
17
|
INPUT
|
17
|
-
|
18
|
+
#{BLANK_HDR}
|
18
19
|
<preface>
|
19
|
-
|
20
|
+
<foreword id='_' obligation='informative'>
|
20
21
|
<title>Foreword</title>
|
21
22
|
<admitted>term1</admitted>
|
22
23
|
<deprecates>term1</deprecates>
|
@@ -25,6 +26,11 @@ RSpec.describe Asciidoctor::Standoc do
|
|
25
26
|
<eref type='inline' bibitemid='ref1' citeas='XYZ 123'/>
|
26
27
|
</inherit>
|
27
28
|
<autonumber type='table'>3</autonumber>
|
29
|
+
<add>
|
30
|
+
a
|
31
|
+
<xref target='clause'/>
|
32
|
+
</add>
|
33
|
+
<del>B</del>
|
28
34
|
</foreword>
|
29
35
|
</preface>
|
30
36
|
<sections> </sections>
|
@@ -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
|
@@ -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,115 +95,111 @@ RSpec.describe Asciidoctor::Standoc do
|
|
95
95
|
[index,type=thematic]
|
96
96
|
== Thematic Index
|
97
97
|
INPUT
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
</abstract><foreword id='_' obligation="informative">
|
103
|
-
|
104
|
-
|
105
|
-
</foreword><introduction id="_" obligation="informative">
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
</clause>
|
110
|
-
</introduction>
|
111
|
-
<clause id='_' inline-header='false' obligation='informative'>
|
112
|
-
|
113
|
-
</clause>
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
</preface><sections>
|
118
|
-
|
119
|
-
|
120
|
-
<
|
121
|
-
|
122
|
-
|
123
|
-
</
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
</
|
132
|
-
|
133
|
-
<
|
134
|
-
<
|
135
|
-
<
|
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
|
-
<definitions id="_" obligation="normative"
|
163
|
-
|
164
|
-
</clause>
|
165
|
-
<definitions id="_" obligation="normative" type="
|
166
|
-
|
167
|
-
</definitions
|
168
|
-
<
|
169
|
-
|
170
|
-
</
|
171
|
-
<clause id="_" inline-header="false" obligation="normative"
|
172
|
-
|
173
|
-
</clause>
|
174
|
-
<clause id="_" inline-header="false" obligation="normative">
|
175
|
-
|
176
|
-
</clause
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
</
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
</clause>
|
186
|
-
</
|
187
|
-
|
188
|
-
|
189
|
-
</references
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
</
|
194
|
-
</
|
195
|
-
<indexsect id='_'>
|
196
|
-
|
197
|
-
|
198
|
-
</
|
199
|
-
<indexsect id='_' type='thematic'>
|
200
|
-
<title>Thematic Index</title>
|
201
|
-
</indexsect>
|
202
|
-
</standard-document>
|
98
|
+
#{BLANK_HDR.sub(/<status>/, '<abstract> <p>Text</p> </abstract><status>')}
|
99
|
+
<preface><abstract id="_">
|
100
|
+
<title>Abstract</title>
|
101
|
+
<p id="_">Text</p>
|
102
|
+
</abstract><foreword id='_' obligation="informative">
|
103
|
+
<title>Foreword</title>
|
104
|
+
<p id="_">Text</p>
|
105
|
+
</foreword><introduction id="_" obligation="informative">
|
106
|
+
<title>Introduction</title>
|
107
|
+
<clause id="_" inline-header="false" obligation="informative">
|
108
|
+
<title>Introduction Subsection</title>
|
109
|
+
</clause>
|
110
|
+
</introduction>
|
111
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
112
|
+
<title>Dedication</title>
|
113
|
+
</clause>
|
114
|
+
<acknowledgements id='_' obligation='informative'>
|
115
|
+
<title>Acknowledgements</title>
|
116
|
+
</acknowledgements>
|
117
|
+
</preface><sections>
|
118
|
+
<clause id="_" inline-header="false" obligation="normative" type="scope">
|
119
|
+
<title>Scope</title>
|
120
|
+
<p id="_">Text</p>
|
121
|
+
</clause>
|
122
|
+
<terms id="_" obligation="normative">
|
123
|
+
<title>Terms and definitions</title>
|
124
|
+
<p id="_">For the purposes of this document,
|
125
|
+
the following terms and definitions apply.</p>
|
126
|
+
<term id="term-term1">
|
127
|
+
<preferred>Term1</preferred>
|
128
|
+
</term>
|
129
|
+
</terms>
|
130
|
+
<clause id="_" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title>
|
131
|
+
<p id='_'>Boilerplate text</p>
|
132
|
+
<clause id="_" inline-header="false" obligation="normative">
|
133
|
+
<title>Introduction</title>
|
134
|
+
<clause id="_" inline-header="false" obligation="normative">
|
135
|
+
<title>Intro 1</title>
|
136
|
+
</clause>
|
137
|
+
</clause>
|
138
|
+
<terms id="_" obligation="normative">
|
139
|
+
<title>Intro 2</title>
|
140
|
+
<clause id="_" inline-header="false" obligation="normative">
|
141
|
+
<title>Intro 3</title>
|
142
|
+
</clause>
|
143
|
+
</terms>
|
144
|
+
<clause id="_" obligation="normative">
|
145
|
+
<title>Intro 4</title>
|
146
|
+
<terms id="_" obligation="normative">
|
147
|
+
<title>Intro 5</title>
|
148
|
+
<term id="term-term1-1">
|
149
|
+
<preferred>Term1</preferred>
|
150
|
+
</term>
|
151
|
+
</terms>
|
152
|
+
</clause>
|
153
|
+
<terms id="_" obligation="normative">
|
154
|
+
<title>Normal Terms</title>
|
155
|
+
<term id="term-term2">
|
156
|
+
<preferred>Term2</preferred>
|
157
|
+
</term>
|
158
|
+
</terms>
|
159
|
+
<definitions id="_" obligation="normative"><title>Symbols and abbreviated terms</title><clause id="_" inline-header="false" obligation="normative">
|
160
|
+
<title>General</title>
|
161
|
+
</clause>
|
162
|
+
<definitions id="_" obligation="normative" type="symbols">
|
163
|
+
<title>Symbols</title>
|
164
|
+
</definitions></definitions></clause>
|
165
|
+
<definitions id="_" obligation="normative" type="abbreviated_terms">
|
166
|
+
<title>Abbreviated terms</title>
|
167
|
+
</definitions>
|
168
|
+
<clause id="_" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="_" inline-header="false" obligation="normative">
|
169
|
+
<title>Introduction</title>
|
170
|
+
</clause>
|
171
|
+
<clause id="_" inline-header="false" obligation="normative">
|
172
|
+
<title>Clause 4.2</title>
|
173
|
+
</clause></clause>
|
174
|
+
<clause id="_" inline-header="false" obligation="normative">
|
175
|
+
<title>Terms and Definitions</title>
|
176
|
+
</clause>
|
177
|
+
</sections><annex id="_" inline-header="false" obligation="normative">
|
178
|
+
<title>Annex</title>
|
179
|
+
<clause id="_" inline-header="false" obligation="normative">
|
180
|
+
<title>Annex A.1</title>
|
181
|
+
</clause>
|
182
|
+
</annex><bibliography><references id="_" obligation="informative" normative="true">
|
183
|
+
<title>Normative references</title>
|
184
|
+
<p id="_">There are no normative references in this document.</p>
|
185
|
+
</references><clause id="_" obligation="informative">
|
186
|
+
<title>Bibliography</title>
|
187
|
+
<references id="_" obligation="informative" normative="false">
|
188
|
+
<title>Bibliography Subsection</title>
|
189
|
+
</references>
|
190
|
+
</clause></bibliography>
|
191
|
+
<indexsect id='_'>
|
192
|
+
<title>Index</title>
|
193
|
+
<p id='_'>This is an index</p>
|
194
|
+
</indexsect>
|
195
|
+
<indexsect id='_' type='thematic'>
|
196
|
+
<title>Thematic Index</title>
|
197
|
+
</indexsect>
|
198
|
+
</standard-document>
|
203
199
|
OUTPUT
|
204
200
|
end
|
205
201
|
|
206
|
-
|
202
|
+
it "processes sections with number attributes" do
|
207
203
|
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
208
204
|
#{ASCIIDOC_BLANK_HDR}
|
209
205
|
[number=1bis]
|
@@ -268,81 +264,81 @@ RSpec.describe Asciidoctor::Standoc do
|
|
268
264
|
[number=20bis]
|
269
265
|
=== Bibliography Subsection
|
270
266
|
INPUT
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
</clause>
|
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>
|
267
|
+
#{BLANK_HDR}
|
268
|
+
<sections>
|
269
|
+
<clause id='_' number='1bis' type='scope' inline-header='false' obligation='normative'>
|
270
|
+
<title>Scope</title>
|
271
|
+
<p id='_'>Text</p>
|
292
272
|
</clause>
|
293
|
-
<
|
294
|
-
<
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
273
|
+
<terms id='_' number='3bis' obligation='normative'>
|
274
|
+
<title>Terms and definitions</title>
|
275
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
276
|
+
<term id='term-term1' number='4bis'>
|
277
|
+
<preferred>Term1</preferred>
|
278
|
+
</term>
|
279
|
+
</terms>
|
280
|
+
<terms id='_' number='5bis' obligation='normative'>
|
281
|
+
<title>Terms, definitions, symbols and abbreviated terms</title>
|
282
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
283
|
+
<clause id='_' number='6bis' inline-header='false' obligation='normative'>
|
284
|
+
<title>Introduction</title>
|
285
|
+
<clause id='_' number='7bis' inline-header='false' obligation='normative'>
|
286
|
+
<title>Intro 1</title>
|
287
|
+
</clause>
|
300
288
|
</clause>
|
301
|
-
<
|
302
|
-
<
|
289
|
+
<term id='term-intro-2' number='8bis'>
|
290
|
+
<preferred>Intro 2</preferred>
|
291
|
+
</term>
|
292
|
+
<definitions id='_' number='9bis' obligation='normative'>
|
293
|
+
<title>Symbols and abbreviated terms</title>
|
294
|
+
<clause id='_' number='10bis' inline-header='false' obligation='normative'>
|
295
|
+
<title>General</title>
|
296
|
+
</clause>
|
297
|
+
<definitions id='_' number='11bis' type='symbols' obligation='normative'>
|
298
|
+
<title>Symbols</title>
|
299
|
+
</definitions>
|
303
300
|
</definitions>
|
301
|
+
</terms>
|
302
|
+
<definitions id='_' number='12bis' type='abbreviated_terms' obligation='normative'>
|
303
|
+
<title>Abbreviated terms</title>
|
304
304
|
</definitions>
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
305
|
+
<clause id='_' number='13bis' inline-header='false' obligation='normative'>
|
306
|
+
<title>Clause 4</title>
|
307
|
+
<clause id='_' number='14bis' inline-header='false' obligation='normative'>
|
308
|
+
<title>Introduction</title>
|
309
|
+
</clause>
|
310
|
+
<clause id='_' number='15bis' inline-header='false' obligation='normative'>
|
311
|
+
<title>Clause 4.2</title>
|
312
|
+
</clause>
|
313
313
|
</clause>
|
314
|
-
<clause id='_' number='
|
315
|
-
<title>
|
314
|
+
<clause id='_' number='16bis' inline-header='false' obligation='normative'>
|
315
|
+
<title>Terms and Definitions</title>
|
316
316
|
</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>
|
317
|
+
</sections>
|
318
|
+
<annex id='_' number='17bis' inline-header='false' obligation='normative'>
|
319
|
+
<title>Annex</title>
|
320
|
+
<clause id='_' number='18bis' inline-header='false' obligation='normative'>
|
321
|
+
<title>Annex A.1</title>
|
322
|
+
</clause>
|
323
|
+
</annex>
|
324
|
+
<bibliography>
|
325
|
+
<references id='_' number='2bis' normative='true' obligation='informative'>
|
326
|
+
<title>Normative references</title>
|
327
|
+
<p id='_'>There are no normative references in this document.</p>
|
337
328
|
</references>
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
329
|
+
<clause id='_' number='19bis' obligation='informative'>
|
330
|
+
<title>Bibliography</title>
|
331
|
+
<references id='_' number='20bis' normative='false' obligation='informative'>
|
332
|
+
<title>Bibliography Subsection</title>
|
333
|
+
</references>
|
334
|
+
</clause>
|
335
|
+
</bibliography>
|
336
|
+
</standard-document>
|
337
|
+
OUTPUT
|
338
|
+
end
|
343
339
|
|
344
|
-
|
345
|
-
|
340
|
+
it "processes sections with language and script attributes" do
|
341
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
346
342
|
#{ASCIIDOC_BLANK_HDR}
|
347
343
|
[language=en,script=Latn]
|
348
344
|
== Foreword
|
@@ -446,106 +442,102 @@ RSpec.describe Asciidoctor::Standoc do
|
|
446
442
|
[language=en,script=Latn]
|
447
443
|
=== Bibliography Subsection
|
448
444
|
INPUT
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
</clause>
|
465
|
-
|
466
|
-
|
467
|
-
</acknowledgements>
|
468
|
-
</preface><sections>
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
<
|
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
|
-
<title>Bibliography Subsection</title>
|
544
|
-
</references>
|
545
|
-
</clause></bibliography>
|
546
|
-
</standard-document>
|
445
|
+
#{BLANK_HDR.sub(/<status>/, '<abstract> <p>Text</p> </abstract><status>')}
|
446
|
+
<preface><abstract id="_" language="en" script="Latn">
|
447
|
+
<title>Abstract</title>
|
448
|
+
<p id="_">Text</p>
|
449
|
+
</abstract><foreword id='_' language='en' script='Latn' obligation='informative'>
|
450
|
+
<title>Foreword</title>
|
451
|
+
<p id="_">Text</p>
|
452
|
+
</foreword><introduction id="_" language="en" script="Latn" obligation="informative">
|
453
|
+
<title>Introduction</title>
|
454
|
+
<clause id="_" language="en" script="Latn" inline-header="false" obligation="informative">
|
455
|
+
<title>Introduction Subsection</title>
|
456
|
+
</clause>
|
457
|
+
</introduction>
|
458
|
+
<clause id='_' language='en' script='Latn' inline-header='false' obligation='informative'>
|
459
|
+
<title>Dedication</title>
|
460
|
+
</clause>
|
461
|
+
<acknowledgements id='_' language='en' script='Latn' obligation='informative'>
|
462
|
+
<title>Acknowledgements</title>
|
463
|
+
</acknowledgements>
|
464
|
+
</preface><sections>
|
465
|
+
<clause id="_" language="en" script="Latn" inline-header="false" obligation="normative" type="scope">
|
466
|
+
<title>Scope</title>
|
467
|
+
<p id="_">Text</p>
|
468
|
+
</clause>
|
469
|
+
<terms id="_" language="en" script="Latn" obligation="normative">
|
470
|
+
<title>Terms and definitions</title>
|
471
|
+
<p id="_">For the purposes of this document,
|
472
|
+
the following terms and definitions apply.</p>
|
473
|
+
<term id="term-term1" language="en" script="Latn">
|
474
|
+
<preferred>Term1</preferred>
|
475
|
+
</term>
|
476
|
+
</terms>
|
477
|
+
<clause id="_" language="en" script="Latn" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title>
|
478
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
479
|
+
<clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
480
|
+
<title>Introduction</title>
|
481
|
+
<clause id="_" inline-header="false" obligation="normative">
|
482
|
+
<title>Intro 1</title>
|
483
|
+
</clause>
|
484
|
+
</clause>
|
485
|
+
<terms id="_" language="en" script="Latn" obligation="normative">
|
486
|
+
<title>Intro 2</title>
|
487
|
+
<clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
488
|
+
<title>Intro 3</title>
|
489
|
+
</clause>
|
490
|
+
</terms>
|
491
|
+
<clause id="_" language="en" script="Latn" obligation="normative">
|
492
|
+
<title>Intro 4</title>
|
493
|
+
<terms id="_" language="en" script="Latn" obligation="normative">
|
494
|
+
<title>Intro 5</title>
|
495
|
+
<term id="term-term1-1">
|
496
|
+
<preferred>Term1</preferred>
|
497
|
+
</term>
|
498
|
+
</terms>
|
499
|
+
</clause>
|
500
|
+
<terms id="_" language="en" script="Latn" obligation="normative">
|
501
|
+
<title>Normal Terms</title>
|
502
|
+
<term id="term-term2">
|
503
|
+
<preferred>Term2</preferred>
|
504
|
+
</term>
|
505
|
+
</terms>
|
506
|
+
<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">
|
507
|
+
<title>General</title>
|
508
|
+
</clause>
|
509
|
+
<definitions id="_" obligation="normative" type="symbols">
|
510
|
+
<title>Symbols</title>
|
511
|
+
</definitions></definitions></clause>
|
512
|
+
<definitions id="_" language="en" script="Latn" obligation="normative" type="abbreviated_terms">
|
513
|
+
<title>Abbreviated terms</title>
|
514
|
+
</definitions>
|
515
|
+
<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">
|
516
|
+
<title>Introduction</title>
|
517
|
+
</clause>
|
518
|
+
<clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
519
|
+
<title>Clause 4.2</title>
|
520
|
+
</clause></clause>
|
521
|
+
<clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
522
|
+
<title>Terms and Definitions</title>
|
523
|
+
</clause>
|
524
|
+
</sections><annex id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
525
|
+
<title>Annex</title>
|
526
|
+
<clause id="_" language="en" script="Latn" inline-header="false" obligation="normative">
|
527
|
+
<title>Annex A.1</title>
|
528
|
+
</clause>
|
529
|
+
</annex><bibliography><references id="_" language="en" script="Latn" obligation="informative" normative="true">
|
530
|
+
<title>Normative references</title>
|
531
|
+
<p id="_">There are no normative references in this document.</p>
|
532
|
+
</references><clause id="_" language="en" script="Latn" obligation="informative">
|
533
|
+
<title>Bibliography</title>
|
534
|
+
<references id="_" language="en" script="Latn" obligation="informative" normative="false">
|
535
|
+
<title>Bibliography Subsection</title>
|
536
|
+
</references>
|
537
|
+
</clause></bibliography>
|
538
|
+
</standard-document>
|
547
539
|
OUTPUT
|
548
|
-
|
540
|
+
end
|
549
541
|
|
550
542
|
it "processes sections with title and type attributes" do
|
551
543
|
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
@@ -606,84 +598,84 @@ RSpec.describe Asciidoctor::Standoc do
|
|
606
598
|
|
607
599
|
=== Bibliography Subsection
|
608
600
|
INPUT
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
</acknowledgements>
|
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
|
-
</standard-document>
|
601
|
+
#{BLANK_HDR.sub(/<status>/, '<abstract> <p>Text</p> </abstract><status>')}
|
602
|
+
<preface>
|
603
|
+
<abstract id='_'>
|
604
|
+
<title>Abstract</title>
|
605
|
+
<p id='_'>Text</p>
|
606
|
+
</abstract>
|
607
|
+
<foreword id='_' obligation='informative'>
|
608
|
+
<title>Foreword</title>
|
609
|
+
<p id='_'>Text</p>
|
610
|
+
</foreword>
|
611
|
+
<introduction id='_' obligation='informative'>
|
612
|
+
<title>Introduction</title>
|
613
|
+
<clause id='_' inline-header='false' obligation='informative'>
|
614
|
+
<title>Introduction Subsection</title>
|
615
|
+
</clause>
|
616
|
+
</introduction>
|
617
|
+
<acknowledgements id='_' obligation='informative'>
|
618
|
+
<title>Acknowledgements</title>
|
619
|
+
</acknowledgements>
|
620
|
+
</preface>
|
621
|
+
<sections>
|
622
|
+
<terms id='_' obligation='normative'>
|
623
|
+
<title>Terms and definitions</title>
|
624
|
+
<p id="_">For the purposes of this document, the following terms and definitions apply.</p>
|
625
|
+
<term id='term-term1'>
|
626
|
+
<preferred>Term1</preferred>
|
627
|
+
</term>
|
628
|
+
</terms>
|
629
|
+
<clause id='_' obligation='normative'>
|
630
|
+
<title>Terms, definitions and symbols</title>
|
631
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
632
|
+
<terms id='_' obligation='normative'>
|
633
|
+
<title>Normal Terms</title>
|
634
|
+
<term id='term-term2'>
|
635
|
+
<preferred>Term2</preferred>
|
636
|
+
</term>
|
637
|
+
</terms>
|
638
|
+
<definitions id='_' obligation="normative" type="symbols">
|
639
|
+
<title>Symbols</title>
|
640
|
+
</definitions>
|
641
|
+
</clause>
|
642
|
+
<definitions id='_' obligation="normative" type="abbreviated_terms">
|
643
|
+
<title>Abbreviated terms</title>
|
644
|
+
</definitions>
|
645
|
+
<clause id='_' inline-header='false' obligation='normative' type="ABC">
|
646
|
+
<title>Clause 4</title>
|
647
|
+
<clause id='_' inline-header='false' obligation='normative' type="DEF">
|
648
|
+
<title>Introduction</title>
|
649
|
+
</clause>
|
650
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
651
|
+
<title>Clause 4.2</title>
|
652
|
+
</clause>
|
653
|
+
</clause>
|
654
|
+
</sections>
|
655
|
+
<annex id='_' inline-header='false' obligation='normative'>
|
656
|
+
<title>Annex</title>
|
657
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
658
|
+
<title>Annex A.1</title>
|
659
|
+
</clause>
|
660
|
+
</annex>
|
661
|
+
<bibliography>
|
662
|
+
<references id='_' obligation='informative' normative="true">
|
663
|
+
<title>Normative references</title>
|
664
|
+
<p id="_">There are no normative references in this document.</p>
|
665
|
+
</references>
|
666
|
+
<clause id='_' obligation='informative'>
|
667
|
+
<title>Bibliography</title>
|
668
|
+
<references id='_' obligation='informative' normative="false">
|
669
|
+
<title>Bibliography Subsection</title>
|
670
|
+
</references>
|
671
|
+
</clause>
|
672
|
+
</bibliography>
|
673
|
+
</standard-document>
|
682
674
|
OUTPUT
|
683
675
|
end
|
684
676
|
|
685
677
|
it "varies terms & symbols title" do
|
686
|
-
|
678
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
687
679
|
#{ASCIIDOC_BLANK_HDR}
|
688
680
|
[heading="terms, definitions, symbols and abbreviated terms"]
|
689
681
|
== Terms, Definitions, Symbols Section
|
@@ -692,56 +684,55 @@ RSpec.describe Asciidoctor::Standoc do
|
|
692
684
|
|
693
685
|
=== Symbols
|
694
686
|
|
695
|
-
|
696
|
-
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
</standard-document>
|
710
|
-
|
711
|
-
|
687
|
+
INPUT
|
688
|
+
#{BLANK_HDR}
|
689
|
+
<sections>
|
690
|
+
<terms id='_' obligation='normative'>
|
691
|
+
<title>Terms, definitions and symbols</title>
|
692
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
693
|
+
<term id='term-term'>
|
694
|
+
<preferred>Term</preferred>
|
695
|
+
</term>
|
696
|
+
<definitions id='_' obligation="normative" type="symbols">
|
697
|
+
<title>Symbols</title>
|
698
|
+
</definitions>
|
699
|
+
</terms>
|
700
|
+
</sections>
|
701
|
+
</standard-document>
|
702
|
+
OUTPUT
|
703
|
+
end
|
712
704
|
|
713
705
|
it "varies terms & abbreviated terms title" do
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
706
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
707
|
+
#{ASCIIDOC_BLANK_HDR}
|
708
|
+
[heading="terms, definitions, symbols and abbreviated terms"]
|
709
|
+
== Terms, Definitions, Abbreviated Terms Section
|
718
710
|
|
719
|
-
|
720
|
-
|
721
|
-
[heading="abbreviated terms"]
|
722
|
-
=== Symbols
|
711
|
+
=== Term
|
723
712
|
|
724
|
-
|
725
|
-
|
726
|
-
<sections>
|
727
|
-
<terms id='_' obligation='normative'>
|
728
|
-
<title>Terms, definitions and abbreviated terms</title>
|
729
|
-
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
730
|
-
<term id='term-term'>
|
731
|
-
<preferred>Term</preferred>
|
732
|
-
</term>
|
733
|
-
<definitions id='_' obligation="normative" type="abbreviated_terms">
|
734
|
-
<title>Abbreviated terms</title>
|
735
|
-
</definitions>
|
736
|
-
</terms>
|
737
|
-
</sections>
|
738
|
-
</standard-document>
|
739
|
-
OUTPUT
|
740
|
-
end
|
713
|
+
[heading="abbreviated terms"]
|
714
|
+
=== Symbols
|
741
715
|
|
716
|
+
INPUT
|
717
|
+
#{BLANK_HDR}
|
718
|
+
<sections>
|
719
|
+
<terms id='_' obligation='normative'>
|
720
|
+
<title>Terms, definitions and abbreviated terms</title>
|
721
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
722
|
+
<term id='term-term'>
|
723
|
+
<preferred>Term</preferred>
|
724
|
+
</term>
|
725
|
+
<definitions id='_' obligation="normative" type="abbreviated_terms">
|
726
|
+
<title>Abbreviated terms</title>
|
727
|
+
</definitions>
|
728
|
+
</terms>
|
729
|
+
</sections>
|
730
|
+
</standard-document>
|
731
|
+
OUTPUT
|
732
|
+
end
|
742
733
|
|
743
734
|
it "processes section obligations" do
|
744
|
-
|
735
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
745
736
|
#{ASCIIDOC_BLANK_HDR}
|
746
737
|
[obligation=informative]
|
747
738
|
== Clause 1
|
@@ -753,26 +744,26 @@ RSpec.describe Asciidoctor::Standoc do
|
|
753
744
|
|
754
745
|
[appendix,obligation=informative]
|
755
746
|
== Annex
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
747
|
+
INPUT
|
748
|
+
#{BLANK_HDR}
|
749
|
+
<sections><clause id="_" inline-header="false" obligation="informative">
|
750
|
+
<title>Clause 1</title>
|
751
|
+
<clause id="_" inline-header="false" obligation="informative">
|
752
|
+
<title>Clause 1a</title>
|
753
|
+
</clause>
|
754
|
+
</clause>
|
755
|
+
<clause id="_" inline-header="false" obligation="normative">
|
756
|
+
<title>Clause 2</title>
|
757
|
+
</clause>
|
758
|
+
</sections><annex id="_" inline-header="false" obligation="informative">
|
759
|
+
<title>Annex</title>
|
760
|
+
</annex>
|
761
|
+
</standard-document>
|
762
|
+
OUTPUT
|
772
763
|
end
|
773
764
|
|
774
|
-
|
775
|
-
|
765
|
+
it "processes inline headers" do
|
766
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
776
767
|
#{ASCIIDOC_BLANK_HDR}
|
777
768
|
== Clause 1
|
778
769
|
|
@@ -784,46 +775,46 @@ RSpec.describe Asciidoctor::Standoc do
|
|
784
775
|
|
785
776
|
[%inline-header]
|
786
777
|
=== Clause Aa
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
778
|
+
INPUT
|
779
|
+
#{BLANK_HDR}
|
780
|
+
<sections><clause id="_" inline-header="false" obligation="normative">
|
781
|
+
<title>Clause 1</title>
|
782
|
+
<clause id="_" inline-header="true" obligation="normative">
|
783
|
+
<title>Clause 1a</title>
|
784
|
+
</clause>
|
785
|
+
</clause>
|
786
|
+
</sections><annex id="_" inline-header="false" obligation="normative">
|
787
|
+
<title>Annex A</title>
|
788
|
+
<clause id="_" inline-header="true" obligation="normative">
|
789
|
+
<title>Clause Aa</title>
|
790
|
+
</clause>
|
791
|
+
</annex>
|
792
|
+
</standard-document>
|
793
|
+
OUTPUT
|
794
|
+
end
|
804
795
|
|
805
796
|
it "processes blank headers" do
|
806
|
-
|
797
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
807
798
|
#{ASCIIDOC_BLANK_HDR}
|
808
799
|
== Clause 1
|
809
800
|
|
810
801
|
=== {blank}
|
811
802
|
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
803
|
+
INPUT
|
804
|
+
#{BLANK_HDR}
|
805
|
+
<sections>
|
806
|
+
<clause id="_" inline-header="false" obligation="normative">
|
807
|
+
<title>Clause 1</title>
|
808
|
+
<clause id="_" inline-header="false" obligation="normative">
|
809
|
+
</clause>
|
810
|
+
</clause>
|
811
|
+
</sections>
|
812
|
+
</standard-document>
|
813
|
+
OUTPUT
|
823
814
|
end
|
824
815
|
|
825
|
-
|
826
|
-
|
816
|
+
it "processes terminal nodes in terms with term subsection names" do
|
817
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
827
818
|
#{ASCIIDOC_BLANK_HDR}
|
828
819
|
|
829
820
|
== Terms, definitions, symbols and abbreviated terms
|
@@ -832,27 +823,26 @@ RSpec.describe Asciidoctor::Standoc do
|
|
832
823
|
|
833
824
|
=== Symbols
|
834
825
|
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
</sections>
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
826
|
+
INPUT
|
827
|
+
#{BLANK_HDR}
|
828
|
+
<sections>
|
829
|
+
<terms id='_' obligation='normative'>
|
830
|
+
<title>Terms, definitions and symbols</title>
|
831
|
+
<p id='_'>No terms and definitions are listed in this document.</p>
|
832
|
+
<clause id='_' inline-header='false' obligation='normative'>
|
833
|
+
<title>Terms and definitions</title>
|
834
|
+
</clause>
|
835
|
+
<definitions id='_' obligation="normative" type="symbols">
|
836
|
+
<title>Symbols</title>
|
837
|
+
</definitions>
|
838
|
+
</terms>
|
839
|
+
</sections>
|
840
|
+
</standard-document>
|
841
|
+
OUTPUT
|
842
|
+
end
|
843
|
+
|
844
|
+
it "processes terms & definitions with external source" do
|
845
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
856
846
|
#{ASCIIDOC_BLANK_HDR}
|
857
847
|
|
858
848
|
Foreword
|
@@ -862,27 +852,26 @@ RSpec.describe Asciidoctor::Standoc do
|
|
862
852
|
|
863
853
|
=== Term1
|
864
854
|
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
</term>
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
855
|
+
INPUT
|
856
|
+
#{BLANK_HDR}
|
857
|
+
<termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/>
|
858
|
+
<preface><foreword id='_' obligation="informative">
|
859
|
+
<title>Foreword</title>
|
860
|
+
<p id="_">Foreword</p>
|
861
|
+
</foreword></preface><sections>
|
862
|
+
<terms id="_" obligation="normative">
|
863
|
+
<title>Terms and definitions</title><p id="_">For the purposes of this document, the terms and definitions
|
864
|
+
given in <eref bibitemid="iso1234"/> and <eref bibitemid="iso5678"/> and the following apply.</p>
|
865
|
+
<term id="term-term1">
|
866
|
+
<preferred>Term1</preferred>
|
867
|
+
</term>
|
868
|
+
</terms></sections>
|
869
|
+
</standard-document>
|
870
|
+
OUTPUT
|
871
|
+
end
|
872
|
+
|
873
|
+
it "processes empty terms & definitions" do
|
874
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
886
875
|
#{ASCIIDOC_BLANK_HDR}
|
887
876
|
|
888
877
|
Foreword
|
@@ -890,23 +879,22 @@ RSpec.describe Asciidoctor::Standoc do
|
|
890
879
|
== Terms and Definitions
|
891
880
|
|
892
881
|
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
OUTPUT
|
905
|
-
end
|
882
|
+
INPUT
|
883
|
+
#{BLANK_HDR}
|
884
|
+
<preface><foreword id='_' obligation="informative">
|
885
|
+
<title>Foreword</title>
|
886
|
+
<p id="_">Foreword</p>
|
887
|
+
</foreword></preface><sections>
|
888
|
+
<terms id="_" obligation="normative">
|
889
|
+
<title>Terms and definitions</title><p id="_">No terms and definitions are listed in this document.</p>
|
890
|
+
</terms></sections>
|
891
|
+
</standard-document>
|
906
892
|
|
893
|
+
OUTPUT
|
894
|
+
end
|
907
895
|
|
908
|
-
|
909
|
-
|
896
|
+
it "processes empty terms & definitions with external source" do
|
897
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
910
898
|
#{ASCIIDOC_BLANK_HDR}
|
911
899
|
|
912
900
|
Foreword
|
@@ -914,27 +902,27 @@ RSpec.describe Asciidoctor::Standoc do
|
|
914
902
|
[source="iso1234,iso5678"]
|
915
903
|
== Terms and Definitions
|
916
904
|
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
905
|
+
INPUT
|
906
|
+
#{BLANK_HDR}
|
907
|
+
<termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/>
|
908
|
+
<preface><foreword id='_' obligation="informative">
|
909
|
+
<title>Foreword</title>
|
910
|
+
<p id="_">Foreword</p>
|
911
|
+
</foreword></preface><sections>
|
912
|
+
<terms id="_" obligation="normative">
|
913
|
+
<title>Terms and definitions</title>
|
914
|
+
<p id="_">For the purposes of this document,
|
915
|
+
the terms and definitions given in <eref bibitemid="iso1234"/> and <eref bibitemid="iso5678"/> apply.</p>
|
928
916
|
|
929
917
|
|
930
|
-
|
931
|
-
|
918
|
+
</terms></sections>
|
919
|
+
</standard-document>
|
932
920
|
|
933
|
-
|
934
|
-
|
921
|
+
OUTPUT
|
922
|
+
end
|
935
923
|
|
936
|
-
|
937
|
-
|
924
|
+
it "processes term document sources in French" do
|
925
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
938
926
|
= Document title
|
939
927
|
Author
|
940
928
|
:docfile: test.adoc
|
@@ -948,26 +936,26 @@ RSpec.describe Asciidoctor::Standoc do
|
|
948
936
|
[source="iso1234,iso5678"]
|
949
937
|
== Terms and Definitions
|
950
938
|
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
939
|
+
INPUT
|
940
|
+
#{BLANK_HDR.sub(%r{<language>en</language>}, '<language>fr</language>')}
|
941
|
+
<termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/>
|
942
|
+
<preface><foreword id='_' obligation="informative">
|
943
|
+
<title>Avant-propos</title>
|
944
|
+
<p id="_">Foreword</p>
|
945
|
+
</foreword></preface><sections>
|
946
|
+
<terms id="_" obligation="normative">
|
947
|
+
<title>Terms et définitions</title>
|
948
|
+
<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>
|
961
949
|
|
962
950
|
|
963
|
-
|
964
|
-
|
951
|
+
</terms></sections>
|
952
|
+
</standard-document>
|
965
953
|
|
966
|
-
|
967
|
-
|
954
|
+
OUTPUT
|
955
|
+
end
|
968
956
|
|
969
|
-
|
970
|
-
|
957
|
+
it "processes term document sources in Chinese" do
|
958
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
971
959
|
= Document title
|
972
960
|
Author
|
973
961
|
:docfile: test.adoc
|
@@ -982,163 +970,158 @@ RSpec.describe Asciidoctor::Standoc do
|
|
982
970
|
[source="iso1234,iso5678"]
|
983
971
|
== Terms and Definitions
|
984
972
|
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
=== Term2
|
1008
|
-
INPUT
|
1009
|
-
end
|
1010
|
-
|
1011
|
-
it "treats terminal terms subclause named as terms clause as a normal clause" do
|
1012
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1013
|
-
#{ASCIIDOC_BLANK_HDR}
|
1014
|
-
[[tda]]
|
1015
|
-
== Terms, definitions, symbols and abbreviations
|
1016
|
-
|
1017
|
-
[[terms]]
|
1018
|
-
=== Terms and definitions
|
1019
|
-
|
1020
|
-
=== Symbols
|
1021
|
-
|
1022
|
-
INPUT
|
1023
|
-
#{BLANK_HDR}
|
1024
|
-
<sections>
|
1025
|
-
<terms id='tda' obligation='normative'>
|
1026
|
-
<title>Terms, definitions and symbols</title>
|
1027
|
-
<p id='_'>No terms and definitions are listed in this document.</p>
|
1028
|
-
<clause id='terms' inline-header='false' obligation='normative'>
|
1029
|
-
<title>Terms and definitions</title>
|
1030
|
-
</clause>
|
1031
|
-
<definitions id='_' obligation="normative" type="symbols">
|
1032
|
-
<title>Symbols</title>
|
1033
|
-
</definitions>
|
1034
|
-
</terms>
|
1035
|
-
</sections>
|
1036
|
-
</standard-document>
|
1037
|
-
|
1038
|
-
OUTPUT
|
1039
|
-
end
|
1040
|
-
|
1041
|
-
it "treats non-terminal terms subclause named as terms clause as a terms clause" do
|
1042
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1043
|
-
#{ASCIIDOC_BLANK_HDR}
|
1044
|
-
== Scope
|
1045
|
-
|
1046
|
-
[[tda]]
|
1047
|
-
== Terms, definitions, symbols and abbreviations
|
1048
|
-
|
1049
|
-
[[terms]]
|
1050
|
-
=== Terms and definitions
|
1051
|
-
|
1052
|
-
[[terms-concepts]]
|
1053
|
-
==== Basic concepts
|
1054
|
-
|
1055
|
-
[[term-date]]
|
1056
|
-
===== date
|
1057
|
-
|
1058
|
-
_time_ (<<term-time>>) on the _calendar_ (<<term-calendar>>) _time scale_ (<<term-time-scale>>)
|
1059
|
-
|
1060
|
-
INPUT
|
1061
|
-
#{BLANK_HDR}
|
1062
|
-
<sections>
|
1063
|
-
<clause id='_' inline-header='false' obligation='normative' type="scope">
|
1064
|
-
<title>Scope</title>
|
1065
|
-
</clause>
|
1066
|
-
<clause id='tda' obligation='normative'>
|
1067
|
-
<title>Terms and definitions</title>
|
1068
|
-
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
1069
|
-
<clause id='terms' obligation='normative'>
|
1070
|
-
<title>Terms and definitions</title>
|
1071
|
-
<terms id='terms-concepts' obligation='normative'>
|
1072
|
-
<title>Basic concepts</title>
|
1073
|
-
<term id='term-date'>
|
1074
|
-
<preferred>date</preferred>
|
1075
|
-
<definition>
|
1076
|
-
<p id='_'>
|
1077
|
-
<em>time</em>
|
1078
|
-
(
|
1079
|
-
<xref target='term-time'/>
|
1080
|
-
) on the
|
1081
|
-
<em>calendar</em>
|
1082
|
-
(
|
1083
|
-
<xref target='term-calendar'/>
|
1084
|
-
)
|
1085
|
-
<em>time scale</em>
|
1086
|
-
(
|
1087
|
-
<xref target='term-time-scale'/>
|
1088
|
-
)
|
1089
|
-
</p>
|
1090
|
-
</definition>
|
1091
|
-
</term>
|
1092
|
-
</terms>
|
1093
|
-
</clause>
|
1094
|
-
</clause>
|
1095
|
-
</sections>
|
1096
|
-
</standard-document>
|
1097
|
-
OUTPUT
|
1098
|
-
end
|
1099
|
-
|
1100
|
-
it "leaves alone special titles in preface or appendix" do
|
1101
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(strip_guid(<<~"OUTPUT"))
|
1102
|
-
#{ASCIIDOC_BLANK_HDR}
|
1103
|
-
|
1104
|
-
[.preface]
|
1105
|
-
[[t1]]
|
1106
|
-
== Terms and definitions
|
1107
|
-
|
1108
|
-
[[t2]]
|
1109
|
-
=== Term1
|
1110
|
-
|
1111
|
-
[appendix,language=fr]
|
1112
|
-
[[sym]]
|
1113
|
-
== Symbols and abbreviated terms
|
1114
|
-
|
1115
|
-
[.appendix]
|
1116
|
-
[[app]]
|
1117
|
-
[bibliography]
|
1118
|
-
== Normative Reference
|
1119
|
-
INPUT
|
1120
|
-
#{BLANK_HDR}
|
1121
|
-
<preface>
|
1122
|
-
<terms id='t1' obligation='normative'>
|
1123
|
-
<title>Terms and definitions</title>
|
1124
|
-
<term id='t2'>
|
1125
|
-
<preferred>Term1</preferred>
|
1126
|
-
</term>
|
1127
|
-
</terms>
|
1128
|
-
</preface>
|
1129
|
-
<sections> </sections>
|
1130
|
-
<annex id='_' obligation='' language='fr' script=''>
|
1131
|
-
<definitions id='sym' language='fr' obligation="normative">
|
1132
|
-
<title>Symbols and abbreviated terms</title>
|
1133
|
-
</definitions>
|
1134
|
-
</annex>
|
1135
|
-
<annex id='_' obligation='' language='' script=''>
|
1136
|
-
<references id='app' obligation='informative' normative="false">
|
1137
|
-
<title>Bibliography</title>
|
1138
|
-
</references>
|
1139
|
-
</annex>
|
1140
|
-
</standard-document>
|
1141
|
-
OUTPUT
|
1142
|
-
end
|
973
|
+
INPUT
|
974
|
+
#{BLANK_HDR.sub(%r{<language>en</language>}, '<language>zh</language>').sub(%r{<script>Latn</script>}, '<script>Hans</script>')}
|
975
|
+
<termdocsource bibitemid="iso1234"/><termdocsource bibitemid="iso5678"/><preface><foreword id='_' obligation="informative">
|
976
|
+
<title>前言</title>
|
977
|
+
<p id="_">Foreword</p>
|
978
|
+
</foreword></preface><sections>
|
979
|
+
<terms id="_" obligation="normative">
|
980
|
+
<title>术语和定义</title><p id="_"><eref bibitemid="iso1234"/>和<eref bibitemid="iso5678"/>界定的术语和定义适用于本文件。</p>
|
981
|
+
</terms></sections>
|
982
|
+
</standard-document>
|
983
|
+
OUTPUT
|
984
|
+
end
|
985
|
+
|
986
|
+
it "warn about external source for terms & definitions that does not point anywhere" do
|
987
|
+
expect { Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true) }.to output(/not referenced/).to_stderr
|
988
|
+
#{ASCIIDOC_BLANK_HDR}
|
989
|
+
|
990
|
+
[source="iso712"]
|
991
|
+
== Terms and Definitions
|
992
|
+
=== Term2
|
993
|
+
INPUT
|
994
|
+
end
|
1143
995
|
|
996
|
+
it "treats terminal terms subclause named as terms clause as a normal clause" do
|
997
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
998
|
+
#{ASCIIDOC_BLANK_HDR}
|
999
|
+
[[tda]]
|
1000
|
+
== Terms, definitions, symbols and abbreviations
|
1001
|
+
|
1002
|
+
[[terms]]
|
1003
|
+
=== Terms and definitions
|
1004
|
+
|
1005
|
+
=== Symbols
|
1006
|
+
|
1007
|
+
INPUT
|
1008
|
+
#{BLANK_HDR}
|
1009
|
+
<sections>
|
1010
|
+
<terms id='tda' obligation='normative'>
|
1011
|
+
<title>Terms, definitions and symbols</title>
|
1012
|
+
<p id='_'>No terms and definitions are listed in this document.</p>
|
1013
|
+
<clause id='terms' inline-header='false' obligation='normative'>
|
1014
|
+
<title>Terms and definitions</title>
|
1015
|
+
</clause>
|
1016
|
+
<definitions id='_' obligation="normative" type="symbols">
|
1017
|
+
<title>Symbols</title>
|
1018
|
+
</definitions>
|
1019
|
+
</terms>
|
1020
|
+
</sections>
|
1021
|
+
</standard-document>
|
1022
|
+
OUTPUT
|
1023
|
+
end
|
1024
|
+
|
1025
|
+
it "treats non-terminal terms subclause named as terms clause as a terms clause" do
|
1026
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
1027
|
+
#{ASCIIDOC_BLANK_HDR}
|
1028
|
+
== Scope
|
1029
|
+
|
1030
|
+
[[tda]]
|
1031
|
+
== Terms, definitions, symbols and abbreviations
|
1032
|
+
|
1033
|
+
[[terms]]
|
1034
|
+
=== Terms and definitions
|
1035
|
+
|
1036
|
+
[[terms-concepts]]
|
1037
|
+
==== Basic concepts
|
1038
|
+
|
1039
|
+
[[term-date]]
|
1040
|
+
===== date
|
1041
|
+
|
1042
|
+
_time_ (<<term-time>>) on the _calendar_ (<<term-calendar>>) _time scale_ (<<term-time-scale>>)
|
1043
|
+
|
1044
|
+
INPUT
|
1045
|
+
#{BLANK_HDR}
|
1046
|
+
<sections>
|
1047
|
+
<clause id='_' inline-header='false' obligation='normative' type="scope">
|
1048
|
+
<title>Scope</title>
|
1049
|
+
</clause>
|
1050
|
+
<clause id='tda' obligation='normative'>
|
1051
|
+
<title>Terms and definitions</title>
|
1052
|
+
<p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
|
1053
|
+
<clause id='terms' obligation='normative'>
|
1054
|
+
<title>Terms and definitions</title>
|
1055
|
+
<terms id='terms-concepts' obligation='normative'>
|
1056
|
+
<title>Basic concepts</title>
|
1057
|
+
<term id='term-date'>
|
1058
|
+
<preferred>date</preferred>
|
1059
|
+
<definition>
|
1060
|
+
<p id='_'>
|
1061
|
+
<em>time</em>
|
1062
|
+
(
|
1063
|
+
<xref target='term-time'/>
|
1064
|
+
) on the
|
1065
|
+
<em>calendar</em>
|
1066
|
+
(
|
1067
|
+
<xref target='term-calendar'/>
|
1068
|
+
)
|
1069
|
+
<em>time scale</em>
|
1070
|
+
(
|
1071
|
+
<xref target='term-time-scale'/>
|
1072
|
+
)
|
1073
|
+
</p>
|
1074
|
+
</definition>
|
1075
|
+
</term>
|
1076
|
+
</terms>
|
1077
|
+
</clause>
|
1078
|
+
</clause>
|
1079
|
+
</sections>
|
1080
|
+
</standard-document>
|
1081
|
+
OUTPUT
|
1082
|
+
end
|
1083
|
+
|
1084
|
+
it "leaves alone special titles in preface or appendix" do
|
1085
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(strip_guid(<<~"OUTPUT"))
|
1086
|
+
#{ASCIIDOC_BLANK_HDR}
|
1087
|
+
|
1088
|
+
[.preface]
|
1089
|
+
[[t1]]
|
1090
|
+
== Terms and definitions
|
1091
|
+
|
1092
|
+
[[t2]]
|
1093
|
+
=== Term1
|
1094
|
+
|
1095
|
+
[appendix,language=fr]
|
1096
|
+
[[sym]]
|
1097
|
+
== Symbols and abbreviated terms
|
1098
|
+
|
1099
|
+
[.appendix]
|
1100
|
+
[[app]]
|
1101
|
+
[bibliography]
|
1102
|
+
== Normative Reference
|
1103
|
+
INPUT
|
1104
|
+
#{BLANK_HDR}
|
1105
|
+
<preface>
|
1106
|
+
<terms id='t1' obligation='normative'>
|
1107
|
+
<title>Terms and definitions</title>
|
1108
|
+
<term id='t2'>
|
1109
|
+
<preferred>Term1</preferred>
|
1110
|
+
</term>
|
1111
|
+
</terms>
|
1112
|
+
</preface>
|
1113
|
+
<sections> </sections>
|
1114
|
+
<annex id='_' obligation='' language='fr' script=''>
|
1115
|
+
<definitions id='sym' language='fr' obligation="normative">
|
1116
|
+
<title>Symbols and abbreviated terms</title>
|
1117
|
+
</definitions>
|
1118
|
+
</annex>
|
1119
|
+
<annex id='_' obligation='' language='' script=''>
|
1120
|
+
<references id='app' obligation='informative' normative="false">
|
1121
|
+
<title>Bibliography</title>
|
1122
|
+
</references>
|
1123
|
+
</annex>
|
1124
|
+
</standard-document>
|
1125
|
+
OUTPUT
|
1126
|
+
end
|
1144
1127
|
end
|