httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n.@apache.org
Subject svn commit: r1044550 - in /httpd/httpd/branches/2.0.x/docs/manual/style/xsl: common.xsl directiveindex.xsl quickreference.xsl synopsis.xsl
Date Sat, 11 Dec 2010 00:20:22 GMT
Author: nd
Date: Sat Dec 11 00:20:22 2010
New Revision: 1044550

URL: http://svn.apache.org/viewvc?rev=1044550&view=rev
Log:
merge directive output changes from 2.2

Modified:
    httpd/httpd/branches/2.0.x/docs/manual/style/xsl/common.xsl
    httpd/httpd/branches/2.0.x/docs/manual/style/xsl/directiveindex.xsl
    httpd/httpd/branches/2.0.x/docs/manual/style/xsl/quickreference.xsl
    httpd/httpd/branches/2.0.x/docs/manual/style/xsl/synopsis.xsl

Modified: httpd/httpd/branches/2.0.x/docs/manual/style/xsl/common.xsl
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.0.x/docs/manual/style/xsl/common.xsl?rev=1044550&r1=1044549&r2=1044550&view=diff
==============================================================================
--- httpd/httpd/branches/2.0.x/docs/manual/style/xsl/common.xsl (original)
+++ httpd/httpd/branches/2.0.x/docs/manual/style/xsl/common.xsl Sat Dec 11 00:20:22 2010
@@ -78,6 +78,17 @@
 <!-- it may be desired to open external targets in a new window -->
 <xsl:variable name="ext-target" select="boolean($is-chm)" />
 
+<xsl:template match="/">
+    <xsl:if test="not($metafile/@reference)">
+        <xsl:message terminate="yes">
+            Invalid metafile. Probably your build system is not up-to-date.
+            Get a current version and try again.
+        </xsl:message>
+    </xsl:if>
+    <xsl:apply-templates />
+</xsl:template>
+
+
 <!-- #################################################################### -->
 <!-- Utility templates for constructing pages                             -->
 <!-- #################################################################### -->

Modified: httpd/httpd/branches/2.0.x/docs/manual/style/xsl/directiveindex.xsl
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.0.x/docs/manual/style/xsl/directiveindex.xsl?rev=1044550&r1=1044549&r2=1044550&view=diff
==============================================================================
--- httpd/httpd/branches/2.0.x/docs/manual/style/xsl/directiveindex.xsl (original)
+++ httpd/httpd/branches/2.0.x/docs/manual/style/xsl/directiveindex.xsl Sat Dec 11 00:20:22
2010
@@ -36,9 +36,14 @@
         <xsl:call-template name="top"/>
 
         <xsl:variable name="directives"
-            select="document(document($allmodules)/modulefilelist/modulefile)
-                        /modulesynopsis[status!='Obsolete']
-                        /directivesynopsis[not(@location)]" />
+            select="document(
+                        document(document(document(
+                            $allmodules)/modulefilelist/modulefile
+                        )/*/@metafile)
+                        /metafile/@reference
+                    )
+                    /modulesynopsis[status!='Obsolete']
+                    /directivesynopsis[not(@location)]" />
 
         <!-- collect the start letters -->
         <xsl:variable name="start-letters">

Modified: httpd/httpd/branches/2.0.x/docs/manual/style/xsl/quickreference.xsl
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.0.x/docs/manual/style/xsl/quickreference.xsl?rev=1044550&r1=1044549&r2=1044550&view=diff
==============================================================================
--- httpd/httpd/branches/2.0.x/docs/manual/style/xsl/quickreference.xsl (original)
+++ httpd/httpd/branches/2.0.x/docs/manual/style/xsl/quickreference.xsl Sat Dec 11 00:20:22
2010
@@ -47,8 +47,14 @@
 
         <div id="directive-ref">
             <xsl:variable name="directives"
-                select="document(document($allmodules)/modulefilelist/modulefile)
+                select="document(document(document(
+                            document($allmodules)/modulefilelist/modulefile
+                        )/*/@metafile)/metafile/@reference)
                         /modulesynopsis/directivesynopsis[not(@location)]" />
+            <xsl:variable name="modules"
+                select="document(
+                            document($allmodules)/modulefilelist/modulefile
+                        )/modulesynopsis" />
 
             <xsl:variable name="start-letters">
                 <xsl:call-template name="directive-startletters">
@@ -173,6 +179,7 @@
                 <xsl:with-param name="letters-todo" select="$start-letters" />
                 <xsl:with-param name="offset" select="number(0)" />
                 <xsl:with-param name="directives" select="$directives" />
+                <xsl:with-param name="modules" select="$modules" />
             </xsl:call-template>
             </table>
         </div>&lf; <!-- /#directive-ref -->
@@ -192,6 +199,7 @@
 <xsl:param name="letters-todo" />
 <xsl:param name="offset" />
 <xsl:param name="directives" />
+<xsl:param name="modules" />
 
 <xsl:variable name="letter" select="substring($letters-todo, 1, 1)" />
 
@@ -200,14 +208,63 @@
                                           $lowercase,$uppercase)]">
 <xsl:sort select="name" />
 
+    <xsl:choose>
+    <xsl:when test="$modules[name=current()/../name]
+                    /directivesynopsis[name=current()/name]">
+        <xsl:call-template name="reference-of-letter-loop">
+            <xsl:with-param name="letter" select="$letter" />
+            <xsl:with-param name="directive"
+                select="$modules[name=current()/../name]
+                        /directivesynopsis[name=current()/name]" />
+            <xsl:with-param name="offset" select="$offset" />
+            <xsl:with-param name="position" select="position()" />
+        </xsl:call-template>
+    </xsl:when>
+    <xsl:otherwise>
+        <xsl:call-template name="reference-of-letter-loop">
+            <xsl:with-param name="letter" select="$letter" />
+            <xsl:with-param name="directive" select="." />
+            <xsl:with-param name="offset" select="$offset" />
+            <xsl:with-param name="position" select="position()" />
+        </xsl:call-template>
+    </xsl:otherwise>
+    </xsl:choose>
+
+</xsl:for-each> <!-- /directives -->
+
+<!-- call next letter, if there is -->
+<xsl:if test="string-length($letters-todo) &gt; 1">
+    <xsl:call-template name="reference-of-letter">
+        <xsl:with-param name="letters-todo"
+            select="substring($letters-todo, 2)" />
+        <xsl:with-param name="offset"
+            select="(count($directives[$letter=translate(substring(
+                        normalize-space(name), 1, 1),
+                        $lowercase, $uppercase)])
+                    + $offset) mod 2" />
+        <xsl:with-param name="directives" select="$directives" />
+        <xsl:with-param name="modules" select="$modules" />
+    </xsl:call-template>
+</xsl:if>
+</xsl:template>
+<!-- /reference-of-letter -->
+
+
+<xsl:template name="reference-of-letter-loop">
+<xsl:param name="directive" />
+<xsl:param name="letter" />
+<xsl:param name="offset" />
+<xsl:param name="position" />
+
     <tr>
-        <xsl:if test="position() mod 2 = $offset">
+        <xsl:if test="$position mod 2 = $offset">
             <xsl:attribute name="class">odd</xsl:attribute>
         </xsl:if>
 
         <td>
-            <a href="{../name}.html#{translate(name, $uppercase, $lowercase)}">
-                <xsl:if test="position()=1">
+            <a href="{$directive/../name}.html#{
+                        translate($directive/name, $uppercase, $lowercase)}">
+                <xsl:if test="$position = 1">
                     <xsl:attribute name="id">
                         <xsl:value-of select="$letter" />
                     </xsl:attribute>
@@ -216,7 +273,7 @@
                     </xsl:attribute>
                 </xsl:if>
 
-                <xsl:apply-templates select="syntax" />
+                <xsl:apply-templates select="$directive/syntax" />
             </a>
         </td>
         <td>
@@ -227,13 +284,14 @@
             <!-- (add the + character instead)                        -->
             <xsl:variable name="default">
                 <xsl:choose>
-                <xsl:when test="count(default[count(br) &gt; 0]) &gt; 0">
+                <xsl:when test="count($directive/default[count(br) &gt; 0])
+                                &gt; 0">
                     <xsl:value-of
-                        select="default/child::node()
+                        select="$directive/default/child::node()
                                 [count(preceding-sibling::*) = 0]" />
                 </xsl:when>
                 <xsl:otherwise>
-                    <xsl:value-of select="default"/>
+                    <xsl:value-of select="$directive/default"/>
                 </xsl:otherwise>
                 </xsl:choose>
             </xsl:variable>
@@ -242,43 +300,45 @@
                                   ' '), name),1,20)" />
             <xsl:if test="string-length(substring-after(concat($default, ' '),
                               name)) &gt; 20
-                          or count(default[count(br) &gt; 0]) &gt; 0">
+                          or count($directive/default[count(br) &gt; 0])
+                             &gt; 0">
                 <xsl:text> +</xsl:text>
             </xsl:if>
         </td>
         <td>
-            <xsl:if test="contextlist/context
+            <xsl:if test="$directive/contextlist/context
                           [normalize-space(.)='server config']">
                 <xsl:value-of select="$message[@id='serverconfig']/@letter"/>
             </xsl:if>
-            <xsl:if test="contextlist/context
+            <xsl:if test="$directive/contextlist/context
                           [normalize-space(.)='virtual host']">
                 <xsl:value-of select="$message[@id='virtualhost']/@letter"/>
             </xsl:if>
-            <xsl:if test="contextlist/context
+            <xsl:if test="$directive/contextlist/context
                           [normalize-space(.)='directory']">
                 <xsl:value-of select="$message[@id='directory']/@letter"/>
             </xsl:if>
-            <xsl:if test="contextlist/context
+            <xsl:if test="$directive/contextlist/context
                           [normalize-space(.)='.htaccess']">
                 <xsl:value-of select="$message[@id='htaccess']/@letter"/>
             </xsl:if>
         </td>
         <td>
             <xsl:variable name="status" select="translate(
-                ../status, $uppercase, $lowercase)"/>
+                $directive/../status, $uppercase, $lowercase)"/>
             <xsl:value-of select="$message[@id=$status]/@letter"/>
         </td>
     </tr>
     <tr>
-        <xsl:if test="position() mod 2 = $offset">
+        <xsl:if test="$position mod 2 = $offset">
             <xsl:attribute name="class">odd</xsl:attribute>
         </xsl:if>
 
         <td colspan="4" class="descr">
             <xsl:choose>
-            <xsl:when test="string-length(normalize-space(description)) &gt; 0">
-                <xsl:apply-templates select="description"/>
+            <xsl:when test="string-length(normalize-space(
+                                $directive/description)) &gt; 0">
+                <xsl:apply-templates select="$directive/description"/>
             </xsl:when>
             <xsl:otherwise>
                 <xsl:text>-</xsl:text>
@@ -286,21 +346,6 @@
             </xsl:choose>
         </td>
     </tr>&lf;
-</xsl:for-each> <!-- /directives -->
-
-<!-- call next letter, if there is -->
-<xsl:if test="string-length($letters-todo) &gt; 1">
-    <xsl:call-template name="reference-of-letter">
-        <xsl:with-param name="letters-todo"
-            select="substring($letters-todo, 2)" />
-        <xsl:with-param name="offset"
-            select="(count($directives[$letter=translate(substring(
-                    normalize-space(name), 1, 1), $lowercase, $uppercase)])
-                    + $offset) mod 2" />
-        <xsl:with-param name="directives" select="$directives" />
-    </xsl:call-template>
-</xsl:if>
 </xsl:template>
-<!-- /reference-of-letter -->
 
 </xsl:stylesheet>

Modified: httpd/httpd/branches/2.0.x/docs/manual/style/xsl/synopsis.xsl
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.0.x/docs/manual/style/xsl/synopsis.xsl?rev=1044550&r1=1044549&r2=1044550&view=diff
==============================================================================
--- httpd/httpd/branches/2.0.x/docs/manual/style/xsl/synopsis.xsl (original)
+++ httpd/httpd/branches/2.0.x/docs/manual/style/xsl/synopsis.xsl Sat Dec 11 00:20:22 2010
@@ -162,9 +162,12 @@
                         </h3>&lf;
 
                         <xsl:choose>
-                        <xsl:when test="directivesynopsis">
+                        <xsl:when test="document($metafile/@reference)
+                                        /modulesynopsis/directivesynopsis">
                             <ul id="toc">&lf;
-                            <xsl:for-each select="directivesynopsis">
+                            <xsl:for-each
+                            select="document($metafile/@reference)
+                                    /modulesynopsis/directivesynopsis">
                             <xsl:sort select="name" />
                                 <xsl:variable name="lowername"
                                     select="translate(name, $uppercase,
@@ -249,10 +252,23 @@
             <!-- Sections of documentation about the module as a whole -->
             <xsl:apply-templates select="section" />&lf;
 
+            <xsl:variable name="this" select="directivesynopsis" />
+
             <!-- Directive documentation -->
-            <xsl:apply-templates select="directivesynopsis">
-                <xsl:sort select="name" />
-            </xsl:apply-templates>
+            <xsl:for-each select="document($metafile/@reference)
+                                  /modulesynopsis/directivesynopsis">
+            <xsl:sort select="name" />
+                <xsl:choose>
+                <xsl:when test="$this[name=current()/name]">
+                    <xsl:apply-templates select="$this[name=current()/name]" />
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:apply-templates select=".">
+                        <xsl:with-param name="translated" select="'no'" />
+                    </xsl:apply-templates>
+                </xsl:otherwise>
+                </xsl:choose>
+            </xsl:for-each>
         </div>&lf; <!-- /#page-content -->
 
         <xsl:call-template name="bottom" />&lf;
@@ -266,6 +282,8 @@
 <!-- Directivesynopsis                                                    -->
 <!-- ==================================================================== -->
 <xsl:template match="directivesynopsis">
+<xsl:param name="translated" select="'yes'" />
+
 <xsl:if test="not(@location)">
     <xsl:call-template name="toplink" />&lf;
 
@@ -418,7 +436,15 @@
         </xsl:if>&lf;
         </table>
 
-        <xsl:apply-templates select="usage" />&lf;
+        <xsl:choose>
+        <xsl:when test="$translated = 'yes'">
+            <xsl:apply-templates select="usage" />&lf;
+        </xsl:when>
+        <xsl:otherwise>
+            <p>The documentation of this directive was not translated yet.
+            Please refer to the English version.</p>
+        </xsl:otherwise>
+        </xsl:choose>
 
         <xsl:if test="seealso">
             <h3>



Mime
View raw message