forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject cvs commit: xml-forrest/src/resources/skins/common/xslt/fo document2fo.xsl
Date Mon, 02 Jun 2003 03:18:25 GMT
jefft       2003/06/01 20:18:25

  Modified:    .        status.xml
               src/resources/skins/common/xslt/fo document2fo.xsl
  Log:
  - No longer reduce sub-section title size indefinitely.
  - For sections below a certain depth, stop numbering altogether, and instead
    rely on indents
  
  Revision  Changes    Path
  1.164     +4 -1      xml-forrest/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/xml-forrest/status.xml,v
  retrieving revision 1.163
  retrieving revision 1.164
  diff -u -r1.163 -r1.164
  --- status.xml	2 Jun 2003 00:59:42 -0000	1.163
  +++ status.xml	2 Jun 2003 03:18:25 -0000	1.164
  @@ -24,7 +24,10 @@
   
     <changes>
       <release version="0.5-dev" date="unreleased">
  -      <action dev="JT" type="update" context="core">
  +      <action dev="JT" type="fix" context="core">
  +        In PDFs, section titles are no longer numbered/reduced in size indefinitely.
  +      </action>
  +       <action dev="JT" type="update" context="core">
           Upgraded FOP from 0.20.4 to 0.20.5rc3a.
         </action>
          <action dev="JT" type="update" context="core">
  
  
  
  1.14      +24 -4     xml-forrest/src/resources/skins/common/xslt/fo/document2fo.xsl
  
  Index: document2fo.xsl
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/skins/common/xslt/fo/document2fo.xsl,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- document2fo.xsl	2 Jun 2003 01:26:58 -0000	1.13
  +++ document2fo.xsl	2 Jun 2003 03:18:25 -0000	1.14
  @@ -6,6 +6,9 @@
   
     <xsl:output method="xml"/>
     <xsl:param name="numbersections" select="'true'"/>
  +
  +  <!-- Section depth at which we stop numbering and just indent -->
  +  <xsl:param name="numbering-max-depth" select="'3'"/>
     <xsl:param name="ctxbasedir" select="."/>
     <xsl:param name="xmlbasedir"/>
     <xsl:include href="pdfoutline.xsl"/>
  @@ -213,7 +216,17 @@
     <xsl:template match="section">
       
       <xsl:param name="level">0</xsl:param>
  -    <xsl:variable name="size" select="16-(number($level)*2)"/>
  +
  +    <xsl:variable name="size">
  +      <xsl:choose>
  +        <xsl:when test="number($level) = 1">
  +          <xsl:value-of select="14"/>
  +        </xsl:when>
  +        <xsl:otherwise>
  +          <xsl:value-of select="12"/>
  +        </xsl:otherwise>
  +      </xsl:choose>
  +    </xsl:variable>
       
       <fo:block
         font-family="serif"
  @@ -221,6 +234,7 @@
         font-weight="bold"
         space-before="12pt"
         space-after="4pt">
  +
         <xsl:attribute name="id">
           <xsl:choose>
             <xsl:when test="normalize-space(@id)!=''">
  @@ -232,13 +246,19 @@
           </xsl:choose>
         </xsl:attribute>
   
  -
  -      <xsl:if test="$numbersections = 'true'">
  +      <xsl:if test="$numbersections = 'true' and number($level) &lt; $numbering-max-depth+1">
           <xsl:number format="1.1.1.1.1.1.1" count="section" level="multiple"/>
           <xsl:text>. </xsl:text>
         </xsl:if>
  -      <xsl:value-of select="title"/>
   
  +      <!-- For sections 4  or more nestings deep, indent instead of number -->
  +      <xsl:if test="number($level) &gt; $numbering-max-depth+1">
  +        <xsl:attribute name="start-indent">
  +          <xsl:value-of select="4+number($level)"/><xsl:text>pt</xsl:text>
  +        </xsl:attribute>
  +      </xsl:if>
  +
  +      <xsl:value-of select="title"/>
       </fo:block>
       <xsl:apply-templates>
         <xsl:with-param name="level" select="number($level)+1"/>
  
  
  

Mime
View raw message