Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add classes to xref #867

Merged
merged 8 commits into from
Sep 22, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/input/draft-v3-features.xml
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@
<t>(default, TEXTCONTENT) see <xref target="listitem">TEXTCONTENT</xref>.</t>
<t>(counter, TEXTCONTENT) see <xref target="listitem" format="counter">TEXTCONTENT</xref>.</t>
<t>(title, TEXTCONTENT) see <xref target="listitem" format="title">TEXTCONTENT</xref>.</t>
<t>(none, TEXTCONTENT) see <xref target="listitem" format="none">TEXTCONTENT</xref>.</t>
</section>
</section>
<section>
Expand Down Expand Up @@ -2621,6 +2622,9 @@ foo = bar
<t>
See <xref target="some.references">references below</xref>.
</t>
<t>
We might also link to <xref target="some.references" format="none">references below</xref> without perturbing text.
</t>
</section>
<section>
<name>To Unnumbered Section</name>
Expand All @@ -2630,6 +2634,9 @@ foo = bar
<t>
See <xref target="contributors">contributors below</xref>.
</t>
<t>
We might also link to <xref target="contributors" format="none">contributors</xref> without perturbing text.
</t>
</section>
</section>
</middle>
Expand Down
520 changes: 260 additions & 260 deletions tests/valid/docfile.html

Large diffs are not rendered by default.

190 changes: 95 additions & 95 deletions tests/valid/draft-miek-test.html

Large diffs are not rendered by default.

184 changes: 92 additions & 92 deletions tests/valid/draft-miek-test.v3.html

Large diffs are not rendered by default.

68 changes: 34 additions & 34 deletions tests/valid/draft-template.html

Large diffs are not rendered by default.

62 changes: 31 additions & 31 deletions tests/valid/draft-template.v3.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Insert an abstract: MANDATORY. This template is for creating an
Internet Draft.
" name="description">
<meta content="xml2rfc 3.13.1" name="generator">
<meta content="xml2rfc 3.14.0" name="generator">
<meta content="template" name="keyword">
<meta content="draft-ietf-xml2rfc-template-05" name="ietf.draft">
<link href="tests/input/draft-template.xml" rel="alternate" type="application/rfc+xml">
Expand Down Expand Up @@ -113,78 +113,78 @@ <h2 id="name-copyright-notice">
</h2>
<nav class="toc"><ul class="compact toc ulBare ulEmpty">
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.1">
<p id="section-toc.1-1.1.1" class="keepWithNext"><a href="#section-1" class="xref">1</a>.  <a href="#name-introduction" class="xref">Introduction</a></p>
<p id="section-toc.1-1.1.1" class="keepWithNext"><a href="#section-1" class="auto internal xref">1</a>.  <a href="#name-introduction" class="internal xref">Introduction</a></p>
<ul class="compact toc ulBare ulEmpty">
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.1.2.1">
<p id="section-toc.1-1.1.2.1.1" class="keepWithNext"><a href="#section-1.1" class="xref">1.1</a>.  <a href="#name-requirements-language" class="xref">Requirements Language</a></p>
<p id="section-toc.1-1.1.2.1.1" class="keepWithNext"><a href="#section-1.1" class="auto internal xref">1.1</a>.  <a href="#name-requirements-language" class="internal xref">Requirements Language</a></p>
</li>
</ul>
</li>
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.2">
<p id="section-toc.1-1.2.1" class="keepWithNext"><a href="#section-2" class="xref">2</a>.  <a href="#name-simple-list" class="xref">Simple List</a></p>
<p id="section-toc.1-1.2.1" class="keepWithNext"><a href="#section-2" class="auto internal xref">2</a>.  <a href="#name-simple-list" class="internal xref">Simple List</a></p>
</li>
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.3">
<p id="section-toc.1-1.3.1"><a href="#section-3" class="xref">3</a>.  <a href="#name-figures" class="xref">Figures</a></p>
<p id="section-toc.1-1.3.1"><a href="#section-3" class="auto internal xref">3</a>.  <a href="#name-figures" class="internal xref">Figures</a></p>
</li>
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.4">
<p id="section-toc.1-1.4.1"><a href="#section-4" class="xref">4</a>.  <a href="#name-subsections-and-tables" class="xref">Subsections and Tables</a></p>
<p id="section-toc.1-1.4.1"><a href="#section-4" class="auto internal xref">4</a>.  <a href="#name-subsections-and-tables" class="internal xref">Subsections and Tables</a></p>
<ul class="compact toc ulBare ulEmpty">
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.4.2.1">
<p id="section-toc.1-1.4.2.1.1"><a href="#section-4.1" class="xref">4.1</a>.  <a href="#name-a-subsection" class="xref">A Subsection</a></p>
<p id="section-toc.1-1.4.2.1.1"><a href="#section-4.1" class="auto internal xref">4.1</a>.  <a href="#name-a-subsection" class="internal xref">A Subsection</a></p>
</li>
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.4.2.2">
<p id="section-toc.1-1.4.2.2.1"><a href="#section-4.2" class="xref">4.2</a>.  <a href="#name-tables" class="xref">Tables</a></p>
<p id="section-toc.1-1.4.2.2.1"><a href="#section-4.2" class="auto internal xref">4.2</a>.  <a href="#name-tables" class="internal xref">Tables</a></p>
</li>
</ul>
</li>
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.5">
<p id="section-toc.1-1.5.1"><a href="#section-5" class="xref">5</a>.  <a href="#name-more-about-lists" class="xref">More about Lists</a></p>
<p id="section-toc.1-1.5.1"><a href="#section-5" class="auto internal xref">5</a>.  <a href="#name-more-about-lists" class="internal xref">More about Lists</a></p>
<ul class="compact toc ulBare ulEmpty">
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.5.2.1">
<p id="section-toc.1-1.5.2.1.1"><a href="#section-5.1" class="xref">5.1</a>.  <a href="#name-numbering-lists-across-list" class="xref">Numbering Lists across Lists and Sections</a></p>
<p id="section-toc.1-1.5.2.1.1"><a href="#section-5.1" class="auto internal xref">5.1</a>.  <a href="#name-numbering-lists-across-list" class="internal xref">Numbering Lists across Lists and Sections</a></p>
</li>
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.5.2.2">
<p id="section-toc.1-1.5.2.2.1"><a href="#section-5.2" class="xref">5.2</a>.  <a href="#name-where-the-list-numbering-co" class="xref">Where the List Numbering Continues</a></p>
<p id="section-toc.1-1.5.2.2.1"><a href="#section-5.2" class="auto internal xref">5.2</a>.  <a href="#name-where-the-list-numbering-co" class="internal xref">Where the List Numbering Continues</a></p>
</li>
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.5.2.3">
<p id="section-toc.1-1.5.2.3.1"><a href="#section-5.3" class="xref">5.3</a>.  <a href="#name-nested-lists" class="xref">nested lists</a></p>
<p id="section-toc.1-1.5.2.3.1"><a href="#section-5.3" class="auto internal xref">5.3</a>.  <a href="#name-nested-lists" class="internal xref">nested lists</a></p>
</li>
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.5.2.4">
<p id="section-toc.1-1.5.2.4.1"><a href="#section-5.4" class="xref">5.4</a>.  <a href="#name-list-formats" class="xref">List Formats</a></p>
<p id="section-toc.1-1.5.2.4.1"><a href="#section-5.4" class="auto internal xref">5.4</a>.  <a href="#name-list-formats" class="internal xref">List Formats</a></p>
</li>
</ul>
</li>
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.6">
<p id="section-toc.1-1.6.1"><a href="#section-6" class="xref">6</a>.  <a href="#name-example-of-code-or-mib-modu" class="xref">Example of Code or MIB Module To Be Extracted</a></p>
<p id="section-toc.1-1.6.1"><a href="#section-6" class="auto internal xref">6</a>.  <a href="#name-example-of-code-or-mib-modu" class="internal xref">Example of Code or MIB Module To Be Extracted</a></p>
</li>
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.7">
<p id="section-toc.1-1.7.1"><a href="#section-7" class="xref">7</a>.  <a href="#name-acknowledgements" class="xref">Acknowledgements</a></p>
<p id="section-toc.1-1.7.1"><a href="#section-7" class="auto internal xref">7</a>.  <a href="#name-acknowledgements" class="internal xref">Acknowledgements</a></p>
</li>
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.8">
<p id="section-toc.1-1.8.1"><a href="#section-8" class="xref">8</a>.  <a href="#name-iana-considerations" class="xref">IANA Considerations</a></p>
<p id="section-toc.1-1.8.1"><a href="#section-8" class="auto internal xref">8</a>.  <a href="#name-iana-considerations" class="internal xref">IANA Considerations</a></p>
</li>
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.9">
<p id="section-toc.1-1.9.1"><a href="#section-9" class="xref">9</a>.  <a href="#name-security-considerations" class="xref">Security Considerations</a></p>
<p id="section-toc.1-1.9.1"><a href="#section-9" class="auto internal xref">9</a>.  <a href="#name-security-considerations" class="internal xref">Security Considerations</a></p>
</li>
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.10">
<p id="section-toc.1-1.10.1"><a href="#section-10" class="xref">10</a>. <a href="#name-references" class="xref">References</a></p>
<p id="section-toc.1-1.10.1"><a href="#section-10" class="auto internal xref">10</a>. <a href="#name-references" class="internal xref">References</a></p>
<ul class="compact toc ulBare ulEmpty">
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.10.2.1">
<p id="section-toc.1-1.10.2.1.1"><a href="#section-10.1" class="xref">10.1</a>.  <a href="#name-normative-references" class="xref">Normative References</a></p>
<p id="section-toc.1-1.10.2.1.1"><a href="#section-10.1" class="auto internal xref">10.1</a>.  <a href="#name-normative-references" class="internal xref">Normative References</a></p>
</li>
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.10.2.2">
<p id="section-toc.1-1.10.2.2.1"><a href="#section-10.2" class="xref">10.2</a>.  <a href="#name-informative-references" class="xref">Informative References</a></p>
<p id="section-toc.1-1.10.2.2.1"><a href="#section-10.2" class="auto internal xref">10.2</a>.  <a href="#name-informative-references" class="internal xref">Informative References</a></p>
</li>
</ul>
</li>
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.11">
<p id="section-toc.1-1.11.1"><a href="#appendix-A" class="xref">Appendix A</a>.  <a href="#name-additional-stuff" class="xref">Additional Stuff</a></p>
<p id="section-toc.1-1.11.1"><a href="#appendix-A" class="auto internal xref">Appendix A</a>.  <a href="#name-additional-stuff" class="internal xref">Additional Stuff</a></p>
</li>
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.12">
<p id="section-toc.1-1.12.1"><a href="#appendix-B" class="xref"></a><a href="#name-contributors" class="xref">Contributors</a></p>
<p id="section-toc.1-1.12.1"><a href="#appendix-B" class="auto internal xref"></a><a href="#name-contributors" class="internal xref">Contributors</a></p>
</li>
<li class="compact toc ulBare ulEmpty" id="section-toc.1-1.13">
<p id="section-toc.1-1.13.1"><a href="#appendix-C" class="xref"></a><a href="#name-authors-addresses" class="xref">Authors' Addresses</a></p>
<p id="section-toc.1-1.13.1"><a href="#appendix-C" class="auto internal xref"></a><a href="#name-authors-addresses" class="internal xref">Authors' Addresses</a></p>
</li>
</ul>
</nav>
Expand All @@ -194,14 +194,14 @@ <h2 id="name-copyright-notice">
<h2 id="name-introduction">
<a href="#section-1" class="section-number selfRef">1. </a><a href="#name-introduction" class="section-name selfRef">Introduction</a>
</h2>
<p id="section-1-1">The original specification of xml2rfc format is in <span><a href="#RFC2629" class="xref">RFC 2629</a> [<a href="#RFC2629" class="xref">RFC2629</a>]</span>.<a href="#section-1-1" class="pilcrow">¶</a></p>
<p id="section-1-1">The original specification of xml2rfc format is in <span><a href="#RFC2629" class="internal xref">RFC 2629</a> [<a href="#RFC2629" class="cite xref">RFC2629</a>]</span>.<a href="#section-1-1" class="pilcrow">¶</a></p>
<section id="section-1.1">
<h3 id="name-requirements-language">
<a href="#section-1.1" class="section-number selfRef">1.1. </a><a href="#name-requirements-language" class="section-name selfRef">Requirements Language</a>
</h3>
<p id="section-1.1-1">The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in <span><a href="#RFC2119" class="xref">RFC 2119</a> [<a href="#RFC2119" class="xref">RFC2119</a>]</span>.<a href="#section-1.1-1" class="pilcrow">¶</a></p>
document are to be interpreted as described in <span><a href="#RFC2119" class="internal xref">RFC 2119</a> [<a href="#RFC2119" class="cite xref">RFC2119</a>]</span>.<a href="#section-1.1-1" class="pilcrow">¶</a></p>
</section>
</section>
<div id="simple_list">
Expand Down Expand Up @@ -240,7 +240,7 @@ <h2 id="name-figures">
</div>
<figcaption><a href="#figure-1" class="selfRef">Figure 1</a></figcaption></figure>
</div>
<p id="section-3-4" class="keepWithPrevious">Cross-references allowed in pre- and postamble. <span>[<a href="#min_ref" class="xref">min_ref</a>]</span>.<a href="#section-3-4" class="pilcrow">¶</a></p>
<p id="section-3-4" class="keepWithPrevious">Cross-references allowed in pre- and postamble. <span>[<a href="#min_ref" class="cite xref">min_ref</a>]</span>.<a href="#section-3-4" class="pilcrow">¶</a></p>
<p id="section-3-5">The CDATA means you don't need to escape meta-characters (especially
&lt; (&amp;lt;) and &amp; (&amp;amp;)) but is not essential.
Figures may also have a title attribute but it won't be displayed unless
Expand Down Expand Up @@ -782,8 +782,8 @@ <h2 id="name-acknowledgements">
<p id="section-7-1">This template was derived from an initial version written by Pekka
Savola and contributed by him to the xml2rfc project.<a href="#section-7-1" class="pilcrow">¶</a></p>
<p id="section-7-2">
This document is part of a plan to make xml2rfc indispensable <span>[<a href="#DOMINATION" class="xref">DOMINATION</a>]</span>.
This document may be shared as needed <span>[<a href="#SHARING" class="xref">SHARING</a>]</span>. If necessary, appeal to <span>[<a href="#DOI_10.1145_2975159" class="xref">DOI_10.1145_2975159</a>]</span>.<a href="#section-7-2" class="pilcrow">¶</a></p>
This document is part of a plan to make xml2rfc indispensable <span>[<a href="#DOMINATION" class="cite xref">DOMINATION</a>]</span>.
This document may be shared as needed <span>[<a href="#SHARING" class="cite xref">SHARING</a>]</span>. If necessary, appeal to <span>[<a href="#DOI_10.1145_2975159" class="cite xref">DOI_10.1145_2975159</a>]</span>.<a href="#section-7-2" class="pilcrow">¶</a></p>
</section>
</div>
<div id="IANA">
Expand All @@ -793,8 +793,8 @@ <h2 id="name-iana-considerations">
</h2>
<p id="section-8-1">This memo includes no request to IANA.<a href="#section-8-1" class="pilcrow">¶</a></p>
<p id="section-8-2">All drafts are required to have an IANA considerations section (see
<span><a href="#I-D.narten-iana-considerations-rfc2434bis" class="xref">the update of
RFC 2434</a> [<a href="#I-D.narten-iana-considerations-rfc2434bis" class="xref">I-D.narten-iana-considerations-rfc2434bis</a>]</span> for a guide). If the draft does not require IANA to do
<span><a href="#I-D.narten-iana-considerations-rfc2434bis" class="internal xref">the update of
RFC 2434</a> [<a href="#I-D.narten-iana-considerations-rfc2434bis" class="cite xref">I-D.narten-iana-considerations-rfc2434bis</a>]</span> for a guide). If the draft does not require IANA to do
anything, the section contains an explicit statement that this is the
case (as above). If there are no requirements for IANA, the section will
be removed during conversion into an RFC by the RFC Editor.<a href="#section-8-2" class="pilcrow">¶</a></p>
Expand All @@ -806,7 +806,7 @@ <h2 id="name-security-considerations">
<a href="#section-9" class="section-number selfRef">9. </a><a href="#name-security-considerations" class="section-name selfRef">Security Considerations</a>
</h2>
<p id="section-9-1">All drafts are required to have a security considerations section.
See <span><a href="#RFC3552" class="xref">RFC 3552</a> [<a href="#RFC3552" class="xref">RFC3552</a>]</span> for a guide.<a href="#section-9-1" class="pilcrow">¶</a></p>
See <span><a href="#RFC3552" class="internal xref">RFC 3552</a> [<a href="#RFC3552" class="cite xref">RFC3552</a>]</span> for a guide.<a href="#section-9-1" class="pilcrow">¶</a></p>
</section>
</div>
<section id="section-10">
Expand Down
11 changes: 9 additions & 2 deletions tests/valid/draft-v3-features.prepped.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<rfc version="3" category="exp" docName="draft-v3-features" indexInclude="true" ipr="trust200902" prepTime="2022-08-04T04:40:47" scripts="Cherokee,Common,Cyrillic,Greek,Latin" sortRefs="true" submissionType="independent" symRefs="true" tocDepth="3" tocInclude="true">
<!-- xml2rfc v2v3 conversion 3.13.1 -->
<rfc version="3" category="exp" docName="draft-v3-features" indexInclude="true" ipr="trust200902" prepTime="2022-08-18T03:12:18" scripts="Cherokee,Common,Cyrillic,Greek,Latin" sortRefs="true" submissionType="independent" symRefs="true" tocDepth="3" tocInclude="true">
<!-- xml2rfc v2v3 conversion 3.14.0 -->



Expand Down Expand Up @@ -650,6 +650,7 @@
<t indent="0" pn="section-4.6-4">(default, TEXTCONTENT) see <xref target="listitem" format="default" sectionFormat="of" derivedContent="Section 4.1">TEXTCONTENT</xref>.</t>
<t indent="0" pn="section-4.6-5">(counter, TEXTCONTENT) see <xref target="listitem" format="counter" sectionFormat="of" derivedContent="4.1">TEXTCONTENT</xref>.</t>
<t indent="0" pn="section-4.6-6">(title, TEXTCONTENT) see <xref target="listitem" format="title" sectionFormat="of" derivedContent="listitem">TEXTCONTENT</xref>.</t>
<t indent="0" pn="section-4.6-7">(none, TEXTCONTENT) see <xref target="listitem" format="none" sectionFormat="of" derivedContent="">TEXTCONTENT</xref>.</t>
</section>
</section>
<section numbered="true" removeInRFC="false" toc="include" pn="section-5">
Expand Down Expand Up @@ -3898,6 +3899,9 @@ foo = bar
<t indent="0" pn="section-11.3-2">
See <xref target="some.references" format="default" sectionFormat="of" derivedContent="Section 12">references below</xref>.
</t>
<t indent="0" pn="section-11.3-3">
We might also link to <xref target="some.references" format="none" sectionFormat="of" derivedContent="">references below</xref> without perturbing text.
</t>
</section>
<section numbered="true" removeInRFC="false" toc="include" pn="section-11.4">
<name slugifiedName="name-to-unnumbered-section">To Unnumbered Section</name>
Expand All @@ -3907,6 +3911,9 @@ foo = bar
<t indent="0" pn="section-11.4-2">
See <xref target="contributors" format="default" sectionFormat="of" derivedContent="Appendix &quot;Contributors&quot;">contributors below</xref>.
</t>
<t indent="0" pn="section-11.4-3">
We might also link to <xref target="contributors" format="none" sectionFormat="of" derivedContent="">contributors</xref> without perturbing text.
</t>
</section>
</section>
</middle>
Expand Down
6 changes: 6 additions & 0 deletions tests/valid/draft-v3-features.text
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,8 @@ Table of Contents

(title, TEXTCONTENT) see TEXTCONTENT (listitem).

(none, TEXTCONTENT) see TEXTCONTENT.

5. <blockquote>

Let's cite:
Expand Down Expand Up @@ -1342,12 +1344,16 @@ Table of Contents

See references below (Section 12).

We might also link to references below without perturbing text.

11.4. To Unnumbered Section

See Appendix "Contributors", where the title is "Contributors".

See contributors below (Appendix "Contributors").

We might also link to contributors without perturbing text.

12. Some References

[0REFTEST] Reschke, J., "Reference Test", additional prose goes
Expand Down
Loading