]> granicus.if.org Git - apache/blobdiff - docs/manual/style/xsl/synopsis.xsl
Help doc writer to spot places where:
[apache] / docs / manual / style / xsl / synopsis.xsl
index 7a23051f9de4851ce0d2a3fc967d0be7c4abb42c..1b464a7324b29bc4c9f5dee45dfe46482fcf350e 100644 (file)
@@ -19,6 +19,7 @@
 
 <!DOCTYPE xsl:stylesheet [
     <!ENTITY lf SYSTEM "util/lf.xml">
+    <!ENTITY para SYSTEM "util/para.xml">
 ]>
 <xsl:stylesheet version="1.0"
               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
             <xsl:if test="not($is-chm) or seealso">
                 <div id="quickview">
                     <xsl:if test="not($is-chm)">
+                        <xsl:if test="section">
+                            <h3>
+                                <xsl:value-of select="$message
+                                                      [@id='topics']" />
+                            </h3>&lf;
+
+                            <ul id="topics">&lf;
+                            <xsl:apply-templates
+                                select="section" mode="index" />
+                            </ul>
+                        </xsl:if>
+
                         <h3 class="directives">
                             <xsl:value-of select="$message
                                                   [@id='directives']" />
                                     /modulesynopsis/directivesynopsis">
                             <xsl:sort select="name" />
                                 <xsl:variable name="lowername"
-                                    select="translate(name, $uppercase,
-                                                      $lowercase)" />
+                                    select="concat(translate(name, $uppercase,
+                                                   $lowercase),@idtype)" />
 
                                 <xsl:choose>
                                 <xsl:when test="not(@location)">
                             </p>&lf;
                         </xsl:otherwise>
                         </xsl:choose>
-
-                        <xsl:if test="section">
-                            <h3>
-                                <xsl:value-of select="$message
-                                                      [@id='topics']" />
-                            </h3>&lf;
-
-                            <ul id="topics">&lf;
-                            <xsl:apply-templates
-                                select="section" mode="index" />
-                            </ul>
-                        </xsl:if>
                     </xsl:if> <!-- /!is-chm -->
 
-                    <xsl:if test="seealso">
-                           <h3>
+                    <h3>
+                       <xsl:value-of select="$message[@id='foundabug']" />
+                    </h3>
+                    <ul class="seealso">
+                        <!-- Bugzilla mpm components are prefixed with
+                            'mpm_', meanwhile the page name in the docs do
+                            not contain it. For example, Bugzilla has
+                            the 'mpm_event' component and the doc has the
+                            'event' page. This creates an inconsistency
+                            in the URL generation, fixed by the following
+                            check. -->
+                        <xsl:variable name="bugzilla_prefix">
+                            <xsl:choose>
+                                <xsl:when test="name='worker' or name='event'
+                                                or name='prefork'">
+                                    <xsl:value-of select="string('mpm_')"/>
+                                </xsl:when>
+                            </xsl:choose>
+                        </xsl:variable>
+                        <li>
+                            <!-- The link below is not dynamic and points only
+                                 to the 2.4 release since it makes sense to keep
+                                 it as reference even for trunk. -->
+                            <a href="https://www.apache.org/dist/httpd/CHANGES_2.4">
+                                <xsl:value-of
+                                    select="$message[@id='httpdchangelog']" />
+                            </a>
+                        </li>
+                        <li>
+                            <!-- The line below is not splitted in multiple
+                                 lines to avoid rendering a broken URL. -->
+                            <a href="https://bz.apache.org/bugzilla/buglist.cgi?bug_status=__open__&amp;list_id=144532&amp;product=Apache%20httpd-2&amp;query_format=specific&amp;order=changeddate%20DESC%2Cpriority%2Cbug_severity&amp;component={$bugzilla_prefix}{name}">
+                                <xsl:value-of
+                                    select="$message[@id='httpdknownissues']" />
+                            </a>
+                        </li>
+                        <li>
+                            <!-- The line below is not splitted in multiple
+                                 lines to avoid rendering a broken URL. -->
+                            <a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2&amp;component={$bugzilla_prefix}{name}">
+                                <xsl:value-of
+                                    select="$message[@id='httpdreportabug']" />
+                            </a>
+                        </li>
+                    </ul>
+                    <!-- The seealso section shows links to related documents
+                         explicitly set in .xml docs or simply the comments. -->
+                    <xsl:if test="seealso or not($is-chm or $is-zip or
+                                                $metafile/basename = 'index')">
+                        <h3>
                             <xsl:value-of select="$message
                                                   [@id='seealso']" />
                         </h3>&lf;
                                 <xsl:apply-templates />
                             </li>&lf;
                         </xsl:for-each>
+                        <xsl:if test="not($is-chm or $is-zip or $metafile/basename = 'index')">
+                            <li><a href="#comments_section"><xsl:value-of
+                                    select="$message[@id='comments']" /></a>
+                            </li>
+                        </xsl:if>
                         </ul>
                     </xsl:if>
-                    <xsl:if test="not($is-chm or $is-zip or $metafile/basename = 'index')">
-                    <ul class="seealso">
-                        <li><a href="#comments_section"><xsl:value-of
-                                select="$message[@id='comments']" /></a>
-                        </li>
-                    </ul>
-                    </xsl:if>
                 </div> <!-- /#quickview -->
             </xsl:if>&lf; <!-- have sidebar -->
 
             <xsl:sort select="name" />
                 <xsl:choose>
                 <xsl:when test="$this[name=current()/name]">
-                    <xsl:apply-templates select="$this[name=current()/name]" />
+                    <!-- A directive name is allowed to be repeated if its type
+                         is different. There is currently only one allowed type
+                         to set, namely 'section', that represents
+                         directive/containers like <DirectiveName>.
+                         The following check is needed to avoid rendering
+                         multiple times the same content when a directive name
+                         is repeated.
+                     -->
+                    <xsl:choose>
+                        <xsl:when test="@type='section'">
+                            <xsl:apply-templates select="$this[name=current()/name and @type='section']" />
+                        </xsl:when>
+                        <xsl:otherwise>
+                            <xsl:apply-templates select="$this[name=current()/name and not(@type='section')]" />
+                        </xsl:otherwise>
+                    </xsl:choose>
                 </xsl:when>
                 <xsl:otherwise>
                     <xsl:apply-templates select=".">
     <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),@idtype)" />
+        <xsl:variable name="directivename" select="concat(name,@idtype)" />
         <!-- 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>
                 </a>
             </xsl:otherwise>
             </xsl:choose>
+        <xsl:text> </xsl:text>
+        <a class="permalink" href="#{$lowername}" title="{$message[@id='permalink']}">&para;</a>
         </h2>&lf;
 
         <!-- Directive header -->
 <xsl:when test="normalize-space(.) = '.htaccess'">
     <xsl:value-of select="$message[@id='htaccess']" />
 </xsl:when>
+<xsl:when test="normalize-space(.) = 'proxy section'">
+    <xsl:value-of select="$message[@id='proxy']" />
+</xsl:when>
 <xsl:otherwise> <!-- error -->
     <xsl:message terminate="yes">
         unknown context: <xsl:value-of select="." />