]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
common|synopsis.xsl: rename directive type=sections id generation
authorLuca Toscano <elukey@apache.org>
Wed, 16 Aug 2017 13:40:12 +0000 (13:40 +0000)
committerLuca Toscano <elukey@apache.org>
Wed, 16 Aug 2017 13:40:12 +0000 (13:40 +0000)
This commits is a follow up of r1805189 and it is meant
to allow directives with the same name but different type
to coexist in the same document without triggering errors
while executing validate-xhtml.

For example: mod_md.xml recently introduced the following:

* ManagedDomain
* <ManagedDomain> (this one is type=section)

In my opinion this is a perfectly valid use case and it should
be allowed/handled correctly by the doc generation process/validation.

In order to avoid clashing the directive ids will get a suffix
called "section" if type=section will be present as param.

Quicklinks, <directive> links have been updated to the new
scheme to avoid dandling pointers in the doc.

Comments/reviews are welcome, if I left something behind
please let me know.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1805193 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/style/xsl/common.xsl
docs/manual/style/xsl/synopsis.xsl

index 505d113a5952233ff594edf3dcc398b0fa92cad2..e0e21bf77f152ad1aad64a43a2464e424cfa99af 100644 (file)
@@ -887,12 +887,12 @@ if (typeof(prettyPrint) !== 'undefined') {
         <xsl:variable name="lowerdirective">
             <xsl:choose>
             <xsl:when test="@name">
-                <xsl:value-of select="normalize-space(translate(@name,
-                                        $uppercase, $lowercase))" />
+                <xsl:value-of select="normalize-space(concat(translate(@name,
+                                        $uppercase, $lowercase),@type))" />
             </xsl:when>
             <xsl:otherwise>
-                <xsl:value-of select="normalize-space(translate(.,
-                                        $uppercase, $lowercase))" />
+                <xsl:value-of select="normalize-space(concat(translate(.,
+                                        $uppercase, $lowercase),@type))" />
             </xsl:otherwise>
             </xsl:choose>
         </xsl:variable>
index fcaa0198a3abf079c0e5ddb58ec87df07c2ba78b..00fb6fb79260a19ce007e0cc10180a277e5fbe14 100644 (file)
                                     /modulesynopsis/directivesynopsis">
                             <xsl:sort select="name" />
                                 <xsl:variable name="lowername"
-                                    select="translate(name, $uppercase,
-                                                      $lowercase)" />
+                                    select="concat(translate(name, $uppercase,
+                                                   $lowercase),@type)" />
 
                                 <xsl:choose>
                                 <xsl:when test="not(@location)">
     <xsl:call-template name="toplink" />&lf;
 
     <div class="directive-section">
+        <!-- Concatenate the Directive name with its type to allow
+             a directive to be referenced multiple times
+             with different types -->
         <xsl:variable name="lowername"
-            select="translate(name, $uppercase, $lowercase)" />
-
+            select="concat(translate(name, $uppercase, $lowercase),@type)" />
+        <xsl:variable name="directivename" select="concat(name,@type)" />
         <!-- Directive heading gets both mixed case and lowercase      -->
         <!-- anchors, and includes lt/gt only for "section" directives -->
         <h2>
                 </xsl:otherwise>
                 </xsl:choose>
 
-                <a id="{name}" name="{name}">
+                <a id="{$directivename}" name="{$directivename}">
                     <xsl:if test="@type='section'">&lt;</xsl:if>
                     <xsl:value-of select="name" />
                     <xsl:if test="@type='section'">&gt;</xsl:if>
             </xsl:when>
 
             <xsl:otherwise>
-                <a id="{name}" name="{name}">
+                <a id="{$directivename}" name="{$directivename}">
                     <xsl:if test="@type='section'">&lt;</xsl:if>
                     <xsl:value-of select="name" />
                     <xsl:if test="@type='section'">&gt;</xsl:if>