httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n.@apache.org
Subject cvs commit: httpd-2.0/docs/manual/style/xsl/util lf.xml modtrans.xsl tab.xml
Date Thu, 17 Apr 2003 16:34:23 GMT
nd          2003/04/17 09:34:23

  Modified:    docs/manual/style/xsl common.xsl faq.xsl indexpage.xsl
                        manualpage.xsl moduleindex.xsl sitemap.xsl
                        synopsis.xsl
  Added:       docs/manual/style/xsl/util lf.xml modtrans.xsl tab.xml
  Log:
  the html files used for chm compiling differ in detail from our normal
  manual pages. The target format is reflected by the $is-chm variable
  which is used to <if> in and out the interesting parts.
  
  Further add some more utility snippets.
  
  Revision  Changes    Path
  1.29      +106 -36   httpd-2.0/docs/manual/style/xsl/common.xsl
  
  Index: common.xsl
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/style/xsl/common.xsl,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- common.xsl	16 Apr 2003 22:39:36 -0000	1.28
  +++ common.xsl	17 Apr 2003 16:34:22 -0000	1.29
  @@ -36,6 +36,8 @@
     <xsl:include href="quickreference.xsl"/>
     <xsl:include href="faq.xsl"/>
   
  +  <xsl:include href="util/modtrans.xsl"/>
  +
     <!-- make sure, we set relative anchors
          only, if we're actually transforming
          a modulefile (see <directive>) -->
  @@ -45,6 +47,43 @@
       <xsl:otherwise>1</xsl:otherwise></xsl:choose>
     </xsl:variable>
   
  +  <xsl:variable name="index-file">
  +    <xsl:if test="$is-chm">index.html</xsl:if>
  +  </xsl:variable>
  +  <xsl:variable name="ext-target">
  +    <xsl:if test="$is-chm">1</xsl:if>
  +  </xsl:variable>
  +
  +  <xsl:template name="helper.uri.fix">
  +  <xsl:param name="uri"/>
  +    <xsl:choose>
  +      <!-- lame is_absolute_uri test -->
  +      <xsl:when test="    contains($uri, ':')
  +                      and string-length(substring-before($uri, ':')) &lt; 7">
  +        <xsl:if test="$ext-target = '1'">
  +          <xsl:attribute name="target">_blank</xsl:attribute>
  +        </xsl:if>
  +      </xsl:when>
  +
  +      <xsl:otherwise>
  +        <xsl:variable name="fragment">
  +          <xsl:if test="contains($uri, '#')"><xsl:value-of select="concat('#',
substring-after($uri, '#'))"/></xsl:if>
  +        </xsl:variable>
  +        <xsl:variable name="absuri">
  +          <xsl:if test="contains($uri, '#')"><xsl:value-of select="concat('#',
substring-before($uri, '#'))"/></xsl:if>
  +          <xsl:if test="not(contains($uri, '#'))"><xsl:value-of select="$uri"/></xsl:if>
  +        </xsl:variable>
  +        
  +        <xsl:if test="substring($absuri, string-length($uri), 1) = '/'">
  +          <xsl:attribute name="href">
  +            <xsl:value-of select="concat($absuri, $index-file, $fragment)"/>
  +          </xsl:attribute>
  +        </xsl:if>
  +      </xsl:otherwise>
  +    </xsl:choose>
  +  </xsl:template>
  +
  +
     <!--                                                            -->
     <!--    Utility templates for constructing pages                -->
     <!--                                                            -->
  @@ -55,6 +94,11 @@
     <!--                                                            -->
     <xsl:template name="head">
       <head>
  +      <xsl:if test="$is-chm">
  +        <meta http-equiv="Content-Type"
  +                 content="text/html; charset={$output-encoding}" />
  +      </xsl:if>
  +
         <xsl:comment>
           XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                 This file is generated from xml source: DO NOT EDIT
  @@ -82,15 +126,23 @@
   <xsl:text>
   </xsl:text> <!-- insert line break -->
   
  -      <link title="Main stylesheet"  type="text/css" media="all" rel="stylesheet"
  -             href="{$path}/style/css/manual.css" />
  +      <xsl:if test="$is-chm">
  +        <link type="text/css" rel="stylesheet" media="all"
  +              href="{$path}/style/css/manual-chm.css" />
  +      </xsl:if>
  +      
  +      <xsl:if test="not($is-chm)">
  +        <link title="Main stylesheet"  type="text/css" media="all"
  +                rel="stylesheet"
  +               href="{$path}/style/css/manual.css" />
   
   <xsl:text>
   </xsl:text> <!-- insert line break -->
   
  -      <link title="No Sidebar - Default font size" type="text/css" media="all"
  -             rel="alternate stylesheet"
  -             href="{$path}/style/css/manual-loose-100pc.css"/>
  +        <link title="No Sidebar - Default font size" type="text/css" media="all"
  +               rel="alternate stylesheet"
  +               href="{$path}/style/css/manual-loose-100pc.css"/>
  +      </xsl:if> <!-- /!is-chm -->
   
   <xsl:text>
   </xsl:text> <!-- insert line break -->
  @@ -99,15 +151,17 @@
                rel="stylesheet"
                href="{$path}/style/css/manual-print.css"/>
   
  +      <xsl:if test="not($is-chm)">
   <xsl:text>
   </xsl:text> <!-- insert line break -->
   
  -      <link rel="shortcut icon" href="{$path}/images/favicon.ico" />
  +        <link rel="shortcut icon" href="{$path}/images/favicon.ico" />
  +      </xsl:if>
  +
       </head>
     </xsl:template>
     <!-- /head -->
   
  -
     <!--                                                            -->
     <!-- page top                                                   -->
     <!--                                                            -->
  @@ -136,9 +190,12 @@
   </xsl:text> <!-- insert line break -->
   
       <div class="up">
  -      <a href="./">
  +      <a href="./{$index-file}">
           <xsl:if test="parentdocument">
             <xsl:attribute name="href"><xsl:value-of select="parentdocument/@href"/></xsl:attribute>
  +          <xsl:call-template name="helper.uri.fix">
  +            <xsl:with-param name="uri" select="parentdocument/@href"/>
  +          </xsl:call-template>
           </xsl:if>
           <img src="{$path}/images/left.gif" alt="&lt;-" title="&lt;-" />
         </a>
  @@ -153,31 +210,37 @@
   </xsl:text> <!-- insert line break -->
   
         <a href="http://www.apache.org/">
  +        <xsl:if test="$ext-target = '1'"><xsl:attribute name="target">_blank</xsl:attribute></xsl:if>
           <xsl:value-of select="$messages/message[@name='apache']"/>
         </a>
         <xsl:text> &gt; </xsl:text>
         <a href="http://httpd.apache.org/">
  +        <xsl:if test="$ext-target = '1'"><xsl:attribute name="target">_blank</xsl:attribute></xsl:if>
           <xsl:value-of select="$messages/message[@name='http-server']"/>
         </a>
         <xsl:text> &gt; </xsl:text>
         <a href="http://httpd.apache.org/docs-project/">
  +        <xsl:if test="$ext-target = '1'"><xsl:attribute name="target">_blank</xsl:attribute></xsl:if>
           <xsl:value-of select="$messages/message[@name='documentation']"/>
         </a>
         <xsl:if test="not(../indexpage)">
           <xsl:text> &gt; </xsl:text>
  -        <a href="{$path}/">
  +        <a href="{$path}/{$index-file}">
             <xsl:value-of select="$messages/message[@name='version']"/>
           </a>
         </xsl:if>
         <xsl:if test="../modulesynopsis or ../directiveindex or ../quickreference">
           <xsl:text> &gt; </xsl:text>
  -        <a href="./">
  +        <a href="./{$index-file}">
             <xsl:value-of select="$messages/message[@name='modules']"/>
           </a>
         </xsl:if>
         <xsl:if test="parentdocument/text()">
           <xsl:text> &gt; </xsl:text>
           <a href="{parentdocument/@href}">
  +          <xsl:call-template name="helper.uri.fix">
  +            <xsl:with-param name="uri" select="parentdocument/@href"/>
  +          </xsl:call-template>
             <xsl:value-of select="parentdocument"/>
           </a>
         </xsl:if>
  @@ -198,8 +261,10 @@
         <p class="apache">
           <xsl:value-of select="$messages/message[@name='maintainedby']"/>
           <xsl:text> </xsl:text>
  -        <a href="http://httpd.apache.org/docs-project/"
  -          >Apache HTTP Server Documentation Project</a>
  +        <a href="http://httpd.apache.org/docs-project/">
  +          <xsl:if test="$ext-target = '1'"><xsl:attribute name="target">_blank</xsl:attribute></xsl:if>
  +          <xsl:text>Apache HTTP Server Documentation Project</xsl:text>
  +        </a>
         </p>
   
   <xsl:text>
  @@ -376,7 +441,7 @@
     <!--                                                            -->
     <xsl:template name="super-menu">
       <p class="menu">
  -      <a href="{$path}/mod/">
  +      <a href="{$path}/mod/{$index-file}">
           <xsl:value-of select="$messages/message[@name='modules']"/>
         </a>
         <xsl:text> | </xsl:text>
  @@ -384,7 +449,7 @@
           <xsl:value-of select="$messages/message[@name='directives']"/>
         </a>
         <xsl:text> | </xsl:text>
  -      <a href="{$path}/faq/">
  +      <a href="{$path}/faq/{$index-file}">
           <xsl:value-of select="$messages/message[@name='faq']"/>
         </a>
         <xsl:text> | </xsl:text>
  @@ -425,7 +490,7 @@
              </xsl:variable>
   
              <!-- apply bare text only, if it's not only \s or empty -->
  -           <xsl:if test="normalize-space($content) != ''">
  +           <xsl:if test="not(normalize-space($content) = '')">
                <p><code>
                  <xsl:copy-of select="$content"/>
                </code></p>
  @@ -731,6 +796,31 @@
   
   
     <!--                                                    -->
  +  <!-- <a>                                                -->
  +  <!-- Passes through content                             -->
  +  <!--                                                    -->
  +  <xsl:template match="a">
  +    <xsl:if test="not(@href)">
  +      <xsl:copy>
  +        <xsl:apply-templates select="@*|*|text()"/>
  +      </xsl:copy>
  +    </xsl:if>
  +    
  +    <xsl:if test="@href">
  +      <a href="@href">
  +        <xsl:apply-templates select="@*"/>
  +        <xsl:call-template name="helper.uri.fix">
  +          <xsl:with-param name="uri" select="@href"/>
  +        </xsl:call-template>
  +
  +        <xsl:apply-templates select="*|text()"/>
  +      </a>
  +    </xsl:if>
  +  </xsl:template> 
  +  <!-- /a -->
  +
  +
  +  <!--                                                    -->
     <!-- toplink                                            -->
     <!--                                                    -->
     <xsl:template name="toplink">
  @@ -845,7 +935,7 @@
   
       <xsl:variable name="current" select="substring($letters,1,1)"/>
   
  -    <xsl:if test="$lastletter != $current">
  +    <xsl:if test="not($lastletter = $current)">
         <xsl:value-of select="$current"/>
       </xsl:if>
   
  @@ -856,25 +946,5 @@
         </xsl:call-template>
       </xsl:if>
     </xsl:template>
  -
  -
  -  <xsl:template name="module-translatename">
  -  <xsl:param name="name"/>
  -
  -    <xsl:variable name="sname" select="translate($name,$lowercase,$uppercase)"/>
  -
  -    <xsl:choose>
  -      <xsl:when test="starts-with($sname,'MOD_') or starts-with($sname,'MPM_')">
  -        <xsl:value-of select="substring($name, 5)"/>
  -      </xsl:when>
  -      <xsl:when test="starts-with($sname,'MPMT_')">
  -        <xsl:value-of select="substring($name, 6)"/>
  -      </xsl:when>
  -      <xsl:otherwise>
  -        <xsl:value-of select="$name"/>
  -      </xsl:otherwise>
  -    </xsl:choose>
  -  </xsl:template>
  -  <!-- /module-translatename -->
   
   </xsl:stylesheet>
  
  
  
  1.2       +7 -1      httpd-2.0/docs/manual/style/xsl/faq.xsl
  
  Index: faq.xsl
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/style/xsl/faq.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- faq.xsl	16 Apr 2003 22:39:37 -0000	1.1
  +++ faq.xsl	17 Apr 2003 16:34:22 -0000	1.2
  @@ -37,8 +37,9 @@
   <xsl:text>
   </xsl:text> <!-- insert line break -->
   
  -          <xsl:if test="count(section) > 1 or (/faq/@all-in-one = 'yes') or seealso">
  +          <xsl:if test="(not($is-chm) and (count(section) > 1 or (/faq/@all-in-one
= 'yes'))) or seealso">
               <div id="quickview">
  +              <xsl:if test="not($is-chm)">
                 <xsl:if test="count(section) > 1">
                   <ul id="toc">
                     <xsl:apply-templates select="section" mode="index"/>
  @@ -48,6 +49,8 @@
                 <xsl:if test="/faq/@all-in-one = 'yes'">
                   <ul id="toc">
                     <li>
  +                    <img src="{$path}/images/down.gif" alt="" />
  +                    <xsl:text> </xsl:text>
                       <a href="#topics">
                         <xsl:value-of select="$messages/message[@name='topics']"/>
                       </a>
  @@ -59,6 +62,7 @@
                     <xsl:apply-templates select="categories/categoryfile" mode="toc"/>
                   </ul>
                 </xsl:if>
  +              </xsl:if> <!-- chm -->
   
                 <xsl:if test="seealso">
                   <h3>
  @@ -162,6 +166,8 @@
       <xsl:variable name="current" select="document(.)/faq" />
   
       <li>
  +      <img src="{$path}/images/down.gif" alt="" />
  +      <xsl:text> </xsl:text>
         <a href="#{$current/section/@id}">
           <xsl:value-of select="$current/section/title" />
         </a>
  
  
  
  1.4       +10 -1     httpd-2.0/docs/manual/style/xsl/indexpage.xsl
  
  Index: indexpage.xsl
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/style/xsl/indexpage.xsl,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- indexpage.xsl	14 Apr 2003 17:50:49 -0000	1.3
  +++ indexpage.xsl	17 Apr 2003 16:34:22 -0000	1.4
  @@ -53,7 +53,12 @@
   <xsl:text>
   </xsl:text> <!-- insert line break -->
   
  -          <form action="http://www.google.com/search" method="get"><p>
  +          <form action="http://www.google.com/search" method="get">
  +          <xsl:if test="$ext-target = '1'">
  +            <xsl:attribute name="target">_blank</xsl:attribute>
  +          </xsl:if>
  +          
  +          <p>
             <!-- search google: -->
             <!-- with all of the words -->
             <input type="text" value="" name="as_q" />
  @@ -147,6 +152,10 @@
   
         <xsl:if test="@href">
           <a href="{@href}">
  +          <xsl:call-template name="helper.uri.fix">
  +            <xsl:with-param name="uri" select="@href"/>
  +          </xsl:call-template>
  +
             <xsl:value-of select="."/>
           </a>
         </xsl:if>
  
  
  
  1.5       +2 -2      httpd-2.0/docs/manual/style/xsl/manualpage.xsl
  
  Index: manualpage.xsl
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/style/xsl/manualpage.xsl,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- manualpage.xsl	14 Apr 2003 17:50:49 -0000	1.4
  +++ manualpage.xsl	17 Apr 2003 16:34:22 -0000	1.5
  @@ -37,9 +37,9 @@
   <xsl:text>
   </xsl:text> <!-- insert line break -->
   
  -          <xsl:if test="count(section) > 1 or seealso">
  +          <xsl:if test="(not($is-chm) and count(section) > 1) or seealso">
               <div id="quickview">
  -              <xsl:if test="count(section) > 1">
  +              <xsl:if test="not($is-chm) and count(section) > 1">
                   <ul id="toc">
                     <xsl:apply-templates select="section" mode="index"/>
                   </ul>
  
  
  
  1.11      +4 -0      httpd-2.0/docs/manual/style/xsl/moduleindex.xsl
  
  Index: moduleindex.xsl
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/style/xsl/moduleindex.xsl,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- moduleindex.xsl	14 Apr 2003 17:50:49 -0000	1.10
  +++ moduleindex.xsl	17 Apr 2003 16:34:22 -0000	1.11
  @@ -35,7 +35,9 @@
   <xsl:text>
   </xsl:text> <!-- insert line break -->
   
  +        <xsl:if test="not($is-chm) or seealso">
           <div id="quickview">
  +          <xsl:if test="not($is-chm)">
             <ul id="toc">
   
   <xsl:text>
  @@ -57,6 +59,7 @@
                 </a>
               </li>
             </ul>
  +          </xsl:if> <!-- chm -->
   
             <xsl:if test="seealso">
               <h3>
  @@ -83,6 +86,7 @@
               </ul>
             </xsl:if>
           </div> <!-- /quickview -->
  +        </xsl:if> <!-- chm foo -->
   
   <xsl:text>
   </xsl:text> <!-- insert line break -->
  
  
  
  1.10      +5 -2      httpd-2.0/docs/manual/style/xsl/sitemap.xsl
  
  Index: sitemap.xsl
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/style/xsl/sitemap.xsl,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- sitemap.xsl	14 Apr 2003 17:50:49 -0000	1.9
  +++ sitemap.xsl	17 Apr 2003 16:34:22 -0000	1.10
  @@ -46,9 +46,9 @@
   <xsl:text>
   </xsl:text> <!-- insert line break -->
   
  -          <xsl:if test="count(category) > 1 or seealso">
  +          <xsl:if test="(not($is-chm) and count(category) > 1) or seealso">
               <div id="quickview">
  -              <xsl:if test="count(category) > 1">
  +              <xsl:if test="not($is-chm) and count(category) > 1">
   
                   <!-- category index -->
                   <ul id="toc">
  @@ -152,6 +152,9 @@
   
         <xsl:if test="@href">
           <a href="{@href}">
  +          <xsl:call-template name="helper.uri.fix">
  +            <xsl:with-param name="uri" select="@href"/>
  +          </xsl:call-template>
             <xsl:value-of select="."/>
           </a>
         </xsl:if>
  
  
  
  1.13      +5 -1      httpd-2.0/docs/manual/style/xsl/synopsis.xsl
  
  Index: synopsis.xsl
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/style/xsl/synopsis.xsl,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- synopsis.xsl	14 Apr 2003 17:50:49 -0000	1.12
  +++ synopsis.xsl	17 Apr 2003 16:34:22 -0000	1.13
  @@ -179,8 +179,10 @@
   <xsl:text>
   </xsl:text> <!-- insert line break -->
   
  +          <xsl:if test="not($is-chm) or seealso">
             <div id="quickview">
   
  +            <xsl:if test="not($is-chm)">
               <!-- Index of directives, automatically generated from
                    directivesynopsis/name -->
               <h3 class="directives">
  @@ -267,9 +269,10 @@
                   <xsl:apply-templates select="section" mode="index"/>
                 </ul>
               </xsl:if>
  +            </xsl:if> <!-- /!is-chm -->
   
               <xsl:if test="seealso">
  -	      <h3>
  +	          <h3>
                     <xsl:value-of select="$messages/message[@name='seealso']"/>
                 </h3>
   
  @@ -294,6 +297,7 @@
               </xsl:if>
   
             </div> <!-- /quickview -->
  +          </xsl:if> <!-- !is-chm -->
   
   <xsl:text>
   </xsl:text> <!-- insert line break -->
  
  
  
  1.1                  httpd-2.0/docs/manual/style/xsl/util/lf.xml
  
  Index: lf.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8" ?>
  
  <xsl:text>&#xA;</xsl:text>
  
  
  1.1                  httpd-2.0/docs/manual/style/xsl/util/modtrans.xsl
  
  Index: modtrans.xsl
  ===================================================================
  <?xml version="1.0"?>
  <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>
  <xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <xsl:template name="module-translatename">
  <xsl:param name="name"/>
  
    <xsl:variable name="sname" select="translate($name,$lowercase,$uppercase)"/>
  
    <xsl:choose>
      <xsl:when test="starts-with($sname,'MOD_') or starts-with($sname,'MPM_')">
        <xsl:value-of select="substring($name, 5)"/>
      </xsl:when>
  
      <xsl:when test="starts-with($sname,'MPMT_')">
        <xsl:value-of select="substring($name, 6)"/>
      </xsl:when>
  
      <xsl:otherwise>
        <xsl:value-of select="$name"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  <!-- /module-translatename -->
  
  </xsl:stylesheet>
  
  
  
  1.1                  httpd-2.0/docs/manual/style/xsl/util/tab.xml
  
  Index: tab.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8" ?>
  
  <xsl:text>&#x9;</xsl:text>
  
  
  

Mime
View raw message