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.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -0
  3. data/.oss-guides.rubocop.yml +1077 -0
  4. data/.rspec +1 -0
  5. data/.rubocop.yml +19 -1063
  6. data/.travis.yml +3 -2
  7. data/Guardfile +22 -0
  8. data/README.adoc +1151 -0
  9. data/Rakefile +1 -1
  10. data/asciidoctor-rfc.gemspec +20 -3
  11. data/bin/asciidoctor-rfc2 +15 -0
  12. data/bin/asciidoctor-rfc3 +15 -0
  13. data/bin/rspec +0 -1
  14. data/lib/asciidoctor-rfc.rb +4 -0
  15. data/lib/asciidoctor/rfc/common/base.rb +218 -0
  16. data/lib/asciidoctor/rfc/common/front.rb +120 -0
  17. data/lib/asciidoctor/rfc/v2/base.rb +341 -0
  18. data/lib/asciidoctor/rfc/v2/blocks.rb +192 -0
  19. data/lib/asciidoctor/rfc/v2/converter.rb +64 -0
  20. data/lib/asciidoctor/rfc/v2/front.rb +69 -0
  21. data/lib/asciidoctor/rfc/v2/inline_anchor.rb +102 -0
  22. data/lib/asciidoctor/rfc/v2/lists.rb +134 -0
  23. data/lib/asciidoctor/rfc/v2/table.rb +112 -0
  24. data/lib/asciidoctor/rfc/v2/validate.rb +738 -0
  25. data/lib/asciidoctor/rfc/v2/validate2.rng +716 -0
  26. data/lib/asciidoctor/rfc/v3/base.rb +358 -0
  27. data/lib/asciidoctor/rfc/v3/blocks.rb +203 -0
  28. data/lib/asciidoctor/rfc/v3/converter.rb +64 -0
  29. data/lib/asciidoctor/rfc/v3/front.rb +115 -0
  30. data/lib/asciidoctor/rfc/v3/inline_anchor.rb +90 -0
  31. data/lib/asciidoctor/rfc/v3/lists.rb +190 -0
  32. data/lib/asciidoctor/rfc/v3/svg.rng +9081 -0
  33. data/lib/asciidoctor/rfc/v3/table.rb +65 -0
  34. data/lib/asciidoctor/rfc/v3/validate.rb +2168 -0
  35. data/lib/asciidoctor/rfc/v3/validate.rng +2143 -0
  36. data/lib/asciidoctor/rfc/version.rb +2 -2
  37. data/spec/asciidoctor/rfc/v2/appendix_spec.rb +124 -0
  38. data/spec/asciidoctor/rfc/v2/area_spec.rb +60 -0
  39. data/spec/asciidoctor/rfc/v2/author_spec.rb +444 -0
  40. data/spec/asciidoctor/rfc/v2/comments_spec.rb +316 -0
  41. data/spec/asciidoctor/rfc/v2/crossref_spec.rb +205 -0
  42. data/spec/asciidoctor/rfc/v2/date_spec.rb +166 -0
  43. data/spec/asciidoctor/rfc/v2/dlist_spec.rb +108 -0
  44. data/spec/asciidoctor/rfc/v2/document_spec.rb +161 -0
  45. data/spec/asciidoctor/rfc/v2/example_spec.rb +50 -0
  46. data/spec/asciidoctor/rfc/v2/front_spec.rb +75 -0
  47. data/spec/asciidoctor/rfc/v2/image_spec.rb +81 -0
  48. data/spec/asciidoctor/rfc/v2/indexterm_spec.rb +66 -0
  49. data/spec/asciidoctor/rfc/v2/inline_formatting_spec.rb +177 -0
  50. data/spec/asciidoctor/rfc/v2/keyword_spec.rb +63 -0
  51. data/spec/asciidoctor/rfc/v2/listing_spec.rb +59 -0
  52. data/spec/asciidoctor/rfc/v2/literal_spec.rb +53 -0
  53. data/spec/asciidoctor/rfc/v2/olist_spec.rb +147 -0
  54. data/spec/asciidoctor/rfc/v2/paragraph_spec.rb +68 -0
  55. data/spec/asciidoctor/rfc/v2/preamble_spec.rb +140 -0
  56. data/spec/asciidoctor/rfc/v2/quote_spec.rb +24 -0
  57. data/spec/asciidoctor/rfc/v2/references_spec.rb +96 -0
  58. data/spec/asciidoctor/rfc/v2/section_spec.rb +260 -0
  59. data/spec/asciidoctor/rfc/v2/sidebar_spec.rb +32 -0
  60. data/spec/asciidoctor/rfc/v2/table_spec.rb +293 -0
  61. data/spec/asciidoctor/rfc/v2/ulist_spec.rb +96 -0
  62. data/spec/asciidoctor/rfc/v2/workgroup_spec.rb +60 -0
  63. data/spec/asciidoctor/rfc/v3/appendix_spec.rb +130 -0
  64. data/spec/asciidoctor/rfc/v3/area_spec.rb +63 -0
  65. data/spec/asciidoctor/rfc/v3/author_spec.rb +540 -0
  66. data/spec/asciidoctor/rfc/v3/comments_spec.rb +308 -0
  67. data/spec/asciidoctor/rfc/v3/crossref_spec.rb +269 -0
  68. data/spec/asciidoctor/rfc/v3/date_spec.rb +149 -0
  69. data/spec/asciidoctor/rfc/v3/dlist_spec.rb +121 -0
  70. data/spec/asciidoctor/rfc/v3/document_spec.rb +109 -0
  71. data/spec/asciidoctor/rfc/v3/example_spec.rb +34 -0
  72. data/spec/asciidoctor/rfc/v3/front_spec.rb +43 -0
  73. data/spec/asciidoctor/rfc/v3/image_spec.rb +81 -0
  74. data/spec/asciidoctor/rfc/v3/indexterm_spec.rb +69 -0
  75. data/spec/asciidoctor/rfc/v3/inline_formatting_spec.rb +319 -0
  76. data/spec/asciidoctor/rfc/v3/keyword_spec.rb +33 -0
  77. data/spec/asciidoctor/rfc/v3/link_spec.rb +34 -0
  78. data/spec/asciidoctor/rfc/v3/listing_spec.rb +59 -0
  79. data/spec/asciidoctor/rfc/v3/literal_spec.rb +51 -0
  80. data/spec/asciidoctor/rfc/v3/olist_spec.rb +168 -0
  81. data/spec/asciidoctor/rfc/v3/paragraph_spec.rb +73 -0
  82. data/spec/asciidoctor/rfc/v3/preamble_spec.rb +112 -0
  83. data/spec/asciidoctor/rfc/v3/quote_spec.rb +91 -0
  84. data/spec/asciidoctor/rfc/v3/references_spec.rb +147 -0
  85. data/spec/asciidoctor/rfc/v3/section_spec.rb +198 -0
  86. data/spec/asciidoctor/rfc/v3/series_info_spec.rb +151 -0
  87. data/spec/asciidoctor/rfc/v3/sidebar_spec.rb +30 -0
  88. data/spec/asciidoctor/rfc/v3/table_spec.rb +275 -0
  89. data/spec/asciidoctor/rfc/v3/ulist_spec.rb +74 -0
  90. data/spec/asciidoctor/rfc/v3/workgroup_spec.rb +33 -0
  91. data/spec/examples/davies-template-bare-06.adoc +361 -0
  92. data/spec/examples/davies-template-bare-06.xml.orig +426 -0
  93. data/spec/examples/example-v2.adoc +181 -0
  94. data/spec/examples/example-v2.xml +675 -0
  95. data/spec/examples/example-v3.adoc +185 -0
  96. data/spec/examples/example-v3.xml +1009 -0
  97. data/spec/examples/mib-doc-template-xml-06.adoc +596 -0
  98. data/spec/examples/mib-doc-template-xml-06.xml.orig +654 -0
  99. data/spec/examples/rfc1149.md +76 -0
  100. data/spec/examples/rfc1149.md.2.xml +94 -0
  101. data/spec/examples/rfc1149.md.3.xml +93 -0
  102. data/spec/examples/rfc1149.md.adoc +65 -0
  103. data/spec/examples/rfc2100.md +149 -0
  104. data/spec/examples/rfc2100.md.2.xml +169 -0
  105. data/spec/examples/rfc2100.md.3.xml +163 -0
  106. data/spec/examples/rfc2100.md.adoc +136 -0
  107. data/spec/examples/rfc3514.md +203 -0
  108. data/spec/examples/rfc3514.md.2.xml +238 -0
  109. data/spec/examples/rfc3514.md.3.xml +258 -0
  110. data/spec/examples/rfc3514.md.adoc +324 -0
  111. data/spec/examples/rfc5841.md +342 -0
  112. data/spec/examples/rfc5841.md.2.xml +393 -0
  113. data/spec/examples/rfc5841.md.3.xml +449 -0
  114. data/spec/examples/rfc5841.md.adoc +414 -0
  115. data/spec/examples/rfc6350.adoc +3499 -0
  116. data/spec/examples/rfc6350.bib +763 -0
  117. data/spec/examples/rfc748.md +79 -0
  118. data/spec/examples/rfc748.md.2.xml +116 -0
  119. data/spec/examples/rfc748.md.3.xml +109 -0
  120. data/spec/examples/rfc748.md.adoc +80 -0
  121. data/spec/examples/rfc7511.md +257 -0
  122. data/spec/examples/rfc7511.md.2.xml +300 -0
  123. data/spec/examples/rfc7511.md.3.xml +347 -0
  124. data/spec/examples/rfc7511.md.adoc +417 -0
  125. data/spec/spec_helper.rb +115 -5
  126. metadata +274 -9
  127. data/.hound.yml +0 -3
  128. data/README.md +0 -84
  129. data/lib/asciidoctor/rfc.rb +0 -7
  130. data/spec/asciidoctor-rfc/.keep +0 -0
data/.travis.yml CHANGED
@@ -1,5 +1,6 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.4.1
5
- before_install: gem install bundler -v 1.15.1
4
+ - 2.3
5
+ script:
6
+ - bundle exec rspec
data/Guardfile ADDED
@@ -0,0 +1,22 @@
1
+ directories(%w(. lib spec)).
2
+ select { |d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist") }
3
+
4
+ guard :rspec, cmd: "bundle exec rspec" do
5
+ require "guard/rspec/dsl"
6
+ dsl = Guard::RSpec::Dsl.new(self)
7
+
8
+ # Feel free to open issues for suggestions and improvements
9
+
10
+ # RSpec files
11
+ rspec = dsl.rspec
12
+ watch(rspec.spec_helper) { rspec.spec_dir }
13
+ watch(rspec.spec_support) { rspec.spec_dir }
14
+ watch(rspec.spec_files)
15
+
16
+ # Ruby files
17
+ ruby = dsl.ruby
18
+ dsl.watch_spec_files_for(ruby.lib_files)
19
+
20
+ # Run all specs if any lib file changes.
21
+ watch(ruby.lib_files) { rspec.spec_dir }
22
+ end
data/README.adoc ADDED
@@ -0,0 +1,1151 @@
1
+ = Writing Internet-Drafts and RFCs in AsciiDoc
2
+ :source-highlighter: coderay
3
+ :icons: font
4
+
5
+ asciidoctor-rfc lets you write Internet-Drafts and RFCs in AsciiDoc, the
6
+ "`http://asciidoctor.org/[asciidoctor]-way`".
7
+
8
+ image:https://img.shields.io/gem/v/asciidoctor-rfc.svg["Gem Version", link="https://rubygems.org/gems/asciidoctor-rfc"]
9
+ image:https://img.shields.io/travis/riboseinc/asciidoctor-rfc/master.svg["Build Status", link="https://travis-ci.org/riboseinc/asciidoctor-rfc"]
10
+ image:https://codeclimate.com/github/riboseinc/asciidoctor-rfc/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/riboseinc/asciidoctor-rfc"]
11
+
12
+
13
+ == Introduction
14
+
15
+ The "`xml2rfc`" Vocabulary (hereinafter "`RFC XML`") is an XML-based language
16
+ used for writing
17
+ https://www.ietf.org/id-info/guidelines.html[Internet-Drafts]
18
+ and https://tools.ietf.org/html/rfc7322[RFCs (RFC7322)].
19
+
20
+ This gem allows you to author these types of documents in AsciiDoc, and outputs
21
+ RFC XML output in both v3 and v2 formats:
22
+
23
+ * v3 RFC XML (https://tools.ietf.org/html/rfc7991[RFC 7991])
24
+ * v2 RFC XML (https://tools.ietf.org/html/rfc7749[RFC 7749])
25
+
26
+ Its syntax is designed to be "`native-asciidoctor`":
27
+
28
+
29
+ == Installation
30
+
31
+ Add this line to your application's Gemfile:
32
+
33
+ [source,ruby]
34
+ ----
35
+ gem "asciidoctor-rfc"
36
+ ----
37
+
38
+ And then execute:
39
+
40
+ [source,console]
41
+ ----
42
+ $ bundle
43
+ ----
44
+
45
+ Or install it yourself as:
46
+
47
+ [source,console]
48
+ ----
49
+ $ gem install asciidoctor-rfc
50
+ ----
51
+
52
+
53
+ == Quick Start
54
+
55
+ Illustrating with v2 RFC XML, and Internet Draft rather than RFC
56
+
57
+ [source,asciidoc]
58
+ ----
59
+ = A Standard for the Transmission of IP Datagrams on Avian Carriers
60
+ David Waitzman <dwaitzman@BBN.COM>
61
+ :doctype: internet-draft
62
+ :abbrev: IP Datagrams on Avian Carriers
63
+ :obsoletes: 10, 120
64
+ :updates: 2010, 2120
65
+ :status: info
66
+ :name: internet-draft-avian-transmission-00
67
+ :ipr: trust200902
68
+ :area: Internet
69
+ :workgroup: Network Working Group
70
+ :keyword: avians, datagrams
71
+ :revdate: 1990-04-01T00:00:00Z
72
+ :organization: BBN STC
73
+ :phone: (617) 873-4323
74
+ :uri: http://bbn.com
75
+ :street: 10 Moulton Street
76
+ :city: Cambridge
77
+ :code: MA 02238
78
+
79
+ [abstract]
80
+ Avian carriers can provide high delay, low throughput, and low
81
+ altitude service. The connection topology is limited to a single
82
+ point-to-point path for each carrier, used with standard carriers,
83
+ but many carriers can be used without significant interference with
84
+ each other, outside of early spring. This is because of the 3D ether
85
+ space available to the carriers, in contrast to the 1D ether used by
86
+ IEEE802.3. The carriers have an intrinsic collision avoidance
87
+ system, which increases availability. Unlike some network
88
+ technologies, such as packet radio, communication is not limited to
89
+ line-of-sight distance. Connection oriented service is available in
90
+ some cities, usually based upon a central hub topology.
91
+
92
+ NOTE: Yes, this is an April Fool's RFC.
93
+
94
+ [[frame]]
95
+ == Frame Format
96
+
97
+ The IP _datagram_ is *printed*, on a small scroll of paper, in
98
+ hexadecimal, with each octet separated by whitestuff and blackstuff.
99
+ The scroll of paper is wrapped around one leg of the avian carrier.
100
+ A band of duct tape is used to secure the datagram's edges. The
101
+ bandwidth is limited to the leg length. The MTU is variable, and
102
+ paradoxically, generally increases with increased carrier age. A
103
+ typical MTU is 256 milligrams. Some datagram padding may be needed.<<RFC7253>>
104
+
105
+ [bibliography]
106
+ == References
107
+ ++++
108
+ <reference anchor='RFC7253' target='https://tools.ietf.org/html/rfc7253'>
109
+ <front>
110
+ <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
111
+ <author initials="T." surname="Krovetz">
112
+ <organization>Sacramento State</organization>
113
+ </author>
114
+ <author initials="P." surname="Rogaway">
115
+ <organization>UC Davis</organization>
116
+ </author>
117
+ <date month='May' year='2014'/>
118
+ </front>
119
+ <seriesInfo name="RFC" value="7253"/>
120
+ </reference>
121
+ ++++
122
+ ----
123
+
124
+ == Usage
125
+
126
+ Converting your AsciiDoc to RFC XML is a simple as running the appropriate
127
+ `./bin/asciidoctor-rfc` script using Ruby, and passing our
128
+ AsciiDoc document file as the first argument.
129
+
130
+ [source,console]
131
+ ----
132
+ $ ruby ./bin/asciidoctor-rfc3 draft-example-00.adoc # RFC XML v3 output
133
+ $ ruby ./bin/asciidoctor-rfc2 draft-example-00.adoc # RFC XML v2 output
134
+ ## WIP: bundle exec asciidoctor -b asciidoctor-rfc3 draft-example-00.adoc # RFC XML v3 output
135
+ ## WIP: bundle exec asciidoctor -b asciidoctor-rfc2 draft-example-00.adoc # RFC XML v2 output
136
+ ----
137
+
138
+ You can also use the asciidoctor executable, specifying this gem as a library:
139
+
140
+ [source,console]
141
+ ----
142
+ $ asciidoctor -b rfc3 -r 'asciidoctor/rfc' a.adoc # RFC XML v3 output
143
+ $ asciidoctor -b rfc2 -r 'asciidoctor/rfc' a.adoc # RFC XML v2 output
144
+ ----
145
+
146
+ When the script completes, you should see the RFC XML file `draft-example-00.xml` in the
147
+ same directory.
148
+
149
+
150
+ == Syntax
151
+
152
+ The converter follows native AsciiDoc/asciidoctor syntax as much as possible,
153
+ including built-in attributes and styles.
154
+
155
+ Extension commands are provided to fully support writing an Internet-Draft/RFC
156
+ in AsciiDoc/asciidoctor syntax.
157
+
158
+ [NOTE]
159
+ ====
160
+ The document model of Asciidoctor and RFC XML are different. In particular,
161
+
162
+ * Asciidoctor and RFC XML differ in where they allow anchors to be placed:
163
+ Asciidoctor does not allow anchors within tables and lists, and RFC XML v3 does
164
+ not permit anchors for the `note` or `abstract` elements, while RFC XML v2
165
+ uses anchors for much fewer block elements (e.g. `artwork`, `list`.)
166
+ * Asciidoctor has a more restrctive block model: it regards elements such as
167
+ admonitions, lists, and tables as blocks, and does not allow them to be nested
168
+ within paragraphs.
169
+
170
+ As a result, it may be necessary to postedit the RFC XML output, if the block
171
+ model produced does not reflect the intended structure accurately.
172
+ ====
173
+
174
+ NOTE: The gem validates all RFC XML generated through the RELAXNG schema definitions
175
+ of RFC XML. While the gem attempts to generate valid RFC XML, some Asciidoctor
176
+ text may not align with the RFC XML document model, and any highlighted syntax
177
+ errors will also need to be rectified in postediting, before processing the
178
+ generated XML further.
179
+
180
+
181
+ === Document Type: `rfc` or `internet-draft` (Mandatory)
182
+
183
+ Set the `doctype` attribute to set status of this document:
184
+
185
+ `:doctype: internet-draft` sets the document as an Internet-Draft (default value):
186
+
187
+ * `rfc/front/seriesInfo@name` attribute will be set to `Internet-Draft` (in v3)
188
+ * `rfc/front/seriesInfo@value` will be set to the `:name:` attribute, stripping any file suffixes, but including any draft number; e.g. `draft-ietf-somewg-someprotocol-07` (in v3)
189
+ * `rfc@docName` will be set to the `:name:` attribute (in v2)
190
+
191
+ `:doctype: rfc` sets the document as an RFC:
192
+
193
+ * `rfc/front/seriesInfo@name` attribute will be set to `RFC` (in v3)
194
+ * `rfc/front/seriesInfo@value` will be set to the `:name:` attribute, stripping the initial `rfc-` prefix and any file suffixes (in v3)
195
+ * `rfc@number` will be set to the `:name:` attribute (in v2)
196
+
197
+
198
+ === Gem Options
199
+
200
+ [cols="2", options="header"]
201
+ |===
202
+
203
+ | Attribute
204
+ | Purpose
205
+
206
+ |`:no-rfc-bold-bcp14:`
207
+ | Optional. Default value `true`. Allowed values: `true`, `false`.
208
+ Override default assumption that boldface uppercase BCP14 word is to be rendered with `bcp14` tag.
209
+
210
+ |`:smart-quotes:`
211
+ |Optional. Default value `true`. Allowed values: `true`, `false`.
212
+ Permit smart quotes, when they are specified explicitly in Asciidoc (as `"`...`"`, `'`...`'`.)
213
+ When disabled, smart quotes are rendered as straight quotes, and Asciidoc's default conversion
214
+ of straight apostrophes to smart is undone.
215
+
216
+ |===
217
+
218
+
219
+ === Basic Document Attributes
220
+
221
+ `asciidoctor-rfc` allows setting the RFC XML document header using the following
222
+ document attributes. Complying with AsciiDoc syntax, no blank lines are
223
+ permitted between the title, listing of authors, and the document attributes.
224
+ Also following AsciiDoc syntax, character entities will be ignored in the document
225
+ header: `&nbsp;` in the header for example will be rendered as `&amp;nbsp;`.
226
+
227
+ Shared RFC XML v3/v2 syntax:
228
+
229
+ [cols="3", options="header"]
230
+ |===
231
+
232
+ | Attribute
233
+ | Purpose
234
+ | RFC XML v2/v3 element
235
+
236
+ | `= Document Title`
237
+ | Mandatory. Title of document.
238
+ | `rfc/front/title`
239
+
240
+ | `:abbrev:`
241
+ | Mandatory. Abbreviation of document title. Usually the document name without
242
+ the keyword `draft-`.
243
+ | `rfc/front/title@abbrev`
244
+
245
+ | `:ipr:`
246
+ | Mandatory. IP status of document. See
247
+ https://tools.ietf.org/html/rfc7991#section-2.45.5[here]. Defaults to
248
+ `trust200902`.
249
+ | `rfc@ipr`
250
+
251
+ | `:ipr-extract:`
252
+ | Optional. Identifies a section that can be extracted from text. See
253
+ https://tools.ietf.org/html/rfc7991#section-2.45.6[here].
254
+ | `rfc@iprExtract`
255
+
256
+ | `:obsoletes:`
257
+ | Optional. A comma-separated list of RFC numbers or Internet-Draft names that
258
+ this document obsoletes. Delimited by `comma + space`.
259
+ | `rfc@obsoletes`
260
+
261
+ | `:updates:`
262
+ | Optional. A comma-separated list of RFC numbers or Internet-Draft names that
263
+ this document updates. Delimited by `comma + space`.
264
+ | `rfc@updates`
265
+
266
+ | `:submission-type:`
267
+ | Optional. Document stream of document described in
268
+ https://tools.ietf.org/html/rfc7841[RFC7841]. Allowed values: `IETF` (default),
269
+ `independent`, `IAB`, and `IRTF`.
270
+ | `rfc@submissionType`
271
+
272
+ | `:revdate:`
273
+ | Optional. Latest revision date of document. Default value is current time.
274
+ Accepts ISO 8601 date. Also accepts YYYY year, and YYYY[-]MM year/month.
275
+ For consistency with AsciiDoc, `:revdate:` is given as
276
+ an ISO 8601 date; the converter breaks it down into day, month name and year
277
+ | `front/date@day`, `front/date@month`, `front/date@year`
278
+
279
+ | `:area:`
280
+ | Optional. Comma delimited text on which IETF area this document relates to. Value should
281
+ "be either the full name or the abbreviation of one of the IETF areas as
282
+ listed on <http://www.ietf.org/iesg/area.html>". See
283
+ https://tools.ietf.org/html/rfc7991#section-2.4[here].
284
+ | `front/area`
285
+
286
+ | `:workgroup:`
287
+ | Optional. Comma delimited text on which IETF workgroup or research group this
288
+ document originates from. See https://tools.ietf.org/html/rfc7991#section-2.65[here].
289
+ | `front/workgroup`
290
+
291
+ | `:keyword:`
292
+ | Optional. Comma delimited text for singular keywords used for RFC index and
293
+ metadata.
294
+ | `front/keyword`
295
+
296
+ |===
297
+
298
+
299
+ === Document Name / Number (Mandatory)
300
+
301
+ The `name` attribute sets the document's name. This should be a number if
302
+ the document is an RFC, and a name (in the form of `draft-ietf-somewg-someprotocol-07`)
303
+ if it is an Internet-Draft.
304
+
305
+ When `doctype` is set to:
306
+
307
+ * `internet-draft`: the value should be in the form `draft-ietf-somewg-someprotocol-07`.
308
+ ** v3: the `front/seriesInfo@value` will be set to this value.
309
+ ** v2: the `rfc@docName` will be set to this value.
310
+
311
+ * `rfc`: the value should be a number like `7991` as described
312
+ https://tools.ietf.org/html/rfc7991#section-2.47.6[here]
313
+ ** v3: the `front/seriesInfo@value` will be set to this value.
314
+ ** v2: the `rfc@number` will be set to this value.
315
+
316
+
317
+ === Document Status
318
+
319
+ Set the `status` attribute to set the current status of this document.
320
+
321
+ * In v3, this sets the first `front/seriesInfo` element with `@status` as one
322
+ of: `standard`, `informational`, `experimental`, `bcp`, `fyi`, `full-standard`.
323
+ * In v2, this sets the `rfc@category` value as one of `std`, `info`, `exp`, `bcp`, `historic`.
324
+
325
+
326
+ === Intended Series
327
+
328
+ Set the `intended-series` attribute to set the intended series of this
329
+ document.
330
+
331
+ The following values are allowed: `standard`, `informational`, `experimental`, `bcp`, `fyi`, `full-standard`.
332
+
333
+ When `doctype` is set to:
334
+
335
+ * `internet-draft`: this value can be one of `standard`, `full-standard`, `bcp`, `fyi`, `informational`,
336
+ `experimental`, or `historic` to indicate the intended series once the document is published as an RFC.
337
+
338
+ ** In v3, this sets a second `front/seriesInfo` element with `@status` as one of those values, and an empty `@name`, to indicate this.
339
+ ** In v2, this sets the `front@category` value to one of `std`, `bcp`, `info`, `exp`, `historic`.
340
+
341
+ * `rfc`: this value can be either:
342
+ ** one of `full-standard`, `bcp` or `fyi`, to indicate the current status of this document, followed by the number of the document within the series; e.g. `full-standard 1234`, `bcp 14`.
343
+ ** `exp`, `info`, or `historic`. (`experimental` and `informational` will be accepted by the gem as synonyms.)
344
+
345
+ ** In v3, this sets a second `front/seriesInfo` element with `@status` as one of those values, and an empty `@name`, to indicate this.
346
+ ** In v2, this sets the `front@category` value to one of `std`, `bcp`, `info`. (While in https://tools.ietf.org/html/rfc7749#appendix-A.1[v2], the values `exp`, `historic` are also possible for a RFC, our gem does not support it.)
347
+
348
+ === Document Submission Type / Stream
349
+
350
+ Set document submission type via the `submission-type` document attribute.
351
+
352
+ The following values are allowed: `IETF` (default), `independent`, `IAB`, and `IRTF`.
353
+
354
+ * In v3, the `rfc@submissionType` and `rfc/front/seriesInfo@stream` attributes are set to this value.
355
+ * In v2, the `rfc@submissionType` is set to this value
356
+
357
+ === Document Consensus
358
+
359
+ Set document consensus type via the `consensus` document attribute.
360
+
361
+ These values are accepted: `false`, `true`.
362
+
363
+ * In v3, this is the value set for the `rfc@consensus` attribute.
364
+ * In v2, this is the value set for the `rfc@consensus` attribute, but `false` is converted to `no` and `true` is converted to `yes`.
365
+
366
+ === Document Language
367
+
368
+ Set the document language using the `xml-lang` document attribute.
369
+
370
+ By default this is `en`.
371
+
372
+ * In v3 and v2, this is the value set for the `rfc@xml:lang` attribute.
373
+
374
+ While v3 supports marking specific elements with their own `xml:lang` attribute, this is not yet supported by our gem.
375
+
376
+
377
+ === Document Attributes for v2 only
378
+
379
+ These attributes are only supported for the v2 converter.
380
+
381
+ [cols="3", options="header"]
382
+ |===
383
+
384
+ | Attribute
385
+ | Purpose
386
+ | RFC XML v3 element
387
+
388
+ |`:series-no:`
389
+ | Optional. The document series is defined by the "category" attribute;
390
+ "seriesNo" is only applicable to the values "info" ("FYI" series),
391
+ "std" ("STD" series), and "bcp" ("BCP" series).
392
+ | `rfc@seriesNo`
393
+ |===
394
+
395
+ === Document Attributes for v3 only
396
+
397
+ These attributes are only supported for the v3 converter.
398
+
399
+ [cols="3", options="header"]
400
+ |===
401
+
402
+ | Attribute
403
+ | Purpose
404
+ | RFC XML v3 element
405
+
406
+ |`:index-include:`
407
+ | Optional. Defaults to `true`. Values: `true` or `false`. Specifies whether
408
+ formatter should include an index in generated files. If the source file has no
409
+ `<iref>` elements, an index is never generated.
410
+ | `rfc@indexInclude`
411
+
412
+ |`:sort-refs:`
413
+ | Optional. Defaults to `false`. Values: `true` or `false`. Specifies whether
414
+ the prep tool should sort references.
415
+ | `rfc@sortRefs`
416
+
417
+ |`:sym-refs:`
418
+ | Optional. Defaults to `true`. Values: `true` or `false`. Specifies whether
419
+ formatter should use symbolic references (such as "`[RFC2119]`") or not
420
+ (such as "`[3]`").
421
+ | `rfc@symRefs`
422
+
423
+ |`:toc-include:`
424
+ | Optional. Defaults to `true`. Values: `true` or `false`. Specifies whether
425
+ formatter should contain a table of contents.
426
+ | `rfc@tocInclude`
427
+
428
+ | `:link{_i_}: _URL_` or `:link{_i_}: _URL_ _REL_`
429
+ a| Optional. A link to an external document related to this document.
430
+
431
+ There are 4 types of values:
432
+
433
+ . (RFC only) ISSN for this RFC document (`rel` set to `item`, `link` value in
434
+ form of `urn:issn:`);
435
+ . (RFC only) DOI for this RFC document (`rel` set to `describedBy`, `link`
436
+ value in form specified by https://tools.ietf.org/html/rfc7669[RFC7669]);
437
+ . (Final Draft) Internet-Draft submitted to become published RFC (`rel` set to
438
+ `convertedFrom`, `link` value set to "IETF-controlled web site that retains
439
+ copies of Internet-Drafts");
440
+ . (Any status) ISSN (`rel` set to `alternate`, `link` value as any author run web site).
441
+ | `front/link@href = _URL_`, `front/link@rel = _REL_` (if supplied)
442
+
443
+ |===
444
+
445
+
446
+ === Author Attributes
447
+
448
+ In an Internet-Draft/RFC, detailed information of an author is necessary, which
449
+ is not supported by the normal AsciiDoc syntax.
450
+
451
+ You will need to provide the following information.
452
+
453
+
454
+ ==== Multiple Author Names
455
+
456
+ Just like a normal AsciiDoc, you can provide author information in the author
457
+ header (sample of 3 authors):
458
+
459
+ [source,asciidoc]
460
+ ----
461
+ firstname middlename(s) lastname <email>; firstname middlename(s) lastname <email>; firstname middlename(s) lastname <email>
462
+ ----
463
+
464
+ These will be mapped as follows:
465
+
466
+ [cols="3", options="header"]
467
+ |===
468
+
469
+ | Syntax
470
+ | Purpose
471
+ | RFC XML v3/v2 element
472
+
473
+ | `firstname middlename(s) lastname`
474
+ | Mandatory (at least one). Author's full name. (Middle names are optional.)
475
+ | `front/author@fullname`
476
+
477
+ | `lastname`
478
+ | Author's last name.
479
+ | `front/author@surname`
480
+
481
+ | `email`
482
+ | Author's email address.
483
+ | `front/author/address/email`
484
+
485
+ |===
486
+
487
+
488
+ ==== Author Attributes
489
+
490
+ In `asciidoctor-rfc`, detailed author attributes are given as document
491
+ attributes.
492
+
493
+ As multiple authors can be specified, the document attribute to specify the
494
+ first author uses a unsuffixed attribute name `:role`, and the second author's
495
+ attributes onwards use a numeric suffix to identify the author: `:role_2`, `:role_3`, etc.
496
+
497
+ Shared RFC XML v3/v2 syntax:
498
+
499
+ [cols="3", options="header"]
500
+ |===
501
+
502
+ | Attribute
503
+ | Purpose
504
+ | RFC XML v3/v2 element
505
+
506
+ | `:fullname{_i}:`
507
+ | Optional. Author's full name. Can set here instead of document header's "`Author`" line.
508
+ | `front/author@fullname`
509
+
510
+ | `:forename_initials{_i}:`
511
+ | Optional. Author's initials excluding surname. Defaults to dynamically
512
+ calculated initials. Distinct from the AsciiDoc `:initials:` attribute, which
513
+ includes surname.
514
+ | `front/author@initials`
515
+
516
+ | `:lastname{_i}:`
517
+ | Optional. Author's last name. Can set here instead of document header's "`Author`" line.
518
+ | `front/author@surname`
519
+
520
+ | `:role{_i}:`
521
+ | Optional. Defaults to `author`. Possible values: `author`, `editor`. If `author` is supplied,
522
+ the attribute is not populated.
523
+ | `front/author@role`
524
+
525
+ | `:organization{_i}:`
526
+ | Optional. Defaults to `""`. Author's organization affiliation.
527
+ | `front/author/organization`
528
+
529
+ | `:organization_abbrev{_i}:`
530
+ | Optional. Defaults to `""`. Author's organization's abbreviation shown .
531
+ | `front/author/organization@abbrev`
532
+
533
+ |===
534
+
535
+ NOTE: You can provide organization information without providing name information
536
+ for an author.
537
+
538
+ ===== Author Address
539
+
540
+ [cols="3", options="header"]
541
+ |===
542
+ | Attribute
543
+ | Purpose
544
+ | RFC XML v2/v3 element
545
+
546
+ | `:email{_i}:`
547
+ | Email of author.
548
+ | `front/author/address/email`
549
+
550
+ | `:fax{_i}:`
551
+ | Fax number of author. Deprecated in v3.
552
+ | `front/author/address/facsimile`
553
+
554
+ | `:uri{_i}:`
555
+ | URI of author.
556
+ | `front/author/address/uri`
557
+
558
+ | `:phone{_i}:`
559
+ | Author's phone number. Scheme-specific part of a `tel` URI (does not include
560
+ the prefix `tel:`).
561
+ See https://tools.ietf.org/html/rfc3966#section-3[RFC3966 `global-number-digits`].
562
+ | `front/author/address/phone`
563
+
564
+ | `:street{_i}:`
565
+ | Address of author, non-city/region/code/country portion.
566
+ Multiple lines concatenated with `"\ "` will be split into separate `<street>`
567
+ elements.
568
+ | `front/author/address/postal/street`
569
+
570
+ | `:city{_i}:`
571
+ | City portion of author's address
572
+ | `front/author/address/postal/city`
573
+
574
+ | `:region{_i}:`
575
+ | Region, state or province portion of author's address. For US/CA the 2-letter state code.
576
+ | `front/author/address/postal/region`
577
+
578
+ | `:country{_i}:`
579
+ | Country of author's address
580
+ | `front/author/address/postal/country`
581
+
582
+ | `:code{_i}:`
583
+ | Postal code of author's address
584
+ | `front/author/address/postal/code`
585
+ |===
586
+
587
+
588
+ Only available for RFC XML v3:
589
+
590
+ |===
591
+ | Attribute | Purpose | RFC XML v3 element
592
+ | `:postal-line{_i}:`
593
+ | For those who want to directly format their postal addresses without regard
594
+ to the prior types. Ignored in v2. Multiple lines are concatenated with `"\ "`.
595
+ The `postal-line` attribute is mutually exclusive with the presence of `street`,
596
+ `city`, `region`, `country` and `code` attributes.
597
+ | `front/author/address/postal/postalLine`
598
+ |===
599
+
600
+
601
+ Example. This source:
602
+
603
+ [source,asciidoc]
604
+ ----
605
+ :street: 57 Mt Pleasant St\ Technology Park
606
+ :city: Dullsville
607
+ :region: NSW
608
+ :country: Australia
609
+ :code: 3333
610
+ ----
611
+
612
+ Produces:
613
+
614
+ [source,xml]
615
+ ----
616
+ <address>
617
+ <postal>
618
+ <street>57 Mt Pleasant St</street>
619
+ <street>Technology Park</street>
620
+ <city>Dullsville</city>
621
+ <region>NSW</region>
622
+ <code>3333</code>
623
+ <country>Australia</country>
624
+ </postal>
625
+ </address>
626
+ ----
627
+
628
+
629
+ === Abstract
630
+
631
+ Any paragraphs following the document header are treated as the abstract
632
+ (`front/abstract`), whether or not they are in abstract style. The abstract is
633
+ terminated by either the first section header (which ends the document
634
+ preamble), or an admonition (e.g. `note`).
635
+
636
+ Any admonitions before the first section header are treated as notes (`front/note`).
637
+
638
+ [source,asciidoc]
639
+ ----
640
+ [[abstract-id]] <1>
641
+ [abstract]
642
+ This is an abstract <2>
643
+
644
+ NOTE: This is a note <3>
645
+
646
+ [NOTE,remove-in-rfc=true] <4>
647
+ .Note 2 Title <5>
648
+ ===
649
+ This is another note <3>
650
+ ===
651
+ ----
652
+ <1> v3 only: `front/abstract@anchor` (attribute only available in v3)
653
+ <2> `front/abstract`
654
+ <3> `front/note`
655
+ <4> v3 only: `front/note@removeInRFC` (attribute only available in v3)
656
+ <5> v3: `front/note/name`; v2: `front/note@title` (mandatory attribute; if not provided, `NOTE` is supplied)
657
+
658
+
659
+ === Sections and Subsections
660
+
661
+ [source,asciidoc]
662
+ ----
663
+ :sectnums: <1>
664
+ [[id]] <2>
665
+ [remove-in-rfc=true,toc=include|exclude|default] <3>
666
+ == Section title <4>
667
+ First paragraph of section <5>
668
+
669
+ Second paragraph of section <5>
670
+
671
+ :sectnums!: <6>
672
+ === Subsection title <7>
673
+ First paragraph of subsection <8>
674
+
675
+ ==== Subsubsection title <9>
676
+ Content content content <10>
677
+ ----
678
+ <1> `middle/section@numbered=true` (attribute only available in v3)
679
+ <2> `middle/section@anchor`
680
+ <3> v3 only: `middle/section@removeInRFC`, `middle/section@toc` (attributes only available in v3)
681
+ <4> v3: `middle/section/name`; v2: `middle/section@title`
682
+ <5> `middle/section/t`
683
+ <6> `middle/section@numbered=false` (attribute only available in v3) (toggle)
684
+ <7> v3: `middle/section/section/name`; v2: `middle/section/section@title`
685
+ <8> `middle/section/section/t`
686
+ <9> v3: `middle/section/section/section/name`; v2: `middle/section/section/section@title`
687
+ <10> `middle/section/section/section/t`
688
+
689
+
690
+ === Cross-References
691
+
692
+ [source,asciidoc]
693
+ ----
694
+ Content content content
695
+ <<crossreference>> <1>
696
+ <<crossreference,text>> <2>
697
+ <<crossreference,format=(counter|title|none|default): text>> <3>
698
+ http://example.com/[linktext] <4>
699
+ The following represent the v3 relref element
700
+ <<crossreference,section_number (of|comma|parens|bare)>> <5>
701
+ <<crossreference,section_number (of|comma|parens|bare): text>> <6>
702
+ <<crossreference#fragment,section_number (of|comma|parens|bare)>> <7>
703
+ <<crossreference#fragment,section_number (of|comma|parens|bare): text>> <8>
704
+ ----
705
+ <1> `<xref target="crossreference"/>`
706
+ <2> `<xref target="crossreference">text</xref>`
707
+ <3> `<xref format="counter|title|none|default" target="crossreference">text</xref>`
708
+ <4> `<eref href="http://example.com/">linktext</eref>`
709
+ <5> v3 only: `<relref displayFormat="of|comma|parens|bare" section="section_number" target="crossreference"/>` (element only available in v3)
710
+ <6> v3 only: `<relref displayFormat="of|comma|parens|bare" section="section_number" target="crossreference">text</relref>` (element only available in v3)
711
+ <7> v3 only: `<relref relative="fragment" displayFormat="of|comma|parens|bare" section="section_number" target="crossreference"/>` (element only available in v3)
712
+ <8> v3 only: `<relref relative="fragment" displayFormat="of|comma|parens|bare" section="section_number" target="crossreference">text</relref>` (element only available in v3)
713
+
714
+ In v2, the relref style crossreferences are rendered as equivalent `xref` crossreferences,
715
+ inserting section numbers as appropriate.
716
+
717
+
718
+ === Indexing
719
+
720
+ [source,asciidoc]
721
+ --
722
+ This ((<indexterm>)) <1>
723
+ is visible in the text,
724
+ this one is not (((indexterm, index-subterm))). <2>
725
+ --
726
+ <1> `<iref item="indexterm">indexterm</iref>`
727
+ <2> `<iref item="indexterm" subitem="index-subterm"/>`
728
+
729
+
730
+ === Inline formatting
731
+
732
+ [source,asciidoc]
733
+ --
734
+ Linebreak: + <1>
735
+ _Italic_ <2>
736
+ *Bold* <3>
737
+ `Monospace` <4>
738
+ ~subscript~ <5>
739
+ ^superscript^ <6>
740
+ [bcp14]#MUST NOT# <7>
741
+ *MUST NOT* <8>
742
+ --
743
+ <1> That is, "+ " at the end of a line. v3: `<br/>`; v2: `<vspace/>`.
744
+ <2> v3: `<em>Italic</em>`; v2: `<spanx style="emph">Italic</spanx>`
745
+ <3> v3: `<strong>Bold</strong>`; v2: `<spanx style="strong">Bold</spanx>`
746
+ <4> v3: `<tt>Monospace</tt>`; v2: `<spanx style="verb">Monospace</spanx>`
747
+ <5> v3 only: `<sub>subscript</sub>`. Not supported in v2; rendered as `\_subscript_`
748
+ <6> v3 only: `<sup>superscript</sup>`. Not supported in v2; rendered as `\^superscript^`
749
+ <7> v3 only: `<bcp14>MUST NOT</bcp14>`. Not supported in v2; rendered as `<spanx style="strong">MUST NOT</spanx>`.
750
+ <8> v3: if document flag `:no-rfc-bold-bcp14:` is present, then `<strong>MUST NOT</strong>`, else (by default) any BCP14/RFC2119 phrase in boldface and capitals is assumed to be intended to be tagged in `<bcp14>`. v2: `<spanx style="strong">MUST NOT</spanx>`.
751
+
752
+ NOTE: The delimiters must occur within the one line; the following is invalid in Asciidoctor:
753
+ [source,asciidoc]
754
+ --
755
+ *WOULD
756
+ PROBABLY*
757
+ --
758
+
759
+ === Paragraphs
760
+
761
+ [source,asciidoc]
762
+ --
763
+ [[id]] <1>
764
+ [keep-with-next=true,keep-with-previous=true] <2>
765
+ Paragraph text <3>
766
+ --
767
+ <1> `t@anchor`
768
+ <2> v3 only: `t@keepWithNext`, `t@keepWithPrevious` (attributes only available in v3)
769
+ <3> `<t>Paragraph text</t>`
770
+
771
+ === Quotes (v3 only)
772
+
773
+ [source,asciidoc]
774
+ --
775
+ [[id]] <1>
776
+ [quote, attribution, citation info] <2>
777
+ Quotation <3>
778
+ --
779
+ <1> `blockquote@anchor`
780
+ <2> `blockquote@quotedFrom`, `blockquote@cite`. In v3, `citation info` is limited to a URL.
781
+ <3> `<blockquote>Quotation</blockquote>`
782
+
783
+
784
+ === Comments
785
+
786
+ In v2 RFC XML, comment text is stripped of all formatting.
787
+
788
+ [source,asciidoc]
789
+ --
790
+ NOTE: Any admonition inside the body of the text is a comment. <1>
791
+ // Note that actual AsciiDoc comments are ignored by the converter.
792
+
793
+ [[id]] <2>
794
+ [NOTE,display=true|false,source=name] <3>
795
+ .Note Title <4>
796
+ ====
797
+ Any admonition inside the body of the text is a comment.
798
+ ====
799
+ --
800
+ <1> `<cref>Any admonition inside the body of the text is a comment.</cref>`
801
+ <2> `cref@anchor`
802
+ <3> v3 only: `cref@display` (not supported in v2); v2: `cref@source`
803
+ <4> v3 only: `cref/name` (not suppported in v2)
804
+
805
+
806
+ === Source Code Listings
807
+
808
+ [source,asciidoc]
809
+ --
810
+ [[id]] <1>
811
+ .Source code listing title <2>
812
+ [source,type,src=uri,align,alt] <3>
813
+ ----
814
+ begin() {
815
+ source code listing <4>
816
+ }
817
+ ----
818
+ --
819
+ <1> v3: `figure/sourcecode@anchor`; v2: `figure/artwork@anchor`
820
+ <2> v3: `figure/sourcecode@name`; v2: `figure/artwork@name`
821
+ <3> v3: `figure/sourcecode@type`; `figure/sourcecode@src` (`align` and `alt` not supported). If `src` is present, the listing is not expected to have any content: content is taken from the hyperlink in the attribute. v2: `figure/artwork@type`, `figure/artwork@src`, `figure/artwork@align`, `figure/artwork@alt`.
822
+ <4> v3: `figure/sourcecode`; v2: `figure/artwork`
823
+
824
+
825
+ === ASCII Art and Images
826
+
827
+ [source,asciidoc]
828
+ --
829
+ [[id]] <1>
830
+ [align,alt,suppress-title] <2>
831
+ .Figure 1 <3>
832
+ ====
833
+ Preamble text <4>
834
+
835
+ [[id]] <5>
836
+ .Figure2.jpg <8>
837
+ [align=left|center|right,alt=alt_text,type] <6>
838
+ ....
839
+ Figures are only permitted to contain listings (sourcecode), images (artwork),
840
+ or literal (artwork) <7>
841
+ ....
842
+ [[id]] <5>
843
+ .Figure2.jpg <8>
844
+ [align=left|center|right,alt=alt_text,type] <9>
845
+ image::filename.jpg[alt_text,700,200] <10>
846
+
847
+ Postamble text <11>
848
+ ====
849
+ --
850
+ <1> `figure@anchor`
851
+ <2> v2 only: `figure/artwork@align`, `figure/artwork@alt`, `figure@suppress-title` (attributes only available in v2)
852
+ <3> `figure/name`
853
+ <4> v2 only: `figure/preamble` (only available in v2)
854
+ <5> `figure/artwork@anchor`
855
+ <6> `figure/artwork@align`, `figure/artwork@alt`; `figure@type` (attribute only available in v2)
856
+ <7> `figure/artwork`
857
+ <8> `figure/artwork@name`
858
+ <9> `figure/artwork@align`, `figure/artwork@alt`; `figure/artwork@type` (only available in v2, intended to be a MIME type; v3: populated as either `svg` or `binary-art` depending on file suffix)
859
+ <10> `figure/artwork@src`, `figure/artwork@alt`, `figure/artwork@width` (deprecated in v3), `figure/artwork@height` (deprecated in v3)
860
+ <11> v2 only: `figure/postamble` (only available in v2)
861
+
862
+
863
+ === Unordered and Ordered Lists
864
+
865
+ [source,asciidoc]
866
+ --
867
+ [[id]] <1>
868
+ [empty=true,spacing=normal|compact,hang-indent=n] <2>
869
+ * Unordered list 1 <3>
870
+ * Unordered list 2 <3>
871
+ ** Nested list <4>
872
+
873
+ [[id]] <5>
874
+ [spacing=compact,start=n,group=n,counter=token,hang-indent=n,format=List #%d,arabic|loweralpha|upperralpha|lowerroman|upperroman] <6>
875
+ . A <7>
876
+ . B <7>
877
+ --
878
+ <1> v3: `ul@anchor`; attribute only available in v3
879
+ <2> v3: `ul@empty`, `ul@spacing` (`hangIndent` not available); v2: `ul@style = empty`, `ul@hangIndent` (`spacing` not available)
880
+ <3> v2: `list[@style="symbols"]/t`; v3: ul/li
881
+ <4> v2: `list[@style="symbols"]/t/list[@style="symbols"]/t`; v3: `ul/li/ul/li`
882
+ <5> v3: `ol@anchor`; attribute only available in v3
883
+ <6> v2: `list/counter`, `list@hangIndent`, `list@style = format List #%d`, `list@style` (for arabic|loweralpha|upperralpha|lowerroman|upperroman) (`start`, `empty` and `group` not available) v3: `ol@empty`, `ol@start`, `ol@group`, `ol@type = "#%d", `ol@type` (for arabic|loweralpha|upperralpha|lowerroman|upperroman) (`counter`, `hangIndent` not available)
884
+ <7> v2: `list/t`; v3: `ol/li`
885
+
886
+ NOTE: Asciidoctor does not permit anchors on list items: the anchors in the following are ignored.
887
+
888
+ [source,asciidoc]
889
+ --
890
+ * [[id1]] A
891
+
892
+ . [[id2]] A
893
+ --
894
+
895
+ NOTE: RFC XML v2 does not support multiparagraph list items. Following the specification recommendation,
896
+ paragraphs within v2 list items are replaced with `vspace` tages.
897
+
898
+ === Definition Lists
899
+
900
+ [source,asciidoc]
901
+ --
902
+ [[id]] <1>
903
+ [horizontal,compact,hang-indent=n] <2>
904
+ A:: B <3>
905
+ --
906
+ <1> v3 only: `dl@anchor` (attribute only available in v3)
907
+ <2> v3 only: `dl@hanging`, `dl@spacing` (attributes only available in v3); v2 only: `list@hangIndent` (attribute only available in v2). Note that the `compact` and `horizontal` attributes are mutually exclusive in AsciiDoc.
908
+ <3> v3: `dl/dt`, `dl/dd`; v2: `list[@style="hanging"]/t@hangText`, `list[@style="hanging"]/t`
909
+
910
+ NOTE: Asciidoctor does not permit anchors on either definition list terms,
911
+ or definition list definitions: the anchors in the following are ignored.
912
+
913
+ [source,asciidoc]
914
+ --
915
+ [[id1]] A:: [[id2]]B
916
+ --
917
+
918
+ NOTE: RFC XML v2 does not support multiparagraph list items. Following the specification recommendation,
919
+ paragraphs within v2 list items are replaced with `vspace` tages.
920
+
921
+ === Tables
922
+
923
+ The converter respects the AsciiDoc (horizontal) align attributes of cells (v2,
924
+ v3), column widths (v2), and `colspan`, `rowspan` attributes (v3).
925
+
926
+ (Exceptionally,
927
+ column widths specified for v2 as `"1,1,1,1,1,1...."` will be ignored, since Asciidoctor
928
+ internally treats them identically to unspecified column widths on a table.)
929
+
930
+ [source,asciidoc]
931
+ --
932
+ [[id]] <1>
933
+ [suppress-title=true|false,align=left|center|right,grid=all|cols|none] <2>
934
+ .Table Title <3>
935
+ |===
936
+ |[[id]] head | head <4>
937
+
938
+ h|header cell | body cell <5>
939
+ | | [[id]] body cell <6>
940
+
941
+ |foot | foot <7>
942
+ |===
943
+ --
944
+ <1> v3: `table@anchor`; v2: `texttable@anchor`
945
+ <2> v2: `texttable@suppress-title`, `texttable@align`, `texttable@style` (attributes only available in v2). Mapping of Asciidoc grid attribute to RFC XML style attribute is: `all` > `all`, `cols` > `full`, `none` > `none`. The RFC XML `headers` attribute is not supported. The Asciidoc attribute `rows` is not supported.
946
+ <3> v3: `table/name`; v2: `texttable@title`
947
+ <4> v3: `table/thead/tr/td`; v2: `texttable/ttcol@id` (attribute only available in v2), `texttable/ttcol`
948
+ <5> v3: `table/tbody/tr/th`, `table/tbody/tr/td`; v2: `texttable/c`, `texttable/c`
949
+ <6> v3: `table/tbody/tr/td@anchor` (attribute only available in v3)
950
+ <7> v3: `table/tfoot/tr/td`; v2: `texttable/c`
951
+
952
+ NOTE: v3 permits table cells to contain block elements, such as paragraphs and lists. (This is done in Asciidoc by prefixing
953
+ the table cell with `a|`.) However v2 only permits inline tagging, and any block tags are ignored.
954
+
955
+ === Sidebar (v3 only)
956
+
957
+ [source,asciidoc]
958
+ --
959
+ [[id]] <1>
960
+ ****
961
+ Sidebar <2>
962
+ ****
963
+ --
964
+ <1> `aside@anchor`
965
+ <2> `<aside>Sidebar</aside>`
966
+
967
+
968
+ === References
969
+
970
+ References are expected to be provided in raw RFC XML v2 format. For v3, a list of crossreferences may
971
+ precede the block of references, with alternative text. This will not be rendered, but it will be used
972
+ to populate `displayreference` elements, mapping the reference anchors to display text. For example,
973
+ a list entry `[[[ref1,alt1]]]` means that any instances of the anchor `ref1` should be displayed as `alt1`,
974
+ and is rendered as `<displayreference target="ref1" to="alt1"/>`.
975
+
976
+ [source,asciidoc]
977
+ --
978
+ [[id]] <1>
979
+ [bibliography]
980
+ == Normative References
981
+ * [[[ref1,alt1]]] <2>
982
+ ++++
983
+ (raw XML) <3>
984
+ ++++
985
+
986
+ [[id]] <1>
987
+ [bibliography]
988
+ == Informative References
989
+ ++++
990
+ (raw XML) <2>
991
+ ++++
992
+ --
993
+ <1> `back/references@anchor`
994
+ <2> `back/displayreference@target`, `back/displayreference@to` (only in v3)
995
+ <3> `back/references/reference`
996
+
997
+
998
+
999
+ === Appendices
1000
+
1001
+ [source,asciidoc]
1002
+ --
1003
+ [[id]] <1>
1004
+ [appendix]
1005
+ == Appendix 1 <2>
1006
+ Content <3>
1007
+ --
1008
+ <1> `back/section@anchor`
1009
+ <2> v3: `back/section/name`; v2: `back/section@title`
1010
+ <3> `back/section/t`
1011
+
1012
+
1013
+
1014
+
1015
+ === Unsupported RFC XML Elements
1016
+
1017
+ The following **RFC XML v3/v2** elements are not (yet) supported through
1018
+ asciidoctor commands:
1019
+
1020
+ |===
1021
+ | RFC XML element | RFC XML v3 | RFC XML v2
1022
+ | `front/boilerplate` | Not added | N/A
1023
+ | `iref@primary` | N | N
1024
+ | `reference/*` (and all children) | N/A | N
1025
+ | `reference/front` | N | N
1026
+ | `reference/annotation` | N | N
1027
+ | `reference@quote-title` | N | N/A
1028
+ | `reference@target` | N | N
1029
+ | `table/preamble` | Deprecated | N
1030
+ | `table/postamble` | Deprecated | N
1031
+ | `table@style = headers` | N/A | N
1032
+ | `artwork@width` | Only on images | Only on images
1033
+ | `artwork@height` | Only on images | Only on images
1034
+ |===
1035
+
1036
+ === Unsupported Asciidoctor Features
1037
+
1038
+ These asciidoctor features are not supported in output of these formats:
1039
+
1040
+ |===
1041
+ | asciidoctor feature | RFC XML v2 | RFC XML v3
1042
+ | http://asciidoctor.org/docs/user-manual/#quote[Quote] | Rendered as normal paragraph | Supported
1043
+ | http://asciidoctor.org/docs/user-manual/#quote[Quote]: Non-URL Citations 2+| Ignored
1044
+ | http://asciidoctor.org/docs/user-manual/#verse[Verse] | Rendered as normal paragraph | Rendered as Quote
1045
+ | http://asciidoctor.org/docs/user-manual/#sidebar[Sidebar] | Rendered as normal paragraph | Supported
1046
+ | http://asciidoctor.org/docs/user-manual/#index-terms[Index Term]: Tertiary 2+| Ignored
1047
+ | List: http://asciidoctor.org/docs/user-manual/#numbering-styles[Ordered List numbering] `decimal`, `lowergreek` 2+| Treated as `arabic`
1048
+ | http://asciidoctor.org/docs/user-manual/#callouts[Callouts] 2+| Ignored
1049
+ | http://asciidoctor.org/docs/user-manual/#admonition[Adminitions: formatting] | Ignored | Supported
1050
+ | Formatting: http://asciidoctor.org/docs/user-manual/#discrete-headings[Floating Title] 2+| Rendered as strong paragraph
1051
+ | Formatting: http://asciidoctor.org/docs/user-manual/#page-break[Page Break] 2+| Ignored
1052
+ | Formatting: http://asciidoctor.org/docs/user-manual/#horizontal-rules[Horizontal Rule] 2+| Ignored
1053
+ | Formatting: http://asciidoctor.org/docs/user-manual/#line-breaks[Line breaks] | Supported | Only supported within table cells
1054
+ | Media: http://asciidoctor.org/docs/user-manual/#audio[Audio] 2+| Ignored
1055
+ | Media: http://asciidoctor.org/docs/user-manual/#video[Video] 2+| Ignored
1056
+ | Media: http://asciidoctor.org/docs/user-manual/#images[Inline images] 2+| Ignored
1057
+ | Macro: http://asciidoctor.org/docs/user-manual/#keyboard-shortcuts[Keyboard shortcuts] 2+| Ignored
1058
+ | Macro: http://asciidoctor.org/docs/user-manual/#menu-selections[Menu selections] 2+| Ignored
1059
+ | Macro: http://asciidoctor.org/docs/user-manual/#ui-buttons[UI buttons] 2+| Ignored
1060
+ | Table: http://asciidoctor.org/docs/user-manual/#footer-row[Distinction between table body and table footer] | No | Supported
1061
+ | Table: http://asciidoctor.org/docs/user-manual/#header-row[Multiple table header rows] | No | Supported
1062
+ | Table: http://asciidoctor.org/docs/user-manual/#table-borders[Table borders: grid = rows] | No | Ignored
1063
+ | Table: http://asciidoctor.org/docs/user-manual/#table-borders[Table borders: grid = cols\|none] | Supported | Ignored
1064
+ | Table: http://asciidoctor.org/docs/user-manual/#table-borders[Table borders: frame] 2+| Ignored
1065
+ | Table: http://asciidoctor.org/docs/user-manual/#cell[Table cells: rowspan] | Ignored | Supported
1066
+ | Table: http://asciidoctor.org/docs/user-manual/#cell[Table cells: colspan] | Ignored | Supported
1067
+ | Table: http://asciidoctor.org/docs/user-manual/#cell[Table cells: Asciidoctor formatting (blocks within cells)] | Ignored | Supported
1068
+ | Table: http://asciidoctor.org/docs/user-manual/#cols-format[Table columns: width] | Supported | Ignored
1069
+ |===
1070
+
1071
+
1072
+ == Examples
1073
+
1074
+ === RFC XML v3 Example
1075
+
1076
+ ifdef::env-github[]
1077
+ include::spec/examples/example-v3.adoc[]
1078
+ endif::[]
1079
+ ifndef::env-github[]
1080
+ [source,asciidoc]
1081
+ ----
1082
+ include::spec/examples/example-v3.adoc[]
1083
+ ----
1084
+ endif::[]
1085
+
1086
+ === RFC XML v2 Example
1087
+
1088
+ ifdef::env-github[]
1089
+ include::spec/examples/example-v2.adoc[]
1090
+ endif::[]
1091
+ ifndef::env-github[]
1092
+ [source,asciidoc]
1093
+ ----
1094
+ include::spec/examples/example-v2.adoc[]
1095
+ ----
1096
+ endif::[]
1097
+
1098
+
1099
+ == Development
1100
+
1101
+ We follow Sandi Metz's Rules for this gem, you can read the
1102
+ http://robots.thoughtbot.com/post/50655960596/sandi-metz-rules-for-developers[description of the rules here].
1103
+
1104
+ All new code should follow these
1105
+ rules. If you make changes in a pre-existing file that violates these rules you
1106
+ should fix the violations as part of your contribution.
1107
+
1108
+ === Setup
1109
+
1110
+ Clone the repository.
1111
+
1112
+ [source,sh]
1113
+ ----
1114
+ git clone https://github.com/riboseinc/asciidoctor-rfc
1115
+ ----
1116
+
1117
+ Setup your environment.
1118
+
1119
+ [source,sh]
1120
+ ----
1121
+ bin/setup
1122
+ ----
1123
+
1124
+ Run the test suite
1125
+
1126
+ [source,sh]
1127
+ ----
1128
+ bin/rspec
1129
+ ----
1130
+
1131
+ == Contributing
1132
+
1133
+ First, thank you for contributing! We love pull requests from everyone. By
1134
+ participating in this project, you hereby grant https://www.ribose.com[Ribose Inc.] the
1135
+ right to grant or transfer an unlimited number of non exclusive licenses or
1136
+ sub-licenses to third parties, under the copyright covering the contribution
1137
+ to use the contribution by all means.
1138
+
1139
+ Here are a few technical guidelines to follow:
1140
+
1141
+ . Open an https://github.com/riboseinc/asciidoctor-rfc/issues[issue] to discuss a new feature.
1142
+ . Write tests to support your new feature.
1143
+ . Make sure the entire test suite passes locally and on CI.
1144
+ . Open a Pull Request.
1145
+ . https://github.com/thoughtbot/guides/tree/master/protocol/git#write-a-feature[Squash your commits] after receiving feedback.
1146
+ . Party!
1147
+
1148
+
1149
+ == Credits
1150
+
1151
+ This gem is developed, maintained and funded by https://www.ribose.com[Ribose Inc.]