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 common.xsl
Date Sat, 28 Sep 2002 23:49:14 GMT
nd          2002/09/28 16:49:14

  Modified:    docs/manual/style common.dtd
               docs/manual/style/css manual-loose-100pc.css
                        manual-print.css manual.css
               docs/manual/style/xsl common.xsl
  Log:
  - add the general ability to create zebra tables
    automagically (<table style="zebra">)
  - allow some attributes in th (e.g. colspan)
  - add ability for <h4> sections
  - refuse to transform deeper nesting than h4
  
  Revision  Changes    Path
  1.7       +5 -2      httpd-2.0/docs/manual/style/common.dtd
  
  Index: common.dtd
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/style/common.dtd,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- common.dtd	28 Sep 2002 03:54:08 -0000	1.6
  +++ common.dtd	28 Sep 2002 23:49:14 -0000	1.7
  @@ -74,17 +74,20 @@
                   bgcolor     CDATA  #IMPLIED
                   cellspacing CDATA  #IMPLIED
                   cellpadding CDATA  #IMPLIED
  -                border      CDATA  #IMPLIED >
  +                border      CDATA  #IMPLIED
  +                style       CDATA  #IMPLIED>
   
   <!ELEMENT tr (th | td)+>
   <!ATTLIST tr valign CDATA #IMPLIED >
   
   <!ELEMENT th %BlockOrInline;>
  +<!ATTLIST th  colspan  CDATA  #IMPLIED
  +              rowspan  CDATA  #IMPLIED
  +              class    CDATA  #IMPLIED >
   
   <!ELEMENT td %BlockOrInline;>
   <!ATTLIST td  colspan  CDATA  #IMPLIED
                 rowspan  CDATA  #IMPLIED
  -              bgcolor  CDATA  #IMPLIED
                 class    CDATA  #IMPLIED >
   
   <!ELEMENT ul (li+)>
  
  
  
  1.4       +4 -0      httpd-2.0/docs/manual/style/css/manual-loose-100pc.css
  
  Index: manual-loose-100pc.css
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/style/css/manual-loose-100pc.css,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- manual-loose-100pc.css	22 Sep 2002 00:14:40 -0000	1.3
  +++ manual-loose-100pc.css	28 Sep 2002 23:49:14 -0000	1.4
  @@ -42,6 +42,10 @@
       font-size: 1.1em;
   }
   
  +h4 {
  +    font-size: 1em;
  +}
  +
   div.example h3,
   div.note h3,
   div.warning h3 {
  
  
  
  1.3       +25 -3     httpd-2.0/docs/manual/style/css/manual-print.css
  
  Index: manual-print.css
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/style/css/manual-print.css,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- manual-print.css	22 Sep 2002 00:14:40 -0000	1.2
  +++ manual-print.css	28 Sep 2002 23:49:14 -0000	1.3
  @@ -26,6 +26,10 @@
       font-weight: bold;
   }
   
  +q, em, var {
  +    font-style: italic;
  +}
  +
   /* fixup IE & Opera
    * otherwise they forget to inherit
    * the computed font-size value
  @@ -134,7 +138,7 @@
       text-decoration: none;
   }
   
  -/* h3                     */
  +/* h3, h4                 */
   /* ====================== */
   h3 {
       background-color: inherit;
  @@ -146,8 +150,18 @@
       padding: 0 0 0 0.2em;
   }
   
  +h4 {
  +    background-color: inherit;
  +    color: #000;
  +    text-decoration: none;
  +    font-weight: bold;
  +    font-size: 11pt;
  +    margin: 1.3em 0 0.2em 0;
  +    padding: 0 0 0 0.2em;
  +}
  +
   /* margin adjustment */
  -h3 + * {
  +h3 + *, h4 + * {
       margin-top: 0;
   }
   
  @@ -182,7 +196,10 @@
   /* take care of <a name>s inside */
   h3 a,
   h3 a:hover,
  -h3 a:active {
  +h3 a:active,
  +h4 a,
  +h4 a:hover,
  +h4 a:active {
       color: inherit;
       background-color: inherit;
       text-decoration: none;
  @@ -222,6 +239,11 @@
   
   th {
       font-weight: bold;
  +}
  +
  +tr.header, tr.header th {
  +    border-top: 1px solid #000;
  +    border-bottom: 1px solid #000;
   }
   
   /* bordered table cells   */
  
  
  
  1.10      +32 -3     httpd-2.0/docs/manual/style/css/manual.css
  
  Index: manual.css
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/docs/manual/style/css/manual.css,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- manual.css	22 Sep 2002 00:14:40 -0000	1.9
  +++ manual.css	28 Sep 2002 23:49:14 -0000	1.10
  @@ -26,6 +26,10 @@
       font-weight: bold;
   }
   
  +q, em, var {
  +    font-style: italic;
  +}
  +
   /* fixup IE & Opera
    * otherwise they forget to inherit
    * the computed font-size value
  @@ -59,6 +63,8 @@
   /* hover on non-white backgrounds */
   tr.odd a:hover,
   tr.odd a:active,
  +tr.header a:hover,
  +tr.header a:active,
   div.note a:hover,
   div.note a:active,
   div.example a:hover,
  @@ -93,6 +99,8 @@
   /* hover on non-white backgrounds */
   tr.odd code.module a:hover,
   tr.odd code.module a:active,
  +tr.header code.module a:hover,
  +tr.header code.module a:active,
   div.note code.module a:hover,
   div.note code.module a:active,
   div.example code.module a:hover,
  @@ -127,6 +135,8 @@
   /* hover on non-white backgrounds */
   tr.odd code.directive a:hover,
   tr.odd code.directive a:active,
  +tr.header code.directive a:hover,
  +tr.header code.directive a:active,
   div.note code.directive a:hover,
   div.note code.directive a:active,
   div.example code.directive a:hover,
  @@ -185,7 +195,7 @@
       text-decoration: none;
   }
   
  -/* h3                     */
  +/* h3, h4                 */
   /* ====================== */
   h3 {
       background-color: inherit;
  @@ -197,8 +207,18 @@
       padding: 0;
   }
   
  +h4 {
  +    background-color: inherit;
  +    color: #036;
  +    text-decoration: none;
  +    font-weight: bold;
  +    font-size: 14px;
  +    margin: 1.3em 0 0.2em 0;
  +    padding: 0;
  +}
  +
   /* margin adjustment */
  -h3 + * {
  +h3 + *, h4 + * {
       margin-top: 0;
   }
   
  @@ -233,7 +253,10 @@
   /* take care of <a name>s inside */
   h3 a,
   h3 a:hover,
  -h3 a:active {
  +h3 a:active,
  +h4 a,
  +h4 a:hover,
  +h4 a:active {
       color: inherit;
       background-color: inherit;
       text-decoration: none;
  @@ -305,6 +328,12 @@
   
   tr.odd { /* for large tables alternating colors */
       background-color: #f2f2f2;
  +}
  +
  +tr.header, tr.header th {
  +    background-color: #e2e2e2;
  +    border-top: 1px solid #aaa;
  +    border-bottom: 1px solid #aaa;
   }
   
   /* bordered table cells   */
  
  
  
  1.15      +81 -3     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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- common.xsl	23 Sep 2002 03:40:12 -0000	1.14
  +++ common.xsl	28 Sep 2002 23:49:14 -0000	1.15
  @@ -218,6 +218,46 @@
   
   
     <!--                                                            -->
  +  <!-- handle subsubsections (h4)                                 -->
  +  <!--                                                            -->
  +  <xsl:template match="section/section/section">
  +
  +    <!-- Section heading -->
  +    <h4>
  +      <xsl:if test="@id">
  +        <a id="{@id}" name="{@id}">
  +          <xsl:apply-templates select="title" mode="print"/>
  +        </a>
  +      </xsl:if>
  +
  +      <xsl:if test="not(@id)">
  +        <xsl:apply-templates select="title" mode="print"/>
  +      </xsl:if>
  +    </h4>
  +    
  +    <!-- Section body -->
  +    <xsl:apply-templates/>
  +
  +  </xsl:template>
  +  <!-- /section/section/section -->
  +
  +
  +  <!--                                                            -->
  +  <!-- section nesting > h4 is not supported for now              -->
  +  <!--                                                            -->
  +  <xsl:template match="section/section/section/section">
  +    <xsl:message terminate="yes">
  +      <xsl:text>FATAL: exceeding maximum section nesting level.
  +
  +      Perhaps you should consider to split your document into
  +      several ones...
  +      </xsl:text>
  +    </xsl:message>
  +  </xsl:template>
  +  <!-- /section/section/section/section -->
  +
  +
  +  <!--                                                            -->
     <!-- (sub)section titles                                        -->
     <!--                                                            -->
     <xsl:template match="section/title" mode="print">
  @@ -501,18 +541,56 @@
   
   
     <!--                                                    -->
  -  <!-- <table border>                                     -->
  +  <!-- <table>                                            -->
     <!--                                                    -->
     <xsl:template match="table">
  +    <xsl:variable name="content"><xsl:choose>
  +      <xsl:when test="@style = 'zebra'">
  +        <xsl:for-each select="tr">
  +
  +          <!-- catch content -->
  +          <xsl:variable name="current">
  +            <xsl:apply-templates />
  +          </xsl:variable>
  +          
  +          <!-- header line -->
  +          <xsl:if test="count(td) = 0">
  +            <tr class="header"><xsl:copy-of select="$current" /></tr>
  +          </xsl:if>
  +          
  +          <!-- data line -->
  +          <xsl:if test="count(td) &gt; 0">
  +            <xsl:variable name="offset" select="count(preceding-sibling::*[count(td)
= 0]) mod 2" />
  +
  +            <xsl:if test="position() mod 2 = $offset">
  +              <tr class="odd"><xsl:copy-of select="$current" /></tr>
  +            </xsl:if>
  +
  +            <xsl:if test="position() mod 2 != $offset">
  +              <tr><xsl:copy-of select="$current" /></tr>
  +            </xsl:if>
  +          </xsl:if>
  +
  +<xsl:text>
  +</xsl:text> <!-- insert line break -->
  +
  +        </xsl:for-each>
  +      </xsl:when>
  +
  +      <xsl:otherwise>
  +        <xsl:apply-templates />
  +      </xsl:otherwise></xsl:choose>
  +    </xsl:variable>
  +    
       <xsl:if test="@border">
         <table class="bordered">
  -        <xsl:apply-templates/>
  +        <xsl:copy-of select="$content" />
         </table>
       </xsl:if>
   
       <xsl:if test="not(@border)">
         <table>
  -        <xsl:apply-templates/>
  +        <xsl:copy-of select="$content" />
         </table>
       </xsl:if>
     </xsl:template>
  
  
  

Mime
View raw message