metanorma-bsi 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +6 -0
- data/.hound.yml +3 -0
- data/.rubocop.yml +14 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +7 -0
- data/LICENSE +25 -0
- data/README.adoc +199 -0
- data/Rakefile +8 -0
- data/bin/rspec +18 -0
- data/lib/asciidoctor/bsi/basicdoc.rng +1131 -0
- data/lib/asciidoctor/bsi/biblio.rng +1235 -0
- data/lib/asciidoctor/bsi/bsi.rng +120 -0
- data/lib/asciidoctor/bsi/bsi_intro_en.xml +105 -0
- data/lib/asciidoctor/bsi/cleanup.rb +78 -0
- data/lib/asciidoctor/bsi/cleanup_ref.rb +183 -0
- data/lib/asciidoctor/bsi/converter.rb +83 -0
- data/lib/asciidoctor/bsi/front.rb +67 -0
- data/lib/asciidoctor/bsi/isodoc.rng +1870 -0
- data/lib/asciidoctor/bsi/isostandard.rng +477 -0
- data/lib/asciidoctor/bsi/reqt.rng +194 -0
- data/lib/asciidoctor/bsi/validate.rb +224 -0
- data/lib/asciidoctor/bsi/validate_list.rb +72 -0
- data/lib/asciidoctor/bsi/validate_requirement.rb +163 -0
- data/lib/isodoc/bsi/base_convert.rb +91 -0
- data/lib/isodoc/bsi/bsi.international-standard.xsl +6540 -0
- data/lib/isodoc/bsi/html/html_bsi_intro.html +8 -0
- data/lib/isodoc/bsi/html/html_bsi_titlepage.html +50 -0
- data/lib/isodoc/bsi/html/htmlstyle.css +968 -0
- data/lib/isodoc/bsi/html/htmlstyle.scss +699 -0
- data/lib/isodoc/bsi/html_convert.rb +56 -0
- data/lib/isodoc/bsi/i18n-en.yaml +56 -0
- data/lib/isodoc/bsi/i18n.rb +15 -0
- data/lib/isodoc/bsi/init.rb +24 -0
- data/lib/isodoc/bsi/metadata.rb +33 -0
- data/lib/isodoc/bsi/pdf_convert.rb +17 -0
- data/lib/isodoc/bsi/presentation_xml_convert.rb +72 -0
- data/lib/isodoc/bsi/sts_convert.rb +30 -0
- data/lib/isodoc/bsi/xref.rb +134 -0
- data/lib/metanorma-bsi.rb +15 -0
- data/lib/metanorma/bsi.rb +6 -0
- data/lib/metanorma/bsi/processor.rb +51 -0
- data/lib/metanorma/bsi/version.rb +6 -0
- data/metanorma-bsi.gemspec +47 -0
- data/spec/asciidoctor/base_spec.rb +778 -0
- data/spec/asciidoctor/blocks_spec.rb +553 -0
- data/spec/asciidoctor/cleanup_spec.rb +547 -0
- data/spec/asciidoctor/inline_spec.rb +176 -0
- data/spec/asciidoctor/lists_spec.rb +194 -0
- data/spec/asciidoctor/refs_spec.rb +318 -0
- data/spec/asciidoctor/section_spec.rb +382 -0
- data/spec/asciidoctor/validate_spec.rb +858 -0
- data/spec/assets/header.html +7 -0
- data/spec/assets/html.css +2 -0
- data/spec/assets/iso.xml +71 -0
- data/spec/assets/rice_image1.png +0 -0
- data/spec/assets/word.css +2 -0
- data/spec/assets/wordintro.html +4 -0
- data/spec/assets/xref_error.adoc +7 -0
- data/spec/isodoc/blocks_spec.rb +259 -0
- data/spec/isodoc/i18n_spec.rb +442 -0
- data/spec/isodoc/inline_spec.rb +287 -0
- data/spec/isodoc/iso_spec.rb +116 -0
- data/spec/isodoc/metadata_spec.rb +262 -0
- data/spec/isodoc/postproc_spec.rb +137 -0
- data/spec/isodoc/ref_spec.rb +376 -0
- data/spec/isodoc/section_spec.rb +467 -0
- data/spec/isodoc/terms_spec.rb +246 -0
- data/spec/isodoc/xref_spec.rb +1730 -0
- data/spec/metanorma/processor_spec.rb +76 -0
- data/spec/spec_helper.rb +291 -0
- data/spec/vcr_cassettes/iso-639.yml +182 -0
- data/spec/vcr_cassettes/isobib_get_639_1967.yml +136 -0
- data/spec/vcr_cassettes/multistandard.yml +352 -0
- metadata +343 -0
@@ -0,0 +1,176 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe Asciidoctor::BSI do
|
4
|
+
before(:all) do
|
5
|
+
@blank_hdr = blank_hdr_gen
|
6
|
+
end
|
7
|
+
|
8
|
+
it "processes inline_quoted formatting" do
|
9
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
10
|
+
#{ASCIIDOC_BLANK_HDR}
|
11
|
+
_emphasis_
|
12
|
+
*strong*
|
13
|
+
`monospace`
|
14
|
+
"double quote"
|
15
|
+
'single quote'
|
16
|
+
super^script^
|
17
|
+
sub~script~
|
18
|
+
stem:[a_90]
|
19
|
+
stem:[<mml:math><mml:msub xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"> <mml:mrow> <mml:mrow> <mml:mi mathvariant="bold-italic">F</mml:mi> </mml:mrow> </mml:mrow> <mml:mrow> <mml:mrow> <mml:mi mathvariant="bold-italic">Α</mml:mi> </mml:mrow> </mml:mrow> </mml:msub> </mml:math>]
|
20
|
+
[alt]#alt#
|
21
|
+
[deprecated]#deprecated#
|
22
|
+
[domain]#domain#
|
23
|
+
[strike]#strike#
|
24
|
+
[smallcap]#smallcap#
|
25
|
+
INPUT
|
26
|
+
#{@blank_hdr}
|
27
|
+
<sections>
|
28
|
+
<em>emphasis</em>
|
29
|
+
<strong>strong</strong>
|
30
|
+
<tt>monospace</tt>
|
31
|
+
“double quote”
|
32
|
+
‘single quote’
|
33
|
+
super<sup>script</sup>
|
34
|
+
sub<sub>script</sub>
|
35
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub><mrow>
|
36
|
+
<mi>a</mi>
|
37
|
+
</mrow>
|
38
|
+
<mrow>
|
39
|
+
<mn>90</mn>
|
40
|
+
</mrow>
|
41
|
+
</msub></math></stem>
|
42
|
+
<stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><msub> <mrow> <mrow> <mi mathvariant="bold-italic">F</mi> </mrow> </mrow> <mrow> <mrow> <mi mathvariant="bold-italic">Α</mi> </mrow> </mrow> </msub> </math></stem>
|
43
|
+
<admitted>alt</admitted>
|
44
|
+
<deprecates>deprecated</deprecates>
|
45
|
+
<domain>domain</domain>
|
46
|
+
<strike>strike</strike>
|
47
|
+
<smallcap>smallcap</smallcap>
|
48
|
+
</sections>
|
49
|
+
</bsi-standard>
|
50
|
+
OUTPUT
|
51
|
+
end
|
52
|
+
|
53
|
+
it "processes breaks" do
|
54
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
55
|
+
#{ASCIIDOC_BLANK_HDR}
|
56
|
+
Line break +
|
57
|
+
line break
|
58
|
+
|
59
|
+
'''
|
60
|
+
|
61
|
+
<<<
|
62
|
+
INPUT
|
63
|
+
#{@blank_hdr}
|
64
|
+
<sections><p id="_">Line break<br/>
|
65
|
+
line break</p>
|
66
|
+
<hr/>
|
67
|
+
<pagebreak/></sections>
|
68
|
+
</bsi-standard>
|
69
|
+
OUTPUT
|
70
|
+
end
|
71
|
+
|
72
|
+
it "processes links" do
|
73
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
74
|
+
#{ASCIIDOC_BLANK_HDR}
|
75
|
+
mailto:fred@example.com
|
76
|
+
http://example.com[]
|
77
|
+
http://example.com[Link]
|
78
|
+
INPUT
|
79
|
+
#{@blank_hdr}
|
80
|
+
<sections>
|
81
|
+
<p id="_">mailto:fred@example.com
|
82
|
+
<link target="http://example.com"/>
|
83
|
+
<link target="http://example.com">Link</link></p>
|
84
|
+
</sections>
|
85
|
+
</bsi-standard>
|
86
|
+
OUTPUT
|
87
|
+
end
|
88
|
+
|
89
|
+
it "processes bookmarks" do
|
90
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
91
|
+
#{ASCIIDOC_BLANK_HDR}
|
92
|
+
Text [[bookmark]] Text
|
93
|
+
INPUT
|
94
|
+
#{@blank_hdr}
|
95
|
+
<sections>
|
96
|
+
<p id="_">Text <bookmark id="bookmark"/> Text</p>
|
97
|
+
</sections>
|
98
|
+
</bsi-standard>
|
99
|
+
OUTPUT
|
100
|
+
end
|
101
|
+
|
102
|
+
it "processes crossreferences" do
|
103
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
104
|
+
#{ASCIIDOC_BLANK_HDR}
|
105
|
+
[[reference]]
|
106
|
+
== Section
|
107
|
+
|
108
|
+
Inline Reference to <<reference>>
|
109
|
+
Footnoted Reference to <<reference,fn>>
|
110
|
+
Inline Reference with Text to <<reference,text>>
|
111
|
+
Footnoted Reference with Text to <<reference,fn: text>>
|
112
|
+
INPUT
|
113
|
+
#{@blank_hdr}
|
114
|
+
<sections>
|
115
|
+
<clause id="reference" inline-header="false" obligation="normative">
|
116
|
+
<title>Section</title>
|
117
|
+
<p id="_">Inline Reference to <xref target="reference"/>
|
118
|
+
Footnoted Reference to <xref target="reference"/>
|
119
|
+
Inline Reference with Text to <xref target="reference">text</xref>
|
120
|
+
Footnoted Reference with Text to <xref target="reference">text</xref></p>
|
121
|
+
</clause>
|
122
|
+
</sections>
|
123
|
+
</bsi-standard>
|
124
|
+
OUTPUT
|
125
|
+
end
|
126
|
+
|
127
|
+
it "processes bibliographic anchors" do
|
128
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
129
|
+
#{ASCIIDOC_BLANK_HDR}
|
130
|
+
[bibliography]
|
131
|
+
== Normative References
|
132
|
+
|
133
|
+
* [[[ISO712,x]]] Reference
|
134
|
+
* [[[ISO713]]] Reference
|
135
|
+
|
136
|
+
INPUT
|
137
|
+
#{@blank_hdr}
|
138
|
+
<sections>
|
139
|
+
|
140
|
+
</sections><bibliography><references id="_" obligation="informative" normative="true">
|
141
|
+
<title>Normative references</title>
|
142
|
+
<p id="_">The following documents are referred to in the text in such a way that some or all of their content constitutes provisions of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
|
143
|
+
<bibitem id="ISO712">
|
144
|
+
<formattedref format="application/x-isodoc+xml">Reference</formattedref>
|
145
|
+
<docidentifier type='metanorma'>[N1]</docidentifier>
|
146
|
+
<docidentifier>x</docidentifier>
|
147
|
+
</bibitem>
|
148
|
+
<bibitem id="ISO713">
|
149
|
+
<formattedref format="application/x-isodoc+xml">Reference</formattedref>
|
150
|
+
<docidentifier type='metanorma'>[N2]</docidentifier>
|
151
|
+
<docidentifier>ISO713</docidentifier>
|
152
|
+
<docnumber>713</docnumber>
|
153
|
+
</bibitem>
|
154
|
+
</references>
|
155
|
+
</bibliography>
|
156
|
+
</bsi-standard>
|
157
|
+
OUTPUT
|
158
|
+
end
|
159
|
+
|
160
|
+
it "processes footnotes" do
|
161
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
162
|
+
#{ASCIIDOC_BLANK_HDR}
|
163
|
+
Hello!footnote:[Footnote text]
|
164
|
+
INPUT
|
165
|
+
#{@blank_hdr}
|
166
|
+
<sections>
|
167
|
+
<p id="_">Hello!<fn reference="1">
|
168
|
+
<p id="_">Footnote text</p>
|
169
|
+
</fn></p>
|
170
|
+
</sections>
|
171
|
+
</bsi-standard>
|
172
|
+
OUTPUT
|
173
|
+
end
|
174
|
+
|
175
|
+
|
176
|
+
end
|
@@ -0,0 +1,194 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe Asciidoctor::BSI do
|
4
|
+
before(:all) do
|
5
|
+
@blank_hdr = blank_hdr_gen
|
6
|
+
end
|
7
|
+
|
8
|
+
it "processes simple lists" do
|
9
|
+
output = Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)
|
10
|
+
#{ASCIIDOC_BLANK_HDR}
|
11
|
+
* List 1
|
12
|
+
* List 2
|
13
|
+
* List 3
|
14
|
+
|
15
|
+
. List A
|
16
|
+
. List B
|
17
|
+
. List C
|
18
|
+
|
19
|
+
List D:: List E
|
20
|
+
List F:: List G
|
21
|
+
|
22
|
+
INPUT
|
23
|
+
expect(xmlpp(strip_guid(output))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
24
|
+
#{@blank_hdr}
|
25
|
+
<sections>
|
26
|
+
<ul id="_">
|
27
|
+
<li>
|
28
|
+
<p id="_">List 1</p>
|
29
|
+
</li>
|
30
|
+
<li>
|
31
|
+
<p id="_">List 2</p>
|
32
|
+
</li>
|
33
|
+
<li>
|
34
|
+
<p id="_">List 3</p>
|
35
|
+
<ol id="_">
|
36
|
+
<li>
|
37
|
+
<p id="_">List A</p>
|
38
|
+
</li>
|
39
|
+
<li>
|
40
|
+
<p id="_">List B</p>
|
41
|
+
</li>
|
42
|
+
<li>
|
43
|
+
<p id="_">List C</p>
|
44
|
+
<dl id="_">
|
45
|
+
<dt>List D</dt>
|
46
|
+
<dd>
|
47
|
+
<p id="_">List E</p>
|
48
|
+
</dd>
|
49
|
+
<dt>List F</dt>
|
50
|
+
<dd>
|
51
|
+
<p id="_">List G</p>
|
52
|
+
</dd>
|
53
|
+
</dl>
|
54
|
+
</li>
|
55
|
+
</ol>
|
56
|
+
</li>
|
57
|
+
</ul>
|
58
|
+
</sections>
|
59
|
+
</bsi-standard>
|
60
|
+
OUTPUT
|
61
|
+
end
|
62
|
+
|
63
|
+
it "processes complex lists" do
|
64
|
+
output = Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)
|
65
|
+
#{ASCIIDOC_BLANK_HDR}
|
66
|
+
[[id]]
|
67
|
+
* First
|
68
|
+
* Second
|
69
|
+
+
|
70
|
+
--
|
71
|
+
entry1
|
72
|
+
|
73
|
+
entry2
|
74
|
+
--
|
75
|
+
|
76
|
+
[[id1]]
|
77
|
+
[loweralpha]
|
78
|
+
. First
|
79
|
+
. Second
|
80
|
+
[upperalpha]
|
81
|
+
.. Third
|
82
|
+
.. Fourth
|
83
|
+
. Fifth
|
84
|
+
. Sixth
|
85
|
+
|
86
|
+
[lowerroman]
|
87
|
+
. A
|
88
|
+
. B
|
89
|
+
[upperroman]
|
90
|
+
.. C
|
91
|
+
.. D
|
92
|
+
[arabic]
|
93
|
+
... E
|
94
|
+
... F
|
95
|
+
|
96
|
+
|
97
|
+
Notes1::
|
98
|
+
Notes:: Note 1.
|
99
|
+
+
|
100
|
+
Note 2.
|
101
|
+
+
|
102
|
+
Note 3.
|
103
|
+
|
104
|
+
INPUT
|
105
|
+
expect(xmlpp(strip_guid(output))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
106
|
+
#{@blank_hdr}
|
107
|
+
<sections><ul id="id">
|
108
|
+
<li>
|
109
|
+
<p id="_">First</p>
|
110
|
+
</li>
|
111
|
+
<li><p id="_">Second</p><p id="_">entry1</p>
|
112
|
+
<p id="_">entry2</p></li>
|
113
|
+
</ul>
|
114
|
+
<ol id="id1">
|
115
|
+
<li>
|
116
|
+
<p id="_">First</p>
|
117
|
+
</li>
|
118
|
+
<li>
|
119
|
+
<p id="_">Second</p>
|
120
|
+
<ol id="_">
|
121
|
+
<li>
|
122
|
+
<p id="_">Third</p>
|
123
|
+
</li>
|
124
|
+
<li>
|
125
|
+
<p id="_">Fourth</p>
|
126
|
+
</li>
|
127
|
+
</ol>
|
128
|
+
</li>
|
129
|
+
<li>
|
130
|
+
<p id="_">Fifth</p>
|
131
|
+
</li>
|
132
|
+
<li>
|
133
|
+
<p id="_">Sixth</p>
|
134
|
+
</li>
|
135
|
+
</ol>
|
136
|
+
<ol id="_">
|
137
|
+
<li>
|
138
|
+
<p id="_">A</p>
|
139
|
+
</li>
|
140
|
+
<li>
|
141
|
+
<p id="_">B</p>
|
142
|
+
<ol id="_">
|
143
|
+
<li>
|
144
|
+
<p id="_">C</p>
|
145
|
+
</li>
|
146
|
+
<li>
|
147
|
+
<p id="_">D</p>
|
148
|
+
<ol id="_">
|
149
|
+
<li>
|
150
|
+
<p id="_">E</p>
|
151
|
+
</li>
|
152
|
+
<li>
|
153
|
+
<p id="_">F</p>
|
154
|
+
<dl id="_">
|
155
|
+
<dt>Notes1</dt>
|
156
|
+
<dd/>
|
157
|
+
<dt>Notes</dt>
|
158
|
+
<dd><p id="_">Note 1.</p><p id="_">Note 2.</p>
|
159
|
+
<p id="_">Note 3.</p></dd>
|
160
|
+
</dl>
|
161
|
+
</li>
|
162
|
+
</ol>
|
163
|
+
</li>
|
164
|
+
</ol>
|
165
|
+
</li>
|
166
|
+
</ol></sections>
|
167
|
+
</bsi-standard>
|
168
|
+
OUTPUT
|
169
|
+
end
|
170
|
+
|
171
|
+
it "anchors lists and list items" do
|
172
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
173
|
+
#{ASCIIDOC_BLANK_HDR}
|
174
|
+
[[id1]]
|
175
|
+
* [[id2]] List item
|
176
|
+
* Hello [[id3]] List item
|
177
|
+
|
178
|
+
INPUT
|
179
|
+
#{@blank_hdr}
|
180
|
+
<sections>
|
181
|
+
<ul id="id1">
|
182
|
+
<li id="id2">
|
183
|
+
<p id="_">List item</p>
|
184
|
+
</li>
|
185
|
+
<li>
|
186
|
+
<p id="_">Hello <bookmark id="id3"/> List item</p>
|
187
|
+
</li>
|
188
|
+
</ul>
|
189
|
+
</sections>
|
190
|
+
</bsi-standard>
|
191
|
+
OUTPUT
|
192
|
+
end
|
193
|
+
|
194
|
+
end
|
@@ -0,0 +1,318 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe Asciidoctor::BSI do
|
4
|
+
before(:all) do
|
5
|
+
@blank_hdr = blank_hdr_gen
|
6
|
+
end
|
7
|
+
|
8
|
+
it "does not introduce subheadings in normative references of one type" do
|
9
|
+
expect(xmlpp(strip_guid(Nokogiri::XML(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)).at("//xmlns:bibliography").to_xml))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
10
|
+
= Document title
|
11
|
+
Author
|
12
|
+
:docfile: test.adoc
|
13
|
+
:nodoc:
|
14
|
+
:no-isobib-cache:
|
15
|
+
|
16
|
+
[bibliography]
|
17
|
+
== Normative References
|
18
|
+
* [[[ref4,REF4]]] REF4
|
19
|
+
* [[[ref6,REF6]]] REF6
|
20
|
+
|
21
|
+
[bibliography]
|
22
|
+
== Bibliography
|
23
|
+
* [[[ref5,REF5]]] REF5
|
24
|
+
INPUT
|
25
|
+
<bibliography>
|
26
|
+
<references id='_' normative='true' obligation='informative'>
|
27
|
+
<title>Normative references</title>
|
28
|
+
<p id='_'>
|
29
|
+
The following documents are referred to in the text in such a way that
|
30
|
+
some or all of their content constitutes provisions of this document.
|
31
|
+
For dated references, only the edition cited applies. For undated
|
32
|
+
references, the latest edition of the referenced document (including any
|
33
|
+
amendments) applies.
|
34
|
+
</p>
|
35
|
+
<bibitem id='ref4'>
|
36
|
+
<formattedref format='application/x-isodoc+xml'>REF4</formattedref>
|
37
|
+
<docidentifier type='metanorma'>[N1]</docidentifier>
|
38
|
+
<docidentifier>REF4</docidentifier>
|
39
|
+
<docnumber>4</docnumber>
|
40
|
+
</bibitem>
|
41
|
+
<bibitem id='ref6'>
|
42
|
+
<formattedref format='application/x-isodoc+xml'>REF6</formattedref>
|
43
|
+
<docidentifier type='metanorma'>[N2]</docidentifier>
|
44
|
+
<docidentifier>REF6</docidentifier>
|
45
|
+
<docnumber>6</docnumber>
|
46
|
+
</bibitem>
|
47
|
+
</references>
|
48
|
+
<references id='_' normative='false' obligation='informative'>
|
49
|
+
<title>Bibliography</title>
|
50
|
+
<p id='_'>
|
51
|
+
For dated references, only the edition cited applies. For undated
|
52
|
+
references, the latest edition of the referenced document (including any
|
53
|
+
amendments) applies.
|
54
|
+
</p>
|
55
|
+
<bibitem id='ref5'>
|
56
|
+
<formattedref format='application/x-isodoc+xml'>REF5</formattedref>
|
57
|
+
<docidentifier type='metanorma'>[1]</docidentifier>
|
58
|
+
<docidentifier>REF5</docidentifier>
|
59
|
+
<docnumber>5</docnumber>
|
60
|
+
</bibitem>
|
61
|
+
</references>
|
62
|
+
</bibliography>
|
63
|
+
OUTPUT
|
64
|
+
end
|
65
|
+
|
66
|
+
it "sorts references" do
|
67
|
+
VCR.use_cassette "multistandard" do
|
68
|
+
expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
|
69
|
+
= Document title
|
70
|
+
Author
|
71
|
+
:docfile: test.adoc
|
72
|
+
:nodoc:
|
73
|
+
:no-isobib-cache:
|
74
|
+
|
75
|
+
<<ref3>>
|
76
|
+
<<ref7>>
|
77
|
+
<<ref6>>
|
78
|
+
<<ref1>>
|
79
|
+
<<ref4>>
|
80
|
+
<<ref5>>
|
81
|
+
<<ref2>>
|
82
|
+
|
83
|
+
[bibliography]
|
84
|
+
== Normative References
|
85
|
+
* [[[ref4,REF4]]] REF4
|
86
|
+
* [[[ref5,ISO 639:1967]]] REF5
|
87
|
+
* [[[ref6,REF6]]] REF6
|
88
|
+
* [[[ref7,IETF RFC 7749]]] REF7
|
89
|
+
|
90
|
+
[bibliography]
|
91
|
+
== Bibliography
|
92
|
+
* [[[ref1,REF1]]] REF1
|
93
|
+
* [[[ref2,ISO 15124]]] REF2
|
94
|
+
* [[[ref3,REF3]]] REF3
|
95
|
+
INPUT
|
96
|
+
#{@blank_hdr}
|
97
|
+
<preface>
|
98
|
+
<foreword id='_' obligation='informative'>
|
99
|
+
<title>FOREWORD</title>
|
100
|
+
<p id='_'>
|
101
|
+
<eref type='inline' bibitemid='ref3' citeas='[1]'/>
|
102
|
+
<eref type='inline' bibitemid='ref7' citeas='IETF RFC 7749'/>
|
103
|
+
<eref type='inline' bibitemid='ref6' citeas='[N1]'/>
|
104
|
+
<eref type='inline' bibitemid='ref1' citeas='[2]'/>
|
105
|
+
<eref type='inline' bibitemid='ref4' citeas='[N2]'/>
|
106
|
+
<eref type='inline' bibitemid='ref5' citeas='ISO/R 639:1967'/>
|
107
|
+
<eref type='inline' bibitemid='ref2' citeas='ISO/IEC ISP 15124-1:1998'/>
|
108
|
+
</p>
|
109
|
+
</foreword>
|
110
|
+
</preface>
|
111
|
+
<sections> </sections>
|
112
|
+
<bibliography>
|
113
|
+
<clause id='_' obligation='informative'>
|
114
|
+
<title>Normative references</title>
|
115
|
+
<p id='_'>
|
116
|
+
The following documents are referred to in the text in such a way that
|
117
|
+
some or all of their content constitutes provisions of this document.
|
118
|
+
For dated references, only the edition cited applies. For undated
|
119
|
+
references, the latest edition of the referenced document (including any
|
120
|
+
amendments) applies.
|
121
|
+
</p>
|
122
|
+
<references normative='true' unnumbered='true'>
|
123
|
+
<title>Standards publications</title>
|
124
|
+
<bibitem id='ref7' type='standard'>
|
125
|
+
<fetched>#{Date.today}</fetched>
|
126
|
+
<title format='text/plain' language='en' script='Latn'>The “xml2rfc” Version 2 Vocabulary</title>
|
127
|
+
<uri type='xml'>
|
128
|
+
https://raw.githubusercontent.com/relaton/relaton-data-ietf/master/data/reference.RFC.7749.xml
|
129
|
+
</uri>
|
130
|
+
<uri type='src'>https://www.rfc-editor.org/info/rfc7749</uri>
|
131
|
+
<docidentifier type='IETF'>RFC 7749</docidentifier>
|
132
|
+
<docidentifier type='rfc-anchor'>RFC7749</docidentifier>
|
133
|
+
<docidentifier type='DOI'>10.17487/RFC7749</docidentifier>
|
134
|
+
<date type='published'>
|
135
|
+
<on>2016-02</on>
|
136
|
+
</date>
|
137
|
+
<contributor>
|
138
|
+
<role type='author'/>
|
139
|
+
<person>
|
140
|
+
<name>
|
141
|
+
<completename language='en'>J. Reschke</completename>
|
142
|
+
</name>
|
143
|
+
<affiliation>
|
144
|
+
<organization>
|
145
|
+
<name>Internet Engineering Task Force</name>
|
146
|
+
<abbreviation>IETF</abbreviation>
|
147
|
+
</organization>
|
148
|
+
</affiliation>
|
149
|
+
</person>
|
150
|
+
</contributor>
|
151
|
+
<contributor>
|
152
|
+
<role type='publisher'/>
|
153
|
+
<organization>
|
154
|
+
<name>Internet Engineering Task Force</name>
|
155
|
+
<abbreviation>IETF</abbreviation>
|
156
|
+
</organization>
|
157
|
+
</contributor>
|
158
|
+
<language>en</language>
|
159
|
+
<script>Latn</script>
|
160
|
+
<abstract format='text/plain' language='en' script='Latn'>
|
161
|
+
This document defines the “xml2rfc” version 2
|
162
|
+
vocabulary: an XML-based language used for writing RFCs and
|
163
|
+
Internet-Drafts.Version 2 represents the state of the vocabulary (as
|
164
|
+
implemented by several tools and as used by the RFC Editor) around
|
165
|
+
2014.This document obsoletes RFC 2629.
|
166
|
+
</abstract>
|
167
|
+
<series type='main'>
|
168
|
+
<title format='text/plain' language='en' script='Latn'>RFC</title>
|
169
|
+
<number>7749</number>
|
170
|
+
</series>
|
171
|
+
<place>Fremont, CA</place>
|
172
|
+
</bibitem>
|
173
|
+
<bibitem id='ref5' type='standard'>
|
174
|
+
<fetched>#{Date.today}</fetched>
|
175
|
+
<title type='title-main' format='text/plain' language='en' script='Latn'>Symbols for languages, countries and authorities</title>
|
176
|
+
<title type='main' format='text/plain' language='en' script='Latn'>Symbols for languages, countries and authorities</title>
|
177
|
+
<uri type='src'>https://www.iso.org/standard/4765.html</uri>
|
178
|
+
<uri type='rss'>https://www.iso.org/contents/data/standard/00/47/4765.detail.rss</uri>
|
179
|
+
<docidentifier type='ISO'>ISO/R 639:1967</docidentifier>
|
180
|
+
<docidentifier type='URN'>urn:iso:std:iso-r:r:639:stage-95.99:ed-1:en</docidentifier>
|
181
|
+
<docnumber>639</docnumber>
|
182
|
+
<date type='published'>
|
183
|
+
<on>1967-11</on>
|
184
|
+
</date>
|
185
|
+
<contributor>
|
186
|
+
<role type='publisher'/>
|
187
|
+
<organization>
|
188
|
+
<name>International Organization for Standardization</name>
|
189
|
+
<abbreviation>ISO</abbreviation>
|
190
|
+
<uri>www.iso.org</uri>
|
191
|
+
</organization>
|
192
|
+
</contributor>
|
193
|
+
<edition>1</edition>
|
194
|
+
<language>en</language>
|
195
|
+
<script>Latn</script>
|
196
|
+
<status>
|
197
|
+
<stage>95</stage>
|
198
|
+
<substage>99</substage>
|
199
|
+
</status>
|
200
|
+
<copyright>
|
201
|
+
<from>1967</from>
|
202
|
+
<owner>
|
203
|
+
<organization>
|
204
|
+
<name>ISO/R</name>
|
205
|
+
</organization>
|
206
|
+
</owner>
|
207
|
+
</copyright>
|
208
|
+
<place>Geneva</place>
|
209
|
+
</bibitem>
|
210
|
+
</references>
|
211
|
+
<references normative='true' unnumbered='true'>
|
212
|
+
<title>Other publications</title>
|
213
|
+
<bibitem id='ref6'>
|
214
|
+
<formattedref format='application/x-isodoc+xml'>REF6</formattedref>
|
215
|
+
<docidentifier type='metanorma'>[N1]</docidentifier>
|
216
|
+
<docidentifier>REF6</docidentifier>
|
217
|
+
<docnumber>6</docnumber>
|
218
|
+
</bibitem>
|
219
|
+
<bibitem id='ref4'>
|
220
|
+
<formattedref format='application/x-isodoc+xml'>REF4</formattedref>
|
221
|
+
<docidentifier type='metanorma'>[N2]</docidentifier>
|
222
|
+
<docidentifier>REF4</docidentifier>
|
223
|
+
<docnumber>4</docnumber>
|
224
|
+
</bibitem>
|
225
|
+
</references>
|
226
|
+
</clause>
|
227
|
+
<references id='_' normative='false' obligation='informative'>
|
228
|
+
<title>Bibliography</title>
|
229
|
+
<references normative='false' unnumbered='true'>
|
230
|
+
<title>Standards publications</title>
|
231
|
+
<p id='_'>
|
232
|
+
For dated references, only the edition cited applies. For undated
|
233
|
+
references, the latest edition of the referenced document (including
|
234
|
+
any amendments) applies.
|
235
|
+
</p>
|
236
|
+
<bibitem id='ref2' type='standard'>
|
237
|
+
<fetched>#{Date.today}</fetched>
|
238
|
+
<title type='title-intro' format='text/plain' language='en' script='Latn'>Information technology</title>
|
239
|
+
<title type='title-main' format='text/plain' language='en' script='Latn'>International Standardized Profile FOD126</title>
|
240
|
+
<title type='title-part' format='text/plain' language='en' script='Latn'>
|
241
|
+
Open Document Format: Image
|
242
|
+
Applications — Enhanced document
|
243
|
+
structure — Character, raster graphics, and
|
244
|
+
geometric graphics content architecture — Part 1:
|
245
|
+
Document Application Profile (DAP)
|
246
|
+
</title>
|
247
|
+
<title type='main' format='text/plain' language='en' script='Latn'>
|
248
|
+
Information technology — International
|
249
|
+
Standardized Profile FOD126 — Open Document
|
250
|
+
Format: Image Applications — Enhanced document
|
251
|
+
structure — Character, raster graphics, and
|
252
|
+
geometric graphics content architecture — Part 1:
|
253
|
+
Document Application Profile (DAP)
|
254
|
+
</title>
|
255
|
+
<uri type='src'>https://www.iso.org/standard/26440.html</uri>
|
256
|
+
<uri type='rss'>https://www.iso.org/contents/data/standard/02/64/26440.detail.rss</uri>
|
257
|
+
<docidentifier type='ISO'>ISO/IEC ISP 15124-1:1998</docidentifier>
|
258
|
+
<docidentifier type='URN'>urn:iso:std:iso-iec:isp:15124:-1:stage-95.99:ed-1:en</docidentifier>
|
259
|
+
<docnumber>15124</docnumber>
|
260
|
+
<date type='published'>
|
261
|
+
<on>1998-07</on>
|
262
|
+
</date>
|
263
|
+
<contributor>
|
264
|
+
<role type='publisher'/>
|
265
|
+
<organization>
|
266
|
+
<name>International Organization for Standardization</name>
|
267
|
+
<abbreviation>ISO</abbreviation>
|
268
|
+
<uri>www.iso.org</uri>
|
269
|
+
</organization>
|
270
|
+
</contributor>
|
271
|
+
<contributor>
|
272
|
+
<role type='publisher'/>
|
273
|
+
<organization>
|
274
|
+
<name>International Electrotechnical Commission</name>
|
275
|
+
<abbreviation>IEC</abbreviation>
|
276
|
+
<uri>www.iec.ch</uri>
|
277
|
+
</organization>
|
278
|
+
</contributor>
|
279
|
+
<edition>1</edition>
|
280
|
+
<language>en</language>
|
281
|
+
<script>Latn</script>
|
282
|
+
<status>
|
283
|
+
<stage>95</stage>
|
284
|
+
<substage>99</substage>
|
285
|
+
</status>
|
286
|
+
<copyright>
|
287
|
+
<from>1998</from>
|
288
|
+
<owner>
|
289
|
+
<organization>
|
290
|
+
<name>ISO/IEC</name>
|
291
|
+
</organization>
|
292
|
+
</owner>
|
293
|
+
</copyright>
|
294
|
+
<place>Geneva</place>
|
295
|
+
</bibitem>
|
296
|
+
</references>
|
297
|
+
<references normative='false' unnumbered='true'>
|
298
|
+
<title>Other publications</title>
|
299
|
+
<bibitem id='ref3'>
|
300
|
+
<formattedref format='application/x-isodoc+xml'>REF3</formattedref>
|
301
|
+
<docidentifier type='metanorma'>[1]</docidentifier>
|
302
|
+
<docidentifier>REF3</docidentifier>
|
303
|
+
<docnumber>3</docnumber>
|
304
|
+
</bibitem>
|
305
|
+
<bibitem id='ref1'>
|
306
|
+
<formattedref format='application/x-isodoc+xml'>REF1</formattedref>
|
307
|
+
<docidentifier type='metanorma'>[2]</docidentifier>
|
308
|
+
<docidentifier>REF1</docidentifier>
|
309
|
+
<docnumber>1</docnumber>
|
310
|
+
</bibitem>
|
311
|
+
</references>
|
312
|
+
</references>
|
313
|
+
</bibliography>
|
314
|
+
</bsi-standard>
|
315
|
+
OUTPUT
|
316
|
+
end
|
317
|
+
end
|
318
|
+
end
|