asciidoctor-rfc 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +5 -0
- data/.oss-guides.rubocop.yml +1077 -0
- data/.rspec +1 -0
- data/.rubocop.yml +19 -1063
- data/.travis.yml +3 -2
- data/Guardfile +22 -0
- data/README.adoc +1151 -0
- data/Rakefile +1 -1
- data/asciidoctor-rfc.gemspec +20 -3
- data/bin/asciidoctor-rfc2 +15 -0
- data/bin/asciidoctor-rfc3 +15 -0
- data/bin/rspec +0 -1
- data/lib/asciidoctor-rfc.rb +4 -0
- data/lib/asciidoctor/rfc/common/base.rb +218 -0
- data/lib/asciidoctor/rfc/common/front.rb +120 -0
- data/lib/asciidoctor/rfc/v2/base.rb +341 -0
- data/lib/asciidoctor/rfc/v2/blocks.rb +192 -0
- data/lib/asciidoctor/rfc/v2/converter.rb +64 -0
- data/lib/asciidoctor/rfc/v2/front.rb +69 -0
- data/lib/asciidoctor/rfc/v2/inline_anchor.rb +102 -0
- data/lib/asciidoctor/rfc/v2/lists.rb +134 -0
- data/lib/asciidoctor/rfc/v2/table.rb +112 -0
- data/lib/asciidoctor/rfc/v2/validate.rb +738 -0
- data/lib/asciidoctor/rfc/v2/validate2.rng +716 -0
- data/lib/asciidoctor/rfc/v3/base.rb +358 -0
- data/lib/asciidoctor/rfc/v3/blocks.rb +203 -0
- data/lib/asciidoctor/rfc/v3/converter.rb +64 -0
- data/lib/asciidoctor/rfc/v3/front.rb +115 -0
- data/lib/asciidoctor/rfc/v3/inline_anchor.rb +90 -0
- data/lib/asciidoctor/rfc/v3/lists.rb +190 -0
- data/lib/asciidoctor/rfc/v3/svg.rng +9081 -0
- data/lib/asciidoctor/rfc/v3/table.rb +65 -0
- data/lib/asciidoctor/rfc/v3/validate.rb +2168 -0
- data/lib/asciidoctor/rfc/v3/validate.rng +2143 -0
- data/lib/asciidoctor/rfc/version.rb +2 -2
- data/spec/asciidoctor/rfc/v2/appendix_spec.rb +124 -0
- data/spec/asciidoctor/rfc/v2/area_spec.rb +60 -0
- data/spec/asciidoctor/rfc/v2/author_spec.rb +444 -0
- data/spec/asciidoctor/rfc/v2/comments_spec.rb +316 -0
- data/spec/asciidoctor/rfc/v2/crossref_spec.rb +205 -0
- data/spec/asciidoctor/rfc/v2/date_spec.rb +166 -0
- data/spec/asciidoctor/rfc/v2/dlist_spec.rb +108 -0
- data/spec/asciidoctor/rfc/v2/document_spec.rb +161 -0
- data/spec/asciidoctor/rfc/v2/example_spec.rb +50 -0
- data/spec/asciidoctor/rfc/v2/front_spec.rb +75 -0
- data/spec/asciidoctor/rfc/v2/image_spec.rb +81 -0
- data/spec/asciidoctor/rfc/v2/indexterm_spec.rb +66 -0
- data/spec/asciidoctor/rfc/v2/inline_formatting_spec.rb +177 -0
- data/spec/asciidoctor/rfc/v2/keyword_spec.rb +63 -0
- data/spec/asciidoctor/rfc/v2/listing_spec.rb +59 -0
- data/spec/asciidoctor/rfc/v2/literal_spec.rb +53 -0
- data/spec/asciidoctor/rfc/v2/olist_spec.rb +147 -0
- data/spec/asciidoctor/rfc/v2/paragraph_spec.rb +68 -0
- data/spec/asciidoctor/rfc/v2/preamble_spec.rb +140 -0
- data/spec/asciidoctor/rfc/v2/quote_spec.rb +24 -0
- data/spec/asciidoctor/rfc/v2/references_spec.rb +96 -0
- data/spec/asciidoctor/rfc/v2/section_spec.rb +260 -0
- data/spec/asciidoctor/rfc/v2/sidebar_spec.rb +32 -0
- data/spec/asciidoctor/rfc/v2/table_spec.rb +293 -0
- data/spec/asciidoctor/rfc/v2/ulist_spec.rb +96 -0
- data/spec/asciidoctor/rfc/v2/workgroup_spec.rb +60 -0
- data/spec/asciidoctor/rfc/v3/appendix_spec.rb +130 -0
- data/spec/asciidoctor/rfc/v3/area_spec.rb +63 -0
- data/spec/asciidoctor/rfc/v3/author_spec.rb +540 -0
- data/spec/asciidoctor/rfc/v3/comments_spec.rb +308 -0
- data/spec/asciidoctor/rfc/v3/crossref_spec.rb +269 -0
- data/spec/asciidoctor/rfc/v3/date_spec.rb +149 -0
- data/spec/asciidoctor/rfc/v3/dlist_spec.rb +121 -0
- data/spec/asciidoctor/rfc/v3/document_spec.rb +109 -0
- data/spec/asciidoctor/rfc/v3/example_spec.rb +34 -0
- data/spec/asciidoctor/rfc/v3/front_spec.rb +43 -0
- data/spec/asciidoctor/rfc/v3/image_spec.rb +81 -0
- data/spec/asciidoctor/rfc/v3/indexterm_spec.rb +69 -0
- data/spec/asciidoctor/rfc/v3/inline_formatting_spec.rb +319 -0
- data/spec/asciidoctor/rfc/v3/keyword_spec.rb +33 -0
- data/spec/asciidoctor/rfc/v3/link_spec.rb +34 -0
- data/spec/asciidoctor/rfc/v3/listing_spec.rb +59 -0
- data/spec/asciidoctor/rfc/v3/literal_spec.rb +51 -0
- data/spec/asciidoctor/rfc/v3/olist_spec.rb +168 -0
- data/spec/asciidoctor/rfc/v3/paragraph_spec.rb +73 -0
- data/spec/asciidoctor/rfc/v3/preamble_spec.rb +112 -0
- data/spec/asciidoctor/rfc/v3/quote_spec.rb +91 -0
- data/spec/asciidoctor/rfc/v3/references_spec.rb +147 -0
- data/spec/asciidoctor/rfc/v3/section_spec.rb +198 -0
- data/spec/asciidoctor/rfc/v3/series_info_spec.rb +151 -0
- data/spec/asciidoctor/rfc/v3/sidebar_spec.rb +30 -0
- data/spec/asciidoctor/rfc/v3/table_spec.rb +275 -0
- data/spec/asciidoctor/rfc/v3/ulist_spec.rb +74 -0
- data/spec/asciidoctor/rfc/v3/workgroup_spec.rb +33 -0
- data/spec/examples/davies-template-bare-06.adoc +361 -0
- data/spec/examples/davies-template-bare-06.xml.orig +426 -0
- data/spec/examples/example-v2.adoc +181 -0
- data/spec/examples/example-v2.xml +675 -0
- data/spec/examples/example-v3.adoc +185 -0
- data/spec/examples/example-v3.xml +1009 -0
- data/spec/examples/mib-doc-template-xml-06.adoc +596 -0
- data/spec/examples/mib-doc-template-xml-06.xml.orig +654 -0
- data/spec/examples/rfc1149.md +76 -0
- data/spec/examples/rfc1149.md.2.xml +94 -0
- data/spec/examples/rfc1149.md.3.xml +93 -0
- data/spec/examples/rfc1149.md.adoc +65 -0
- data/spec/examples/rfc2100.md +149 -0
- data/spec/examples/rfc2100.md.2.xml +169 -0
- data/spec/examples/rfc2100.md.3.xml +163 -0
- data/spec/examples/rfc2100.md.adoc +136 -0
- data/spec/examples/rfc3514.md +203 -0
- data/spec/examples/rfc3514.md.2.xml +238 -0
- data/spec/examples/rfc3514.md.3.xml +258 -0
- data/spec/examples/rfc3514.md.adoc +324 -0
- data/spec/examples/rfc5841.md +342 -0
- data/spec/examples/rfc5841.md.2.xml +393 -0
- data/spec/examples/rfc5841.md.3.xml +449 -0
- data/spec/examples/rfc5841.md.adoc +414 -0
- data/spec/examples/rfc6350.adoc +3499 -0
- data/spec/examples/rfc6350.bib +763 -0
- data/spec/examples/rfc748.md +79 -0
- data/spec/examples/rfc748.md.2.xml +116 -0
- data/spec/examples/rfc748.md.3.xml +109 -0
- data/spec/examples/rfc748.md.adoc +80 -0
- data/spec/examples/rfc7511.md +257 -0
- data/spec/examples/rfc7511.md.2.xml +300 -0
- data/spec/examples/rfc7511.md.3.xml +347 -0
- data/spec/examples/rfc7511.md.adoc +417 -0
- data/spec/spec_helper.rb +115 -5
- metadata +274 -9
- data/.hound.yml +0 -3
- data/README.md +0 -84
- data/lib/asciidoctor/rfc.rb +0 -7
- data/spec/asciidoctor-rfc/.keep +0 -0
@@ -0,0 +1,124 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
describe Asciidoctor::RFC::V2::Converter do
|
3
|
+
it "renders appendix when section tagged with appendix" do
|
4
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
5
|
+
= Document title
|
6
|
+
:docName:
|
7
|
+
Author
|
8
|
+
|
9
|
+
== Section 1
|
10
|
+
text
|
11
|
+
|
12
|
+
[appendix]
|
13
|
+
== Appendix
|
14
|
+
text
|
15
|
+
INPUT
|
16
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
17
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
18
|
+
|
19
|
+
<rfc
|
20
|
+
submissionType="IETF">
|
21
|
+
<front>
|
22
|
+
<title>Document title</title>
|
23
|
+
<author fullname="Author"/>
|
24
|
+
<date day="1" month="January" year="2000"/>
|
25
|
+
</front><middle>
|
26
|
+
<section anchor="_section_1" title="Section 1">
|
27
|
+
<t>text</t>
|
28
|
+
</section>
|
29
|
+
</middle><back>
|
30
|
+
<section anchor="_appendix" title="Appendix">
|
31
|
+
<t>text</t>
|
32
|
+
</section>
|
33
|
+
</back>
|
34
|
+
</rfc>
|
35
|
+
OUTPUT
|
36
|
+
end
|
37
|
+
|
38
|
+
it "renders appendix when section follows references" do
|
39
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
40
|
+
= Document title
|
41
|
+
:docName:
|
42
|
+
Author
|
43
|
+
|
44
|
+
== Section 1
|
45
|
+
text
|
46
|
+
|
47
|
+
[bibliography]
|
48
|
+
== Biblio
|
49
|
+
++++
|
50
|
+
<reference anchor='ref' target='https://www.iso.org/standard/67116.html'>
|
51
|
+
<front>
|
52
|
+
<title>ISO/IEC FDIS 10118-3 -- Information technology -- Security techniques -- Hash-functions -- Part 3: Dedicated hash-functions</title>
|
53
|
+
<author>
|
54
|
+
<organization>International Organization for Standardization</organization>
|
55
|
+
<address>
|
56
|
+
<postal>
|
57
|
+
<street>BIBC II</street>
|
58
|
+
<street>Chemin de Blandonnet 8</street>
|
59
|
+
<street>CP 401</street>
|
60
|
+
<city>Vernier</city>
|
61
|
+
<region>Geneva</region>
|
62
|
+
<code>1214</code>
|
63
|
+
<country>Switzerland</country>
|
64
|
+
</postal>
|
65
|
+
<phone>+41 22 749 01 11</phone>
|
66
|
+
<email>central@iso.org</email>
|
67
|
+
<uri>https://www.iso.org/</uri>
|
68
|
+
</address>
|
69
|
+
</author>
|
70
|
+
<date day='15' month='September' year='2017'/>
|
71
|
+
</front>
|
72
|
+
</reference>
|
73
|
+
++++
|
74
|
+
|
75
|
+
== Appendix
|
76
|
+
text
|
77
|
+
INPUT
|
78
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
79
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
80
|
+
|
81
|
+
<rfc
|
82
|
+
submissionType="IETF">
|
83
|
+
<front>
|
84
|
+
<title>Document title</title>
|
85
|
+
<author fullname="Author"/>
|
86
|
+
<date day="1" month="January" year="2000"/>
|
87
|
+
</front><middle>
|
88
|
+
<section anchor="_section_1" title="Section 1">
|
89
|
+
<t>text</t>
|
90
|
+
</section>
|
91
|
+
</middle><back>
|
92
|
+
<references title="Biblio">
|
93
|
+
<reference anchor="ref" target="https://www.iso.org/standard/67116.html">
|
94
|
+
<front>
|
95
|
+
<title>ISO/IEC FDIS 10118-3 -- Information technology -- Security techniques -- Hash-functions -- Part 3: Dedicated hash-functions</title>
|
96
|
+
<author>
|
97
|
+
<organization>International Organization for Standardization</organization>
|
98
|
+
<address>
|
99
|
+
<postal>
|
100
|
+
<street>BIBC II</street>
|
101
|
+
<street>Chemin de Blandonnet 8</street>
|
102
|
+
<street>CP 401</street>
|
103
|
+
<city>Vernier</city>
|
104
|
+
<region>Geneva</region>
|
105
|
+
<code>1214</code>
|
106
|
+
<country>Switzerland</country>
|
107
|
+
</postal>
|
108
|
+
<phone>+41 22 749 01 11</phone>
|
109
|
+
<email>central@iso.org</email>
|
110
|
+
<uri>https://www.iso.org/</uri>
|
111
|
+
</address>
|
112
|
+
</author>
|
113
|
+
<date day="15" month="September" year="2017"/>
|
114
|
+
</front>
|
115
|
+
</reference>
|
116
|
+
</references>
|
117
|
+
<section anchor="_appendix" title="Appendix">
|
118
|
+
<t>text</t>
|
119
|
+
</section>
|
120
|
+
</back>
|
121
|
+
</rfc>
|
122
|
+
OUTPUT
|
123
|
+
end
|
124
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
describe Asciidoctor::RFC::V2::Converter do
|
3
|
+
it "renders areas" do
|
4
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
5
|
+
= Document title
|
6
|
+
:docName:
|
7
|
+
Author
|
8
|
+
:area: first_area, second_area
|
9
|
+
|
10
|
+
== Section 1
|
11
|
+
text
|
12
|
+
INPUT
|
13
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
14
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
15
|
+
|
16
|
+
<rfc
|
17
|
+
submissionType="IETF">
|
18
|
+
<front>
|
19
|
+
<title>Document title</title>
|
20
|
+
<author fullname="Author"/>
|
21
|
+
<date day="1" month="January" year="2000"/>
|
22
|
+
<area>first_area</area><area>second_area</area>
|
23
|
+
</front><middle>
|
24
|
+
<section anchor="_section_1" title="Section 1">
|
25
|
+
<t>text</t>
|
26
|
+
</section>
|
27
|
+
</middle>
|
28
|
+
</rfc>
|
29
|
+
OUTPUT
|
30
|
+
end
|
31
|
+
|
32
|
+
it "deals with entities in areas" do
|
33
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
34
|
+
= Document title
|
35
|
+
:docName:
|
36
|
+
Author
|
37
|
+
:area: first_area & second_area
|
38
|
+
|
39
|
+
== Section 1
|
40
|
+
text
|
41
|
+
INPUT
|
42
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
43
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
44
|
+
|
45
|
+
<rfc
|
46
|
+
submissionType="IETF">
|
47
|
+
<front>
|
48
|
+
<title>Document title</title>
|
49
|
+
<author fullname="Author"/>
|
50
|
+
<date day="1" month="January" year="2000"/>
|
51
|
+
<area>first_area & second_area</area>
|
52
|
+
</front><middle>
|
53
|
+
<section anchor="_section_1" title="Section 1">
|
54
|
+
<t>text</t>
|
55
|
+
</section>
|
56
|
+
</middle>
|
57
|
+
</rfc>
|
58
|
+
OUTPUT
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,444 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
describe Asciidoctor::RFC::V2::Converter do
|
3
|
+
it "renders all options with short author syntax" do
|
4
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
5
|
+
= Document title
|
6
|
+
:docName:
|
7
|
+
John Doe Horton <john.doe@email.com>
|
8
|
+
|
9
|
+
== Section 1
|
10
|
+
text
|
11
|
+
INPUT
|
12
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
13
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
14
|
+
|
15
|
+
<?rfc strict="yes"?>
|
16
|
+
<?rfc toc="yes"?>
|
17
|
+
<?rfc tocdepth="4"?>
|
18
|
+
<?rfc symrefs="yes"?>
|
19
|
+
<?rfc sortrefs="yes"?>
|
20
|
+
<?rfc compact="yes"?>
|
21
|
+
<?rfc subcompact="no"?>
|
22
|
+
<rfc
|
23
|
+
submissionType="IETF">
|
24
|
+
<front>
|
25
|
+
<title>Document title</title>
|
26
|
+
<author fullname="John Doe Horton" surname="Horton">
|
27
|
+
<address>
|
28
|
+
<postal>
|
29
|
+
<street/>
|
30
|
+
</postal>
|
31
|
+
<email>john.doe@email.com</email>
|
32
|
+
</address>
|
33
|
+
</author>
|
34
|
+
<date day="1" month="January" year="2000"/>
|
35
|
+
</front><middle>
|
36
|
+
<section anchor="_section_1" title="Section 1">
|
37
|
+
<t>text</t>
|
38
|
+
</section>
|
39
|
+
</middle>
|
40
|
+
</rfc>
|
41
|
+
OUTPUT
|
42
|
+
end
|
43
|
+
|
44
|
+
it "renders all options with multiple short author syntax" do
|
45
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
46
|
+
= Document title
|
47
|
+
:docName:
|
48
|
+
John Doe Horton <john.doe@email.com>; Joanna Diva Munez <joanna.munez@email.com>
|
49
|
+
|
50
|
+
== Section 1
|
51
|
+
text
|
52
|
+
INPUT
|
53
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
54
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
55
|
+
|
56
|
+
<rfc
|
57
|
+
submissionType="IETF">
|
58
|
+
<front>
|
59
|
+
<title>Document title</title>
|
60
|
+
<author fullname="John Doe Horton" surname="Horton">
|
61
|
+
<address>
|
62
|
+
<postal>
|
63
|
+
<street/>
|
64
|
+
</postal>
|
65
|
+
<email>john.doe@email.com</email>
|
66
|
+
</address>
|
67
|
+
</author>
|
68
|
+
<author fullname="Joanna Diva Munez" surname="Munez">
|
69
|
+
<address>
|
70
|
+
<postal>
|
71
|
+
<street/>
|
72
|
+
</postal>
|
73
|
+
<email>joanna.munez@email.com</email>
|
74
|
+
</address>
|
75
|
+
</author>
|
76
|
+
<date day="1" month="January" year="2000"/>
|
77
|
+
</front><middle>
|
78
|
+
<section anchor="_section_1" title="Section 1">
|
79
|
+
<t>text</t>
|
80
|
+
</section>
|
81
|
+
</middle>
|
82
|
+
</rfc>
|
83
|
+
OUTPUT
|
84
|
+
end
|
85
|
+
|
86
|
+
it "renders all options with long author syntax" do
|
87
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
88
|
+
= Document title
|
89
|
+
:docName:
|
90
|
+
:fullname: John Doe Horton
|
91
|
+
:lastname: Horton
|
92
|
+
:forename_initials: J. D.
|
93
|
+
:role: editor
|
94
|
+
:organization: Ribose
|
95
|
+
:organization_abbrev: RBM
|
96
|
+
:fax: 555 5555
|
97
|
+
:email: john.doe@email.com
|
98
|
+
:uri: http://example.com
|
99
|
+
:phone: 555 5655
|
100
|
+
:street: 57 Mt Pleasant St
|
101
|
+
:city: Dullsville
|
102
|
+
:region: NSW
|
103
|
+
:country: Australia
|
104
|
+
:code: 3333
|
105
|
+
|
106
|
+
== Section 1
|
107
|
+
text
|
108
|
+
INPUT
|
109
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
110
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
111
|
+
|
112
|
+
<rfc
|
113
|
+
submissionType="IETF">
|
114
|
+
<front>
|
115
|
+
<title>Document title</title>
|
116
|
+
<author fullname="John Doe Horton" surname="Horton" initials="J. D." role="editor">
|
117
|
+
<organization abbrev="RBM">Ribose</organization>
|
118
|
+
<address>
|
119
|
+
<postal>
|
120
|
+
<street>57 Mt Pleasant St</street>
|
121
|
+
<city>Dullsville</city>
|
122
|
+
<region>NSW</region>
|
123
|
+
<code>3333</code>
|
124
|
+
<country>Australia</country>
|
125
|
+
</postal>
|
126
|
+
<phone>555 5655</phone>
|
127
|
+
<facsimile>555 5555</facsimile>
|
128
|
+
<email>john.doe@email.com</email>
|
129
|
+
<uri>http://example.com</uri>
|
130
|
+
</address>
|
131
|
+
</author>
|
132
|
+
<date day="1" month="January" year="2000"/>
|
133
|
+
</front><middle>
|
134
|
+
<section anchor="_section_1" title="Section 1">
|
135
|
+
<t>text</t>
|
136
|
+
</section>
|
137
|
+
</middle>
|
138
|
+
</rfc>
|
139
|
+
OUTPUT
|
140
|
+
end
|
141
|
+
|
142
|
+
it "deals with entities for all options under long author syntax" do
|
143
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
144
|
+
= Document title
|
145
|
+
:fullname: John <Doe> Horton
|
146
|
+
:lastname: Horton & Horton
|
147
|
+
:forename_initials: J. & D.
|
148
|
+
:organization: Ribose & co.
|
149
|
+
:organization_abbrev: RBM & co.
|
150
|
+
:fax: <555 5555>
|
151
|
+
:email: <john.doe@email.com>
|
152
|
+
:uri: http://example.com?x&y
|
153
|
+
:phone: 555 5655 & 999
|
154
|
+
:street: Cnr Mt Pleasant St & Dullsvile Cnr
|
155
|
+
:city: Dullsville & Pleasantville
|
156
|
+
:region: NSW & ACT
|
157
|
+
:country: Australia & New Zealand
|
158
|
+
:code: 3333 & 3334
|
159
|
+
|
160
|
+
== Section 1
|
161
|
+
text
|
162
|
+
INPUT
|
163
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
164
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
165
|
+
|
166
|
+
<rfc
|
167
|
+
submissionType="IETF">
|
168
|
+
<front>
|
169
|
+
<title>Document title</title>
|
170
|
+
<author fullname="John <Doe> Horton" surname="Horton & Horton" initials="J. & D.">
|
171
|
+
<organization abbrev="RBM & co.">Ribose & co.</organization>
|
172
|
+
<address>
|
173
|
+
<postal>
|
174
|
+
<street>Cnr Mt Pleasant St & Dullsvile Cnr</street>
|
175
|
+
<city>Dullsville & Pleasantville</city>
|
176
|
+
<region>NSW & ACT</region>
|
177
|
+
<code>3333 & 3334</code>
|
178
|
+
<country>Australia & New Zealand</country>
|
179
|
+
</postal>
|
180
|
+
<phone>555 5655 & 999</phone>
|
181
|
+
<facsimile><555 5555></facsimile>
|
182
|
+
<email><john.doe@email.com></email>
|
183
|
+
<uri>http://example.com?x&y</uri>
|
184
|
+
</address>
|
185
|
+
</author>
|
186
|
+
<date day="1" month="January" year="2000"/>
|
187
|
+
</front><middle>
|
188
|
+
<section anchor="_section_1" title="Section 1">
|
189
|
+
<t>text</t>
|
190
|
+
</section>
|
191
|
+
</middle>
|
192
|
+
</rfc>
|
193
|
+
OUTPUT
|
194
|
+
end
|
195
|
+
|
196
|
+
it "renders all options with multiple long author syntax" do
|
197
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
198
|
+
= Document title
|
199
|
+
:docName:
|
200
|
+
:fullname: John Doe Horton
|
201
|
+
:lastname: Horton
|
202
|
+
:forename_initials: J. D.
|
203
|
+
:role: editor
|
204
|
+
:organization: Ribose
|
205
|
+
:fax: 555 5555
|
206
|
+
:email: john.doe@email.com
|
207
|
+
:uri: http://example.com
|
208
|
+
:phone: 555 5655
|
209
|
+
:street: 57 Mt Pleasant St
|
210
|
+
:city: Dullsville
|
211
|
+
:region: NSW
|
212
|
+
:country: Australia
|
213
|
+
:code: 3333
|
214
|
+
:fullname_2: Billy Bob Thornton
|
215
|
+
:lastname_2: Thornton
|
216
|
+
:forename_initials_2: B. B.
|
217
|
+
:role_2: editor
|
218
|
+
:organization_2: International Business Machines
|
219
|
+
:organization_abbrev_2: IBM
|
220
|
+
:fax_2: 555 6666
|
221
|
+
:email_2: billy.thornton@email.com
|
222
|
+
:uri_2: http://ibm.com
|
223
|
+
:phone_2: 555 6655
|
224
|
+
:street_2: 67 Mt Pleasant St
|
225
|
+
:city_2: Dulltown
|
226
|
+
:region_2: VIC
|
227
|
+
:country_2: UK
|
228
|
+
:code_2: 44444
|
229
|
+
|
230
|
+
== Section 1
|
231
|
+
text
|
232
|
+
INPUT
|
233
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
234
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
235
|
+
|
236
|
+
<rfc
|
237
|
+
submissionType="IETF">
|
238
|
+
<front>
|
239
|
+
<title>Document title</title>
|
240
|
+
<author fullname="John Doe Horton" surname="Horton" initials="J. D." role="editor">
|
241
|
+
<organization>Ribose</organization>
|
242
|
+
<address>
|
243
|
+
<postal>
|
244
|
+
<street>57 Mt Pleasant St</street>
|
245
|
+
<city>Dullsville</city>
|
246
|
+
<region>NSW</region>
|
247
|
+
<code>3333</code>
|
248
|
+
<country>Australia</country>
|
249
|
+
</postal>
|
250
|
+
<phone>555 5655</phone>
|
251
|
+
<facsimile>555 5555</facsimile>
|
252
|
+
<email>john.doe@email.com</email>
|
253
|
+
<uri>http://example.com</uri>
|
254
|
+
</address>
|
255
|
+
</author>
|
256
|
+
<author fullname="Billy Bob Thornton" surname="Thornton" initials="B. B." role="editor">
|
257
|
+
<organization abbrev="IBM">International Business Machines</organization>
|
258
|
+
<address>
|
259
|
+
<postal>
|
260
|
+
<street>67 Mt Pleasant St</street>
|
261
|
+
<city>Dulltown</city>
|
262
|
+
<region>VIC</region>
|
263
|
+
<code>44444</code>
|
264
|
+
<country>UK</country>
|
265
|
+
</postal>
|
266
|
+
<phone>555 6655</phone>
|
267
|
+
<facsimile>555 6666</facsimile>
|
268
|
+
<email>billy.thornton@email.com</email>
|
269
|
+
<uri>http://ibm.com</uri>
|
270
|
+
</address>
|
271
|
+
</author>
|
272
|
+
<date day="1" month="January" year="2000"/>
|
273
|
+
</front><middle>
|
274
|
+
<section anchor="_section_1" title="Section 1">
|
275
|
+
<t>text</t>
|
276
|
+
</section>
|
277
|
+
</middle>
|
278
|
+
</rfc>
|
279
|
+
OUTPUT
|
280
|
+
end
|
281
|
+
|
282
|
+
it "respects multiple lines in street" do
|
283
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
284
|
+
= Document title
|
285
|
+
:docName:
|
286
|
+
:fullname: John Doe Horton
|
287
|
+
:lastname: Horton
|
288
|
+
:forename_initials: J. D.
|
289
|
+
:role: editor
|
290
|
+
:organization: Ribose
|
291
|
+
:fax: 555 5555
|
292
|
+
:email: john.doe@email.com
|
293
|
+
:uri: http://example.com
|
294
|
+
:phone: 555 5655
|
295
|
+
:street: 57 Mt Pleasant St\ Technology Park
|
296
|
+
:city: Dullsville
|
297
|
+
:region: NSW
|
298
|
+
:country: Australia
|
299
|
+
:code: 3333
|
300
|
+
|
301
|
+
== Section 1
|
302
|
+
text
|
303
|
+
INPUT
|
304
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
305
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
306
|
+
|
307
|
+
<rfc
|
308
|
+
submissionType="IETF">
|
309
|
+
<front>
|
310
|
+
<title>Document title</title>
|
311
|
+
<author fullname="John Doe Horton" surname="Horton" initials="J. D." role="editor">
|
312
|
+
<organization>Ribose</organization>
|
313
|
+
<address>
|
314
|
+
<postal>
|
315
|
+
<street>57 Mt Pleasant St</street>
|
316
|
+
<street>Technology Park</street>
|
317
|
+
<city>Dullsville</city>
|
318
|
+
<region>NSW</region>
|
319
|
+
<code>3333</code>
|
320
|
+
<country>Australia</country>
|
321
|
+
</postal>
|
322
|
+
<phone>555 5655</phone>
|
323
|
+
<facsimile>555 5555</facsimile>
|
324
|
+
<email>john.doe@email.com</email>
|
325
|
+
<uri>http://example.com</uri>
|
326
|
+
</address>
|
327
|
+
</author>
|
328
|
+
<date day="1" month="January" year="2000"/>
|
329
|
+
</front><middle>
|
330
|
+
<section anchor="_section_1" title="Section 1">
|
331
|
+
<t>text</t>
|
332
|
+
</section>
|
333
|
+
</middle>
|
334
|
+
</rfc>
|
335
|
+
OUTPUT
|
336
|
+
end
|
337
|
+
|
338
|
+
it "ignores initials attribute from Asciidoc" do
|
339
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
340
|
+
= Document title
|
341
|
+
:docName:
|
342
|
+
:fullname: John Doe Horton
|
343
|
+
:lastname: Horton
|
344
|
+
:initials: J. D. H.
|
345
|
+
:role: editor
|
346
|
+
:organization: Ribose
|
347
|
+
:fax: 555 5555
|
348
|
+
:email: john.doe@email.com
|
349
|
+
:uri: http://example.com
|
350
|
+
:phone: 555 5655
|
351
|
+
:street: 57 Mt Pleasant St
|
352
|
+
:city: Dullsville
|
353
|
+
:region: NSW
|
354
|
+
:country: Australia
|
355
|
+
:code: 3333
|
356
|
+
|
357
|
+
== Section 1
|
358
|
+
text
|
359
|
+
INPUT
|
360
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
361
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
362
|
+
|
363
|
+
<rfc
|
364
|
+
submissionType="IETF">
|
365
|
+
<front>
|
366
|
+
<title>Document title</title>
|
367
|
+
<author fullname="John Doe Horton" surname="Horton" role="editor">
|
368
|
+
<organization>Ribose</organization>
|
369
|
+
<address>
|
370
|
+
<postal>
|
371
|
+
<street>57 Mt Pleasant St</street>
|
372
|
+
<city>Dullsville</city>
|
373
|
+
<region>NSW</region>
|
374
|
+
<code>3333</code>
|
375
|
+
<country>Australia</country>
|
376
|
+
</postal>
|
377
|
+
<phone>555 5655</phone>
|
378
|
+
<facsimile>555 5555</facsimile>
|
379
|
+
<email>john.doe@email.com</email>
|
380
|
+
<uri>http://example.com</uri>
|
381
|
+
</address>
|
382
|
+
</author>
|
383
|
+
<date day="1" month="January" year="2000"/>
|
384
|
+
</front><middle>
|
385
|
+
<section anchor="_section_1" title="Section 1">
|
386
|
+
<t>text</t>
|
387
|
+
</section>
|
388
|
+
</middle>
|
389
|
+
</rfc>
|
390
|
+
OUTPUT
|
391
|
+
end
|
392
|
+
|
393
|
+
it "permits corporate authors" do
|
394
|
+
expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
|
395
|
+
= Document title
|
396
|
+
:docName:
|
397
|
+
:role: editor
|
398
|
+
:organization: Ribose
|
399
|
+
:fax: 555 5555
|
400
|
+
:email: john.doe@email.com
|
401
|
+
:uri: http://example.com
|
402
|
+
:phone: 555 5655
|
403
|
+
:street: 57 Mt Pleasant St
|
404
|
+
:city: Dullsville
|
405
|
+
:region: NSW
|
406
|
+
:country: Australia
|
407
|
+
:code: 3333
|
408
|
+
|
409
|
+
== Section 1
|
410
|
+
text
|
411
|
+
INPUT
|
412
|
+
<?xml version="1.0" encoding="US-ASCII"?>
|
413
|
+
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
|
414
|
+
|
415
|
+
<rfc
|
416
|
+
submissionType="IETF">
|
417
|
+
<front>
|
418
|
+
<title>Document title</title>
|
419
|
+
<author role="editor">
|
420
|
+
<organization>Ribose</organization>
|
421
|
+
<address>
|
422
|
+
<postal>
|
423
|
+
<street>57 Mt Pleasant St</street>
|
424
|
+
<city>Dullsville</city>
|
425
|
+
<region>NSW</region>
|
426
|
+
<code>3333</code>
|
427
|
+
<country>Australia</country>
|
428
|
+
</postal>
|
429
|
+
<phone>555 5655</phone>
|
430
|
+
<facsimile>555 5555</facsimile>
|
431
|
+
<email>john.doe@email.com</email>
|
432
|
+
<uri>http://example.com</uri>
|
433
|
+
</address>
|
434
|
+
</author>
|
435
|
+
<date day="1" month="January" year="2000"/>
|
436
|
+
</front><middle>
|
437
|
+
<section anchor="_section_1" title="Section 1">
|
438
|
+
<t>text</t>
|
439
|
+
</section>
|
440
|
+
</middle>
|
441
|
+
</rfc>
|
442
|
+
OUTPUT
|
443
|
+
end
|
444
|
+
end
|