]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
docs: Add <rfc> tag for RFC links — renders to www.rfc-editor.org URLs on build
authorRich Bowen <rbowen@apache.org>
Wed, 29 Apr 2026 15:21:03 +0000 (15:21 +0000)
committerRich Bowen <rbowen@apache.org>
Wed, 29 Apr 2026 15:21:03 +0000 (15:21 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1933500 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/style/common.dtd
docs/manual/style/xsl/common.xsl
docs/manual/style/xsl/nroff.xsl

index 8402f9e36e27f1e62ef082f291ed3f02b1d00754..08ead9d3c083abbe3622f77b5bbccf70a038610d 100644 (file)
@@ -42,7 +42,7 @@
 <!-- Generic tag entities -->
 
 <!ENTITY % inlinetags "em | strong | code | a | br | directive | module |
-program | img | cite | q | dfn | var | transnote | glossary | phonetic | since">
+program | img | cite | q | dfn | var | transnote | glossary | phonetic | since | rfc">
 
 <!ENTITY % blocktags "p | example | note | table | ul | ol | dl | pre | 
 highlight | blockquote">
@@ -201,3 +201,9 @@ highlight | blockquote">
      describes a pronunciation -->
 <!ELEMENT phonetic (#PCDATA)>
 
+<!-- The rfc element creates a link to an RFC at www.rfc-editor.org.
+     Content is the RFC number (e.g. 7230). Optional section attribute
+     adds a fragment anchor (e.g. section="14.24"). -->
+<!ELEMENT rfc (#PCDATA)>
+<!ATTLIST rfc section CDATA #IMPLIED>
+
index 718f2b3e8e817ced981df3e1faa7e1358e6bea5c..29af2f805792c4b249735877c835a619569b5bd2 100644 (file)
@@ -1222,6 +1222,26 @@ if (typeof(prettyPrint) !== 'undefined') {
 <!-- /glossary -->
 
 <!-- ==================================================================== -->
+<!-- link to an RFC at www.rfc-editor.org                                 -->
+<!-- ==================================================================== -->
+<xsl:template match="rfc">
+  <xsl:variable name="rfcnum">
+    <xsl:value-of select="normalize-space(.)"/>
+  </xsl:variable>
+
+  <xsl:variable name="rfcurl">
+    <xsl:text>https://www.rfc-editor.org/rfc/rfc</xsl:text>
+    <xsl:value-of select="$rfcnum"/>
+    <xsl:if test="@section">
+      <xsl:text>#section-</xsl:text>
+      <xsl:value-of select="@section"/>
+    </xsl:if>
+  </xsl:variable>
+
+  <a href="{$rfcurl}">RFC <xsl:value-of select="$rfcnum"/></a>
+</xsl:template>
+<!-- /rfc -->
+
 <!-- Filter &#160; in text() nodes.                                       -->
 <!-- In some environments this character won't be transformed correctly,  -->
 <!-- so we just write it explicitly as "&nbsp;" into the output.         -->
index 4c68ce8a5e2d4af32003c17dd97f48e583c27324..de3a3ccdc8ed6a6fd5356249c4d533ba11f16667 100644 (file)
@@ -373,7 +373,7 @@ FATAL: only tables with two (2) columns are supported.
 <!-- ==================================================================== -->
 <!-- pass through content                                                 -->
 <!-- ==================================================================== -->
-<xsl:template match="a|module|table|program|glossary|highlight">
+<xsl:template match="a|module|table|program|glossary|highlight|rfc">
 <xsl:apply-templates />
 </xsl:template>