Internet-Draft | Mappings Between XML2RFC v3 and AsciiDoc | July 2023 |
Petit-Huguenin | Expires 29 January 2024 | [Page] |
This document specifies a mapping between XML2RFC v3 and AsciiDoc. The goal of this mapping and its associated tooling is to make writing an Internet-Draft as simple as possible, by converting any AsciiDoc formatted document into a valid Internet-Draft, ready to be submitted to the IETF. This is still work in progress and for the time being this mapping only ensures that any valid XML2RFC element can be generated from AsciiDoc.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 29 January 2024.¶
Copyright (c) 2023 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
This document specifies a mapping between XML2RFC v3, as defined in the successor [I-D.rswg-xml2rfcv3-implemented-01] of [RFC7991], and [AsciiDoc].¶
The goal of this mapping and its associated tooling is to make writing an Internet-Draft as simple as possible, by converting any AsciiDoc formatted document into a valid Internet-Draft, ready to be submitted to the IETF. This is still work in progress and for the time being this mapping only ensures that any valid XML2RFC element can be generated from AsciiDoc.¶
Installation and usage of the tool is described in Appendix A.¶
AsciiDoc is an extensible documentation format whose syntax can be split in two parts:¶
The mapping described in this document splits these parts further. The standard syntax is split in two subparts:¶
Elements in the compound standard syntax are converted into XML2RFC v3 by using multiple elements. That means that the conversion back to AsciiDoc will always be to elements in the primitive standard syntax, not the original elements.¶
For instance an AsciiDoc unordered list is a primitive element that is converted to an <ol> element in XML2RFC. On the other hand the AsciiDoc checklist is a compound element that is converted into a combination of <ol> and <t> elements in XML2RFC, but the conversion back will not result in an AsciiDoc checklist.¶
Similarly some AsciiDoc extensions have been developed to support XML2RFC elements and attributes that do not have a standard AsciiDoc equivalent. The XML2RFC elements and attributes will be converted back into these AsciiDoc extensions, but any other AsciiDoc extensions will be converted back into a combination of primitive AsciiDoc elements.¶
When choosing the mapping between an XML2RFC elements and an AsciiDoc element, reusing as much as possible of the standard AsciiDoc syntax was a priority. An extension is added only if a standard element with the correct semantics cannot be found.¶
AsciiDoc is not really meant to support highly structured XML2RFC elements like <front>, <reference>, <referencegroup>, <author>, and <contact>. Thus these element are used directly in AsciiDoc by inserting an XML2RFC fragment inside a passthrough block. Passthrough blocks serve also as an escape hatch for new elements added to the XML2RFC syntax until a new revision of this document is published.¶
In any case AsciiDoc, both standard and extensions, never generate deprecated XML2RFC elements or attributes.¶
This mapping is specifically designed to write Internet-Drafts so there is no support, in any direction, for XML2RFC elements and attributes that are specific to RFCs.¶
The list of xml2rc v3 elements that are specific to the generation of RFCs, and so cannot be generated from an AsciiDoc document are:¶
If a docinfo file is used, it completely replaces the generation of the <front> element. To reduce redundancy, some of the attributes declared in the document header can be referenced in the docinfo file:¶
References can be automatically extracted from local Internet-Drafts written in AsciiDoc, and inserted into a reference section by including the document with the fragment identifier "#citation", as in the following example:¶
- [[[I-D.petithuguenin-mapping-xml2rfc-asciidoc-00]]] ++++ include::test.adoc#citation[] ++++¶
This section describes the mapping between the AsciiDoc direct syntax and IETF extensions to non-deprecated XML2RFC v3 elements and attributes.¶
The <abstract> element inside a <front> element is either generated from an abstract section or copied from a docinfo file.¶
The <abstract> element can also be used inside a <reference> element in a passthrough block in the bibliography.¶
The <abstract> "anchor" attribute can be copied from a docinfo file. It cannot be generated from an abstract section.¶
The <address> element inside a <front> element is copied from a docinfo file.¶
The <address> element can also be used inside a <reference> element in a passthrough block in the bibliography.¶
The <address> element can also be used inside an <author> element in a passthrough block in a section.¶
The <annotation> element can be used inside a <reference> element in a passthrough block in the bibliography.¶
The <area> element inside a <front> element is copied from a docinfo file.¶
The <area> element can be used inside a <reference> element in a passthrough block in the bibliography.¶
The <artset> element is generated from an example block using the style "alt". This block can only contain images or literal blocks.¶
The alt style on an example block is an extension to standard AsciiDoc.¶
The following example¶
[alt] ==== image::test.jpg[] .... ASCII Art .... ====¶
is converted to¶
<artset> <artwork src='test.jpg' /> <artwork><![CDATA[ASCII Art]]></artwork> </artset>¶
The <artset> "anchor" attribute is generated from the "alt" block ID, if present.¶
The following example¶
[alt#id1] ==== image::test.jpg[] .... ASCII Art .... ====¶
is converted to¶
<artset anchor='id1'> <artwork src='test.jpg' /> <artwork><![CDATA[ASCII Art]]></artwork> </artset>¶
The <artwork> element is generated from a literal or image block.¶
The following example¶
.... ASCII Art ....¶
is converted to¶
<artwork><![CDATA[ASCII Art]]></artwork>¶
The following example¶
image::test.jpg[]¶
is converted to¶
<artwork src='test.jpg' />¶
The <artwork> "align" attribute is generated from the align attribute, if present.¶
The following example¶
[align=center] .... ASCII Art ....¶
is converted to¶
<artwork align='center'><![CDATA[ASCII Art]]></artwork>¶
The following example¶
image::test.jpg[align=center]¶
is converted to¶
<artwork align='center' src='test.jpg' />¶
The <artwork> "alt" attribute is generated from the alt attribute, if present.¶
The alt attribute on a literal block is an extension to standard AsciiDoc.¶
The following example¶
[alt="Alternative"] .... Some text ....¶
is converted to¶
<artwork alt='Alternative' name=''><![CDATA[Some text]]></artwork>¶
The following example¶
image::test.jpg[Some text]¶
is converted to¶
<artwork alt='Some text' src='test.jpg' />¶
The <artwork> "anchor" attribute is generated from the image or literal block ID, if present.¶
The following example¶
[[id2]] .... ASCII Art ....¶
is converted to¶
<artwork anchor='id2'><![CDATA[ASCII Art]]></artwork>¶
The following example¶
[[id3]] image::test.jpg[]¶
is converted to¶
<artwork anchor='id3' src='test.jpg' />¶
The <artwork> "name" attribute is generated from the name attribute, if present.¶
The name attribute on a literal block is an extension to standard AsciiDoc.¶
The following example¶
[name="test.txt"] .... ASCII Art ....¶
is converted to¶
<artwork><![CDATA[ASCII Art]]></artwork>¶
The <artwork> "src" attribute is generated from the target of an image block.¶
The src attribute on an image block is an extension to standard AsciiDoc.¶
The following example¶
image::test.jpg[]¶
is converted to¶
<artwork src='test.jpg' />¶
The <artwork> "type" attribute is generated from the format attribute, if present.¶
The format attribute on an literal block is an extension to standard AsciiDoc.¶
The following example¶
[format="ascii-art"] .... ASCII Art ....¶
is converted to¶
<artwork type='ascii-art'><![CDATA[ASCII Art]]></artwork>¶
The <aside> element is generated from a sidebar block.¶
The following example¶
**** Some text ****¶
is converted to¶
<aside> <t> Some text </t> </aside>¶
The <aside> "anchor" attribute is generated from the aside block ID, if present.¶
The following example¶
[[id4]] **** Some text ****¶
is converted to¶
<aside anchor='id4'> <t> Some text </t> </aside>¶
The <author> element inside a <front> element is either generated from the author information in the document header or copied from a docinfo file.¶
The <author> element can also be used inside a <reference> element in a passthrough block in the bibliography.¶
The <back> element is implicitly generated when a bibliography or a appendices are added to a document.¶
The <bcp14> element is generated from the text span style bcp14.¶
The text span style bcp14 is an extension to standard AsciiDoc.¶
The following example¶
Implementers [bcp14]#MUST# implement all MUST.¶
is converted to¶
<t> Implementers <bcp14>MUST</bcp14> implement all MUST. </t>¶
The <blockquote> element is generated from a quote block.¶
The following example¶
____ Some text ____¶
is converted to¶
<blockquote> <t> Some text </t> </blockquote>¶
The <blockquote> "anchor" attribute is generated from the quote block ID, if present.¶
The following example¶
[[id5]] ____ Some text ____¶
is converted to¶
<blockquote anchor='id5'> <t> Some text </t> </blockquote>¶
The <blockquote> "cite" attribute is generated from the quote block cite attribute, if present.¶
The cite attribute on an literal block is an extension to standard AsciiDoc.¶
The following example¶
[quote,cite=https://link] ____ Some text ____¶
is converted to¶
<blockquote cite='http://link'> <t> Some text </t> </blockquote>¶
The <blockquote> "quotedFrom" attribute is generated from the quote block positional attribute, if present.¶
The following example¶
[quote,attribution] ____ Some text ____¶
is converted to¶
<blockquote quotedFrom='attribution'> <t> Some text </t> </blockquote>¶
The <boilerplate> element is used only for RFCs and so is not generated.¶
The <br> element is generated from the " +" string at the end of a line in a paragraph.¶
The following example¶
This is + two lines¶
is converted to¶
<t> This is<br /> two lines </t>¶
The <contact> element and its attributes are provided in a section as a passthrough block containing that element, or in a paragraph as an inline passthrough containing that element.¶
The <country> element and its attribute inside a <front> element is copied from a docinfo file.¶
The <country> element can be used inside a <reference> element in a passthrough block in the bibliography.¶
The <cref> element is generated from the comment inline macro.¶
The comment inline macro and its attributes are extensions to standard AsciiDoc.¶
The following example¶
The comment:[Replace native] native mode can be used.¶
is converted to¶
<t> The <cref>Replace native</cref> native mode can be used. </t>¶
The <cref> "anchor" attribute is generated from the comment inline macro ID, if present.¶
The following example¶
The comment:[Replace native,id=id6] native mode can be used.¶
is converted to¶
<t> The <cref anchor='id6'>Replace native</cref> native mode can be used. </t>¶
The <cref> "display" attribute is generated from the comment inline macro display attribute, if present.¶
The following example¶
The comment:[Replace native,display=true] native mode can be used.¶
is converted to¶
<t> The <cref display='true'>Replace native</cref> native mode can be used. </t>¶
The <cref> "source" attribute is generated from the comment inline macro source attribute, if present.¶
The following example¶
The comment:[Replace native,source=MPH] native mode can be used.¶
is converted to¶
<t> The <cref source='MPH'>Replace native</cref> native mode can be used. </t>¶
The <date> element and its attributes inside a <front> element are either generated from an revdate document header or copied from a docinfo file.¶
The <date> element can also be used inside a <reference> element in a passthrough block in the bibliography.¶
The <dd> element is generated from the definition part of a description list.¶
The following example¶
text:: data¶
is converted to¶
<dl> <dt>text</dt><dd>data</dd> </dl>¶
The <dd> anchor attribute cannot be generated.¶
The <displayreference> element is generated from a bibliography entry bibref that differs from the ID of the entry itself.¶
The following example¶
[bibliography] == References * [[[id8]]] + [[id9]] ++++ <reference anchor="id9"> </reference> ++++¶
is converted to¶
<back> <displayreference target="id9" to="id8" /> <references> <name>References</name> <reference anchor="id9"> </reference> </references> </back>¶
The <displayreference> target attribute cannot be generated.¶
The displayreference "to" attribute cannot be generated.¶
The <dl> element is generated from a description list.¶
The following example¶
text:: data¶
is converted to¶
<dl> <dt>text</dt><dd>data</dd> </dl>¶
The <dl> "anchor" attribute is generated from the ID of a description list, if present.¶
The following example¶
[[id10]] text:: data¶
is converted to¶
<dl anchor='id10'> <dt>text</dt><dd>data</dd> </dl>¶
The <dl> "indent" attribute is generated from the indent attribute of a description list, if present.¶
The description list indent attribute is an extension to standard AsciiDoc.¶
The following example¶
[indent=3] text:: data¶
is converted to¶
<dl indent='3'> <dt>text</dt><dd>data</dd> </dl>¶
The <dl> "newline" attribute is generated from the indent attribute of a description list, if present.¶
The description list newline attribute is an extension to standard AsciiDoc.¶
The following example¶
[newline=true] text:: data¶
is converted to¶
<dl newline='true'> <dt>text</dt><dd>data</dd> </dl>¶
The <dl> "spacing" attribute is generated from the spacing attribute of a description list, if present.¶
The description list spacing attribute is an extension to standard AsciiDoc.¶
The following example¶
[spacing=compact] text:: data¶
is converted to¶
<dl spacing='contact'> <dt>text</dt><dd>data</dd> </dl>¶
The <dt> element is generated from the term part of a definition list.¶
The following example¶
text:: data¶
is converted to¶
<dl> <dt>text</dt><dd>data</dd> </dl>¶
The <dt> anchor attribute cannot be generated.¶
The <em> element is generated from an italic text formatting.¶
The following example¶
Text with __emphasis__.¶
is converted to¶
<t> Text with <em>emphasis</em>. </t>¶
The <email> element inside a <front> element is either generated from the email document header or copied from a docinfo file.¶
The <email> element can also be used inside a <reference> element in a passthrough block in the bibliography.¶
The <email> element can also be used inside an <author> element in a passthrough block in a section.¶
The <eref> element is generated from a link macro.¶
The following example¶
As cited in link:https://test[].¶
is converted to¶
<t> As cited in <eref target='https://test' />. </t>¶
The <eref> "bracket" attribute is generated from the bracket attribute in the link macro, if present.¶
The link macro bracket attribute is an extension to standard AsciiDoc.¶
The following example¶
As cited in link:https://test[brackets=true].¶
is converted to¶
<t> As cited in <eref brackets='true' target='https://test' />. </t>¶
The <eref> "target" attribute is generated from the target in the link macro.¶
The following example¶
As cited in link:https://test[].¶
is converted to¶
<t> As cited in <eref target='https://test' />. </t>¶
The <figure> element is generated from an example block with the style "figure".¶
The figure style on an example block is an extension to standard AsciiDoc.¶
The following example¶
[figure] ==== image::test.jpg[] ====¶
is converted to¶
<figure> <artwork src='test.jpg' /> </figure>¶
The <figure> "anchor" attribute is generated from the ID of a figure block, if present.¶
[[id12]] [figure] ==== image::test.jpg[] ====¶
is converted to¶
<figure anchor='id12'> <artwork src='test.jpg' /> </figure>¶
The <front> element is either generated from the author information in the document header or copied from a docinfo file.¶
The <front> element can also be used inside a <reference> element in a passthrough block in the bibliography.¶
The <iref> element is generated either from an indexterm inline macro or from an indexterm block macro extension.¶
The indexterm block macro is an extension to standard AsciiDoc.¶
The following example¶
Text with an (((test))) index.¶
is converted to¶
<t> Text with an <iref item='test' /> index. </t>¶
The following example¶
indexterm::[test]¶
is converted to¶
<iref item='test'/>¶
The <iref> "item" attribute is generated from the positional attribute of the index term.¶
The following example¶
Text with an (((test))) index.¶
is converted to¶
<t> Text with an <iref item='test' /> index. </t>¶
The <iref> "primary" attribute is generated from the primary attribute of the index term.¶
The primary indexterm block macro attribute is an extension to standard AsciiDoc.¶
The following example¶
Text with an (((test,,primary=true))) index.¶
is converted to¶
<t> Text with an <iref item='test' subitem='' /> index. </t>¶
The following example¶
indexterm::[test,primary=true]¶
is converted to¶
<iref item='test' primary='true'/>¶
The <iref> "subitem" attribute is generated from the secondary attribute of the index term.¶
The secondary indexterm block macro attribute is an extension to standard AsciiDoc.¶
The following example¶
Text with an (((test,test2))) index.¶
is converted to¶
<t> Text with an <iref item='test' subitem='test2' /> index. </t>¶
The following example¶
indexterm::[test,test2]¶
is converted to¶
<iref item='test' subitem='test2'/>¶
The <keyword> element inside a <front> element is copied from a docinfo file.¶
The <keyword> element can also be used inside a <reference> element in a passthrough block in the bibliography.¶
The <li> element is generated from a line in either an unordered or an ordered list.¶
The following example¶
. One line¶
is converted to¶
<ol> <li>One line</li> </ol>¶
The following example¶
* One line¶
is converted to¶
<ul> <li>One line</li> </ul>¶
The <li> "anchor" attribute is generated from the ID of a list item, if present.¶
The following example¶
. [[id13]]test¶
is converted to¶
<ol> <li anchor='id13'>test</li> </ol>¶
The following example¶
* [[id14]]test¶
is converted to¶
<ul> <li anchor='id14'>test</li> </ul>¶
The <link> element is provided in the docinfo file.¶
The <middle> element is implicitly generated.¶
The <name> element is generated from the title in either a section, an example block with figure style, or a table block.¶
The possibility of using formatted text in an example block with figure style title or in a table title is an extension to standard AsciiDoc.¶
The following example¶
== section¶
is converted to¶
<section numbered='false'> <name>section</name> </section>¶
The following example¶
.title [figure] ==== .... ASCII Art. .... ====¶
is converted to¶
<figure> <name>title</name> <artwork><![CDATA[ASCII Art]]></artwork> </figure>¶
The following example¶
.title |=== | Test |===¶
is converted to¶
<table> <name>title</name> <tbody><tr><td align='left'>Test</td></tr></tbody> </table>¶
The <note> element inside a <front> element is either generated from the revremark document header or copied from a docinfo file.¶
The <note> element can also be used inside a <reference> element in a passthrough block in the bibliography.¶
The <ol> element is generated from an ordered list.¶
The following example¶
. One line¶
is converted to¶
<ol> <li>One line</li> </ol>¶
The <ol> "anchor" attribute is generated from the ID of a ordered list, if present.¶
The following example¶
[[id15]] . test¶
is converted to¶
<ol anchor='id15'> <li>test</li> </ol>¶
The <ol> "group" attribute is generated from the group attribute of a ordered list, if present.¶
The group attribute on an ordered list is an extension to standard AsciiDoc.¶
The following example¶
[group=2] . test¶
is converted to¶
<ol group='2'> <li>test</li> </ol>¶
The <ol> "indent" attribute is generated from the indent attribute of an ordered list, if present.¶
The indent attribute on an ordered list is an extension to standard AsciiDoc.¶
The following example¶
[indent=2] . test¶
is converted to¶
<ol indent='2'> <li>test</li> </ol>¶
The <ol> "spacing" attribute is generated from the spacing attribute of an ordered list, if present.¶
The spacing attribute on an ordered list is an extension to standard AsciiDoc.¶
The following example¶
[spacing=true] . test¶
is converted to¶
<ol spacing='true'> <li>test</li> </ol>¶
The <ol> "start" attribute is generated from the start attribute of an ordered list, if present.¶
The following example¶
[start=0] . test¶
is converted to¶
<ol start='0'> <li>test</li> </ol>¶
The <ol> "type" attribute is generated from the style of an ordered list, if present.¶
The prefix and suffix types are used to generate a "type" attribute that uses the "percent-letter" format. The prefix and suffix attributes on an ordered list are extensions to standard AsciiDoc.¶
The following example¶
[lowerroman] . test¶
is converted to¶
<ol type='i'> <li>test</li> </ol>¶
The following example¶
[arabic,prefix="[REQ",suffix="]"] . test¶
is converted to¶
<ol type='[REQ%d]'> <li>test</li> </ol>¶
The <organization> element inside a <front> element is copied from a docinfo file.¶
The <organization> element can also be used inside a <reference> element in a passthrough block in the bibliography.¶
The <organization> element can also be used inside an <author> element in a passthrough block in a section.¶
The <phone> element inside a <front> element is copied from a docinfo file.¶
The <phone> element can also be used inside a <reference> element in a passthrough block in the bibliography.¶
The <phone> element can also be used inside an <author> element in a passthrough block in a section.¶
The <postal> element inside a <front> element is copied from a docinfo file.¶
The <postal> element can also be used inside a <reference> element in a passthrough block in the bibliography.¶
The <postal> element can also be used inside an <author> element in a passthrough block in a section.¶
The <postalLine> element inside a <front> element is copied from a docinfo file.¶
The <postalLine> element can also be used inside a <reference> element in a passthrough block in the bibliography.¶
The <postalLine> element can also be used inside an <author> element in a passthrough block in a section.¶
The <refcontent> element can be used inside a <reference> element in a passthrough block in the bibliography.¶
The <reference> element is provided in a passthrough block in the bibliography.¶
The <referencegroup> element is provided in a passthrough block in the bibliography.¶
The <references> element is generated from an unordered list in a bibliography section.¶
The following example¶
[bibliography] == References * [[[id16]]] + ++++ <reference anchor="id16"> </reference> ++++¶
is converted to¶
<back> <references> <name>References</name> <reference anchor="id16"> </reference> </references> </back>¶
The <references> "anchor" attribute is generated from the ID of an unordered list in a bibliographic section, if present.¶
The following example¶
[[id17]] [bibliography] == References¶
is converted to¶
<back> <references anchor='id17'> </references> </back>¶
The <rfc> element is generated by a top level section:¶
The following example¶
= Title¶
is converted to¶
<rfc category='info' docName='test' ipr='trust200902' tocInclude='false' version='3'>¶
The <rfc> "category" attribute is generated from the category document header attribute.¶
The category attribute on a document header is an extension to standard AsciiDoc.¶
The following example¶
= Title :category: std¶
is converted to¶
<rfc category='std' docName='test' ipr='trust200902' tocInclude='false' version='3'>¶
The <rfc> "consensus" attribute is generated from the consensus document header attribute.¶
The consensus attribute on a document header is an extension to standard AsciiDoc.¶
The following example¶
= Title :consensus: true¶
is converted to¶
<rfc category='info' consensus='true' docName='test' ipr='trust200902' tocInclude='false' version='3'>¶
The <rfc> "docName" attribute is generated from the doc-name document header attribute.¶
The doc-name attribute on a document header is an extension to standard AsciiDoc.¶
The following example¶
= Title :doc-name: draft-petithuguenin-ex-00¶
is converted to¶
<rfc category='info' docName='draft-petithuguenin-ex-00' ipr='trust200902' tocInclude='false' version='3'>¶
The <rfc> "indexInclude" attribute is generated from the "index-include" document header attribute if present.¶
The following example¶
= Title :index-include: false¶
is converted to¶
<rfc category='info' docName='test' indexInclude='false' ipr='trust200902' tocInclude='false' version='3'>¶
The <rfc> "ipr" attribute is generated from the "ipr" document header attribute if present, or with the "trust200902" content if not present.¶
The following example¶
= Title :ipr: noModificationTrust200902¶
is converted to¶
<rfc category='info' docName='test' ipr='noModificationTrust200902' tocInclude='false' version='3'>¶
Specific to RFC, so not implemented.¶
Specific to RFC, so not implemented.¶
The <rfc> "obsoletes" attribute is generated from the "obsoletes" document header attribute if present.¶
The following example¶
= Title :obsoletes: 3261,3262,3263,3264¶
is converted to¶
<rfc category='info' docName='test' ipr='trust200902' obsoletes='3261,3262,3263,3264' tocInclude='false' version='3'>¶
Specific to RFC, so not implemented.¶
Specific to RFC, so not implemented.¶
The <rfc> "sortRefs" attribute is generated from the "sort-refs" document header attribute if present.¶
The following example¶
= Title :sort-refs: true¶
is converted to¶
<rfc category='info' docName='test' ipr='trust200902' sortRefs='true' tocInclude='false' version='3'>¶
The <rfc> "submissionType" attribute is generated from the "submission-type" document header attribute if present.¶
The following example¶
= Title :submission-type: independent¶
is converted to¶
<rfc category='info' docName='test' ipr='trust200902' submissionType='independent' tocInclude='false' version='3'>¶
The <rfc> "symRefs" attribute is generated from the "sym-refs" document header attribute if present.¶
The following example¶
= Title :sym-refs: false¶
is converted to¶
<rfc category='info' docName='test' ipr='trust200902' symRefs='false' tocInclude='false' version='3'>¶
The <rfc> "tocDepth" attribute is generated from the "toclevels" document header attribute if present.¶
The following example¶
= Title :toclevels: 4¶
is converted to¶
<rfc category='info' docName='test' ipr='trust200902' tocDepth='4' tocInclude='false' version='3'>¶
The <rfc> "tocInclude" attribute with a value of "false" is generated from the "toc" document header attribute if not present, or a value of "true" if present.¶
The following example¶
= Title :toc:¶
is converted to¶
<rfc category='info' docName='test' ipr='trust200902' tocInclude='true' version='3'>¶
The <rfc> "updates" attribute is generated from the "updates" document header attribute if present.¶
The following example¶
= Title :updates: 3261,3262,3263,3264¶
is converted to¶
<rfc category='info' docName='test' ipr='trust200902' updates='3261,3262,3263,3264' tocInclude='false' version='3'>¶
The <rfc> "version" attribute is implicitly generated.¶
The following example¶
= Title¶
is converted to¶
<rfc category='info' docName='test' ipr='trust200902' tocInclude='false' version='3'>¶
The <section> attribute is generated from a document section.¶
The following example¶
== Section 1¶
is converted to¶
<section numbered='false'> <name>Section 1</name> </section>¶
The <section> "anchor" attribute is generated from section ID, if present.¶
The following example¶
[[id18]] == Section 1¶
is converted to¶
<section anchor='id18' numbered='false'> <name>Section 1</name> </section>¶
The <section> "numbered" attribute is generated from the current value of the sectnums attribute. Note that AsciiDoc standards sections are unnumbered by default, but xml2rfc sections are numbered by default, so a ":sectnums:" attribute should be added to the document header.¶
Each AsciiDoc special sections with style "appendix" that needs to be unnumbered needs to be preceded with the attribute ":sectnums!".¶
The following example¶
:sectnums!: == Section 1¶
is converted to¶
<section numbered='false'> <name>Section 1</name> </section>¶
The <section> "removeInRfc" attribute is generated from the remove-in-rfc section attribute.¶
The remove-in-rfc attribute on a section is an extension to standard AsciiDoc.¶
The following example¶
[remove-in-rfc=true] == Section 1¶
is converted to¶
<section numbered='false' removeInRFC='true'> <name>Section 1</name> </section>¶
The <section> "toc" attribute is generated from the section attribute "toc".¶
The toc attribute on a section is an extension to standard AsciiDoc.¶
The following example¶
[toc=exclude] == Section 1¶
is converted to¶
<section numbered='false' toc='exclude'> <name>Section 1</name> </section>¶
The <seriesInfo> element inside a <front> element is copied from a docinfo file.¶
The <seriesInfo> element can also be used inside a <reference> element in a passthrough block in the bibliography.¶
The <sourcecode> element is generated from a listing block with the source style.¶
The following example¶
[source] ---- class Test {} ----¶
is converted to¶
<sourcecode><![CDATA[class Test {}]]></sourcecode>¶
The <sourcecode> "anchor" attribute is generated from the ID of a listing block with source style, if present.¶
The following example¶
[[id19]] [source] ---- class Test {} ----¶
is converted to¶
<sourcecode anchor='id19'><![CDATA[class Test {}]]></sourcecode>¶
The <sourcecode> "markers" attribute is generated from the markers attribute of a listing block with source style, if present.¶
The markers attribute on a listing block with source style is an extension to standard AsciiDoc.¶
The following example¶
[source,markers=true] ---- class Test {} ----¶
is converted to¶
<sourcecode markers='true'><![CDATA[class Test {}]]></sourcecode>¶
The <sourcecode> "name" attribute is generated from the name attribute of a listing block with source style, if present.¶
The name attribute on a listing block with source style is an extension to standard AsciiDoc.¶
The following example¶
[source,name=Test.java] ---- class Test {} ----¶
is converted to¶
<sourcecode name='Test.java'><![CDATA[ class Test {} ]]></sourcecode>¶
The <sourcecode> "src" attribute is generated from the src attribute of a listing block with source style, if present.¶
The src attribute on a listing block with source style is an extension to standard AsciiDoc.¶
The following example¶
[source,src=Test.java] ---- ----¶
is converted to¶
<sourcecode src='Test.java' />¶
The <sourcecode> "type" attribute is generated from the positional attribute of a listing block with source style, if present.¶
The following example¶
[source,java] ---- class Test {} ----¶
is converted to¶
<sourcecode type='java'><![CDATA[class Test {}]]></sourcecode>¶
The <stream> element inside a <front> element is copied from a docinfo file.¶
The <stream> element can also be used inside a <reference> element in a passthrough block in the bibliography.¶
The <strong> element is generated from a bold text formatting.¶
The following example¶
**Strong** text.¶
is converted to¶
<t> <strong>Strong</strong> text. </t>¶
The <sub> element is generated from a subscript text formatting.¶
The following example¶
Base~16~.¶
is converted to¶
<t> Base<sub>16</sub>. </t>¶
The <sup> element is generated from a superscript text formatting.¶
The following example¶
E = mc^2^¶
is converted to¶
<t> E = mc<sup>2</sup> </t>¶
The <t> element is generated from a paragraph.¶
The following example¶
Some text.¶
is converted to¶
<t> Some text. </t>¶
The <t> "anchor" attribute is generated from the ID of a paragraph, if present.¶
The following example¶
[[id20]] Some text.¶
is converted to¶
<t anchor='id20'> Some text. </t>¶
The <t> "indent" attribute is generated from the indent attribute of a paragraph, if present.¶
The indent attribute on a paragraph is an extension to standard AsciiDoc.¶
The following example¶
[ident=3] Some text.¶
is converted to¶
<t indent='3'> Some text. </t>¶
The <t> "keepWithNext" attribute is generated from the keep-with-next attribute of a paragraph, if present.¶
The keep-with-next attribute on a paragraph is an extension to standard AsciiDoc.¶
The following example¶
[keep-with-next=true] Some text.¶
is converted to¶
<t keepWithNext='true'> Some text. </t>¶
The <t> "keepWithPrevious" attribute is generated from the keep-with-previous attribute of a paragraph, if present.¶
The keep-with-previous attribute on a paragraph is an extension to standard AsciiDoc.¶
The following example¶
[keep-with-previous=true] Some text.¶
is converted to¶
<t keepWithPrevious='true'> Some text. </t>¶
The <table> element is generated from a table.¶
The following example¶
|=== | Cell |===¶
is converted to¶
<table> <tbody><tr><td align='left'>Cell</td></tr></tbody> </table>¶
The <table> "align" attribute is generated from the ID of a table, if present.¶
The following example¶
[align=left] |=== | Cell |===¶
is converted to¶
<table align='left'> <tbody><tr><td align='left'>Cell</td></tr></tbody> </table>¶
The <table> "anchor" attribute is generated from the ID of a table, if present.¶
The following example¶
[[id21]] |=== | Cell |===¶
is converted to¶
<table anchor='id21'> <tbody><tr><td align='left'>Cell</td></tr></tbody> </table>¶
The <tbody> element is generated from a table with rows.¶
The following example¶
|=== | Cell |===¶
is converted to¶
<table> <tbody><tr><td align='left'>Cell</td></tr></tbody> </table>¶
The <tbody> anchor attribute cannot be generated.¶
The <td> element is generated from a table with at least one cell.¶
The following example¶
|=== | Cell |===¶
is converted to¶
<table> <tbody><tr><td align='left'>Cell</td></tr></tbody> </table>¶
The <td> "align" attribute is generated from the horizontal alignment operator of a cell in a table, if present.¶
The following example¶
|=== |> Cell |===¶
is converted to¶
<table> <tbody><tr><td align='left'>> Cell</td></tr></tbody> </table>¶
The <td> anchor attribute cannot be generated.¶
The <td> "colspan" attribute is generated from the horizontal alignment operator of a cell in a table, if present.¶
The following example¶
|=== | Cell |===¶
is converted to¶
<table> <tbody><tr><td align='left'>Cell</td></tr></tbody> </table>¶
The <td> "rowspan" attribute is generated from the horizontal alignment operator of a cell in a table, if present.¶
The following example¶
|=== | Cell |===¶
is converted to¶
<table> <tbody><tr><td align='left'>Cell</td></tr></tbody> </table>¶
The <tfoot> element is generated from a table with footer.¶
The following example¶
[%footer] |=== | Cell | Footer |===¶
is converted to¶
<table> <tbody><tr><td align='left'>Cell</td></tr></tbody> <tfoot><tr><td align='left'>Footer</td></tr></tfoot> </table>¶
The <tfoot> anchor attribute cannot be generated.¶
The <th> element is generated from a table with at least one cell.¶
The following example¶
|=== | Cell |===¶
is converted to¶
<table> <tbody><tr><td align='left'>Cell</td></tr></tbody> </table>¶
The <th> "align" attribute is generated from the horizontal alignment operator of a cell in a table, if present.¶
The following example¶
|=== |> Cell |===¶
is converted to¶
<table> <tbody><tr><td align='left'>> Cell</td></tr></tbody> </table>¶
The <th> anchor attribute cannot be generated.¶
The <th> "colspan" attribute is generated from the horizontal alignment operator of a cell in a table, if present.¶
The following example¶
|=== | Cell |===¶
is converted to¶
<table> <tbody><tr><td align='left'>Cell</td></tr></tbody> </table>¶
The <th> "rowspan" attribute is generated from the horizontal alignment operator of a cell in a table, if present.¶
The following example¶
|=== | Cell |===¶
is converted to¶
<table> <tbody><tr><td align='left'>Cell</td></tr></tbody> </table>¶
The <thead> element is generated from a table with header.¶
The following example¶
[%header] |=== | Header | Cell |===¶
is converted to¶
<table> <thead><tr><td align='left'>Header</td></tr></thead> <tbody><tr><td align='left'>Cell</td></tr></tbody> </table>¶
The <tfoot> anchor attribute cannot be generated.¶
The <title> element and its attributes are provided in the docinfo file or in a passthrough block containing a top <reference> element.¶
The <toc> element is provided in the docinfo file.¶
The <tr> element is generated from a table with rows.¶
The following example¶
|=== | Cell |===¶
is converted to¶
<table> <tbody><tr><td align='left'>Cell</td></tr></tbody> </table>¶
The <tr> anchor attribute cannot be generated.¶
The <tt> element is generated from a monospace text formatting.¶
The following example¶
The function ``main()``¶
is converted to¶
<t> The function <tt>main()</tt> </t>¶
The <u> element is generated from an u inline macro.¶
The inline macro is an extension to standard AsciiDoc.¶
The following example¶
This is u:[test]¶
is converted to¶
<t> This is <u>test</u> </t>¶
The <u> "anchor" attribute is generated from the ID of a u inline macro, if present.¶
The following example¶
This is u:[test,id=id26]¶
is converted to¶
<t> This is <u anchor='id26'>test</u> </t>¶
The <u> "ascii" attribute is generated from the ascii attribute of a u inline macro, if present.¶
The following example¶
This is u:[test,ascii=test]¶
is converted to¶
<t> This is <u ascii='test'>test</u> </t>¶
The <u> "format" attribute is generated from the format attribute of a u inline macro, if present.¶
The following example¶
This is u:[test,format=lit-num-name]¶
is converted to¶
<t> This is <u format='lit-num-name'>test</u> </t>¶
The <ul> element is generated from an unordered list.¶
The following example¶
* One line¶
is converted to¶
<ul> <li>One line</li> </ul>¶
The <ul> "anchor" attribute is generated from the ID of an unordered list, if present.¶
The following example¶
[[id27]] * test¶
is converted to¶
<ul anchor='id27'> <li>test</li> </ul>¶
The <ul> "bare" attribute is generated from the unstyled style on an unordered list, if present.¶
The following example¶
[unstyled] * test¶
is converted to¶
<ul bare='true' empty='true'> <li>test</li> </ul>¶
The <ul> "empty" attribute is generated from the no-bullet style on an unordered list, if present.¶
The following example¶
[no-bullet] * test¶
is converted to¶
<ul empty='true'> <li>test</li> </ul>¶
The <ul> "indent" attribute is generated from the indent attribute on an unordered list, if present.¶
The indent attribute on am unordered is an extension to standard AsciiDoc.¶
The following example¶
[indent=3] * test¶
is converted to¶
<ul indent='3'> <li>test</li> </ul>¶
The <ul> "spacing" attribute is generated from the spacing attribute on an unordered list, if present.¶
The spacing attribute on an unordered list is an extension to standard AsciiDoc.¶
The following example¶
[spacing=compact] * test¶
is converted to¶
<ul spacing='compact'> <li>test</li> </ul>¶
The <uri> element inside a <front> element is copied from a docinfo file.¶
The <uri> element can also be used inside a <reference> element in a passthrough block in the bibliography.¶
The <uri> element can also be used inside an <author> element in a passthrough block in a section.¶
The <workgroup> element inside a <front> element is copied from a docinfo file.¶
The <workgroup> element can also be used inside a <reference> element in a passthrough block in the bibliography.¶
The <workgroup> element can also be used inside an <author> element in a passthrough block in a section.¶
The <xref> element is generated from a cross-reference.¶
The following example¶
As described in <<RFC7991>>.¶
is converted to¶
<t> As described in <xref target='RFC7991' />. </t>¶
The <xref> "format" attribute is generated from the format attribute in a cross reference, if present.¶
The format attribute on a cross reference is an extension to standard AsciiDoc.¶
The following example¶
As described in <<RFC7991,format=counter>>.¶
is converted to¶
<t> As described in <xref target='RFC7991' format='counter'></xref>. </t>¶
The <xref> "relative" attribute is generated from the relative attribute in a cross reference, if present.¶
The relative attribute on a cross reference is an extension to standard AsciiDoc.¶
The following example¶
As described in <<RFC7991,relative=#rel>>.¶
is converted to¶
<t> As described in <xref target='RFC7991' relative='#rel'></xref>. </t>¶
The <xref> "section" attribute is generated from the section attribute in a cross reference, if present.¶
The section attribute on a cross reference is an extension to standard AsciiDoc.¶
The following example¶
As described in <<RFC7991,section=id28>>.¶
is converted to¶
<t> As described in <xref target='RFC7991' section='id28'></xref>. </t>¶
The <xref> "sectionFormat" attribute is generated from the section-format attribute in a cross reference, if present.¶
The section-format attribute on a cross reference is an extension to standard AsciiDoc.¶
The following example¶
As described in <<RFC7991,section-format=comma>>.¶
is converted to¶
<t> As described in <xref target='RFC7991' sectionFormat='comma'></xref>. </t>¶
The <xref> "target" attribute is generated from the target in a cross reference.¶
The following example¶
As described in <<RFC7991>>.¶
is converted to¶
<t> As described in <xref target='RFC7991' />. </t>¶
The "asciidoctor-xml" Ruby gem is distributed as a git repository that can be installed as follow:¶
git clone git://shalmaneser.org/sniElnixoip1 asciidoctor-xml2rfc cd asciidoctor-xml2rfc gem build asciidoctor-xml2rfc.gemspec sudo gem install asciidoctor-xml2rfc-0.3.gem¶
Then an AsciiDoc file can be converted into an XML2RFC v3 file like this:¶
asciidoctor-xml2rfc mapping-xml2rfc-asciidoc.adoc¶
Note that, if present, the value of the "doc-name" document header attribute will be used as the name of the output file. This permits to keep the same file name but generate different versions by just changing the doc-name header.¶
The command will write the name of the generated file on the standard output, so it can be used to generate the final document:¶
xml2rfc -P --html --text \ $(asciidoctor-xml2rfc mapping-xml2rfc-asciidoc.adoc)¶
The "-P" option generates the text file without pagination, which permits to do a local diff between different versions of a draft (e.g., with the ":vert diffs <previous-file>" command in VIM).¶
The simplest way to build a bibliography is to use [Zotero] and the AsciiBib exporter provided in the git repository. The Better BibTex for Zotero [BetterBibTeX] add-on is needed to manage the citation keys for the bibliographic items exported.¶
First the "AsciiBib.js" file must be copied, or better symbolically linked, in the "data/translators" directory under the Zotero configuration directory (most likely "~/.zotero").¶
To build a bibliography for an Internet-Draft, first create a new collection in Zotero and add bibliographic items in it. E.g., a collection named "mapping-xml2rfc-asciidoc" contains a sub-collection named "informative", which itself contains all the references for this document.¶
Bibliographic items can be created from scratch, scrapped from the Internet using web translators, or imported from an existing bibliography. The git repository distributed with [draft-petithuguenin-rfc-ontology] contains a Zotero importer that can create the full collection of RFCs items in Zotero from the "rfc-index.xml" file.¶
A Zotero collection can then be converted into a AsciiBib file by right-clicking on it, choosing "Export Collection...", select the "AsciiBib" format, then finally the target directory. This will create an AsciiDoc file that can be imported in a bibliography section:¶
include::examples.adoc[]¶
The Zotero exporter tries to export bibliographic items in a form that is as close as possible to the RFC Style guides [RFC7322] [WebPortionStyle]. The Section 6 bibliography in this document shows examples of bibliographic items converted from Zotero:¶
No technology that cannot explain its own results (LLM, AI/ML) have been involved in the creation of this document or its associated tooling.¶
This section is to be removed before publishing as an RFC.¶