Ignore:
Timestamp:
12/19/2004 09:17:48 PM (20 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 12.2, 12.2-rc1, 6.1, 6.1.1, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/loongarch-12.2, xry111/mips64el, xry111/multilib, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
faf3398
Parents:
6d3af72
Message:

Updated the stylesheets and Makefile.
Removed contrib/, index-pdf.xml and goTidy.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@4428 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stylesheets/pdf/lfs-mixed.xsl

    r6d3af72 rf7bd105  
    55                version="1.0">
    66
    7  
    8     <!-- This is a hack and isn't correct semantically. The beginpage tags must
    9       be placed in the XML source only to render the final PDF output, and must
    10       be removed after.-->
     7
     8    <!-- This is a hack and isn't correct semantically. Theoretically, the beginpage
     9      tags should be placed in the XML source only to render the PDF output and
     10      should be removed after it. But there is no a better way and we need this.-->
    1111  <xsl:template match="beginpage">
    1212    <fo:block break-after="page"/>
    1313  </xsl:template>
    14 
    15     <!-- Split URLs -->
    16   <xsl:template name="hyphenate-url">
     14 
     15    <!-- Allow forced line breaks inside paragraphs emulating literallayout. -->
     16 <xsl:template match="para">
     17    <xsl:choose>
     18      <xsl:when test="./@remap='verbatim'">
     19        <fo:block wrap-option="no-wrap"
     20                    white-space-collapse="false"
     21                    white-space-treatment="preserve"
     22                    text-align="start"
     23                    linefeed-treatment="preserve">
     24          <xsl:call-template name="anchor"/>
     25          <xsl:apply-templates/>
     26        </fo:block>
     27      </xsl:when>
     28      <xsl:otherwise>
     29        <xsl:apply-imports/>
     30      </xsl:otherwise>
     31    </xsl:choose>
     32  </xsl:template>
     33
     34    <!-- Show URLs in italic font -->
     35  <xsl:template match="ulink" name="ulink">
     36    <fo:inline font-style="italic">
     37      <fo:basic-link xsl:use-attribute-sets="xref.properties">
     38        <xsl:attribute name="external-destination">
     39          <xsl:call-template name="fo-external-image">
     40            <xsl:with-param name="filename" select="@url"/>
     41          </xsl:call-template>
     42        </xsl:attribute>
     43        <xsl:choose>
     44          <xsl:when test="count(child::node())=0">
     45            <xsl:call-template name="hyphenate-url">
     46              <xsl:with-param name="url" select="@url"/>
     47            </xsl:call-template>
     48          </xsl:when>
     49          <xsl:otherwise>
     50            <xsl:apply-templates/>
     51          </xsl:otherwise>
     52        </xsl:choose>
     53      </fo:basic-link>
     54    </fo:inline>
     55    <xsl:if test="count(child::node()) != 0
     56                  and string(.) != @url
     57                  and $ulink.show != 0">
     58      <!-- yes, show the URI -->
     59      <xsl:choose>
     60        <xsl:when test="$ulink.footnotes != 0 and not(ancestor::footnote)">
     61          <xsl:text>&#xA0;</xsl:text>
     62          <fo:footnote>
     63            <xsl:call-template name="ulink.footnote.number"/>
     64            <fo:footnote-body font-family="{$body.fontset}"
     65                              font-size="{$footnote.font.size}">
     66              <fo:block>
     67                <xsl:call-template name="ulink.footnote.number"/>
     68                <xsl:text> </xsl:text>
     69                <fo:inline>
     70                  <xsl:value-of select="@url"/>
     71                </fo:inline>
     72              </fo:block>
     73            </fo:footnote-body>
     74          </fo:footnote>
     75        </xsl:when>
     76        <xsl:otherwise>
     77          <fo:inline hyphenate="false">
     78            <xsl:text> [</xsl:text>
     79            <xsl:call-template name="hyphenate-url">
     80              <xsl:with-param name="url" select="@url"/>
     81            </xsl:call-template>
     82            <xsl:text>]</xsl:text>
     83          </fo:inline>
     84        </xsl:otherwise>
     85      </xsl:choose>
     86    </xsl:if>
     87  </xsl:template>
     88
     89    <!-- Split URLs (obsolete, keeped as reference) -->
     90  <!--<xsl:template name="hyphenate-url">
    1791    <xsl:param name="url" select="''"/>
    1892    <xsl:choose>
    1993      <xsl:when test="ancestor::varlistentry">
    2094        <xsl:choose>
    21           <xsl:when test="string-length($url) > 88">
     95          <xsl:when test="string-length($url) > 90">
    2296            <xsl:value-of select="substring($url, 1, 50)"/>
    2397            <xsl:param name="rest" select="substring($url, 51)"/>
     
    32106      </xsl:when>
    33107      <xsl:otherwise>
    34         <xsl:value-of select="$url"/>
     108        <xsl:value-of select="$url"/>-->
    35109      <!--  <xsl:value-of select="substring-before($url, '//')"/>
    36110        <xsl:text>// </xsl:text>
     
    38112          <xsl:with-param name="url2" select="substring-after($url, '//')"/>
    39113        </xsl:call-template>-->
    40       </xsl:otherwise>
     114     <!-- </xsl:otherwise>
    41115    </xsl:choose>
    42   </xsl:template>
     116  </xsl:template>-->
    43117
    44118  <!--<xsl:template name="split-url">
     
    60134    <!-- Shade screen -->
    61135  <xsl:param name="shade.verbatim" select="1"/>
    62 
    63     <!-- Graphics in admonitions -->
    64   <xsl:param name="admon.graphics" select="1"/>
    65   <xsl:param name="admon.graphics.path"
    66     select="'/usr/share/xml/docbook/xsl-stylesheets-1.67.2/images/'"/>
    67 
    68     <!-- Admonition block properties -->
    69   <xsl:template match="important|warning|caution">
    70     <xsl:choose>
    71       <xsl:when test="$admon.graphics != 0">
    72         <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em"
    73               space-before.maximum="0.8em" border-style="solid" border-width="1pt"
    74               border-color="#500" background-color="#FFFFE6">
    75         <xsl:call-template name="graphical.admonition"/>
    76         </fo:block>
    77       </xsl:when>
    78       <xsl:otherwise>
    79         <xsl:call-template name="nongraphical.admonition"/>
    80       </xsl:otherwise>
    81     </xsl:choose>
    82   </xsl:template>
    83 
    84   <xsl:template match="note|tip">
    85     <xsl:choose>
    86       <xsl:when test="$admon.graphics != 0">
    87         <fo:block space-before.minimum="0.4em" space-before.optimum="0.6em"
    88               space-before.maximum="0.8em" border-style="solid" border-width="1pt"
    89               border-color="#E0E0E0" background-color="#FFFFE6">
    90         <xsl:call-template name="graphical.admonition"/>
    91         </fo:block>
    92       </xsl:when>
    93       <xsl:otherwise>
    94         <xsl:call-template name="nongraphical.admonition"/>
    95       </xsl:otherwise>
    96     </xsl:choose>
    97   </xsl:template>
    98  
    99     <!-- Admonitions text properties -->
    100   <xsl:attribute-set name="admonition.properties">
    101     <xsl:attribute name="margin-right">6pt</xsl:attribute>
    102   </xsl:attribute-set>
    103 
    104     <!-- Adding left space to the graphics and color to the titles -->
    105   <xsl:template name="graphical.admonition">
    106     <xsl:variable name="id">
    107       <xsl:call-template name="object.id"/>
    108     </xsl:variable>
    109     <fo:block id="{$id}">
    110       <fo:list-block xsl:use-attribute-sets="list.block.spacing">
    111         <fo:list-item>
    112             <fo:list-item-label end-indent="label-end()">
    113               <fo:block margin-left="4pt">
    114                 <fo:external-graphic width="auto" height="auto">
    115                   <xsl:attribute name="src">
    116                     <xsl:call-template name="admon.graphic"/>
    117                   </xsl:attribute>
    118                 </fo:external-graphic>
    119               </fo:block>
    120             </fo:list-item-label>
    121             <fo:list-item-body start-indent="body-start()">
    122               <xsl:if test="$admon.textlabel != 0 or title">
    123                 <fo:block xsl:use-attribute-sets="admonition.title.properties">
    124                   <xsl:if test="ancestor-or-self::important">
    125                     <xsl:attribute name="color">#500</xsl:attribute>
    126                   </xsl:if>
    127                   <xsl:if test="ancestor-or-self::warning">
    128                     <xsl:attribute name="color">#500</xsl:attribute>
    129                   </xsl:if>
    130                   <xsl:if test="ancestor-or-self::caution">
    131                     <xsl:attribute name="color">#500</xsl:attribute>
    132                   </xsl:if>
    133                   <xsl:apply-templates select="." mode="object.title.markup"/>
    134                 </fo:block>
    135               </xsl:if>
    136               <fo:block xsl:use-attribute-sets="admonition.properties">
    137                 <xsl:apply-templates/>
    138               </fo:block>
    139             </fo:list-item-body>
    140         </fo:list-item>
    141       </fo:list-block>
    142     </fo:block>
    143   </xsl:template>
    144136
    145137    <!-- How is rendered by default a variablelist -->
     
    178170  </xsl:template>
    179171
     172    <!-- Presentation of literal tag -->
     173  <xsl:template match="literal">
     174    <fo:inline  font-weight="normal">
     175      <xsl:call-template name="inline.monoseq"/>
     176    </fo:inline>
     177  </xsl:template>
     178
     179    <!-- Left alingnament for itemizedlist -->
     180  <xsl:template match="itemizedlist">
     181    <xsl:variable name="id">
     182      <xsl:call-template name="object.id"/>
     183    </xsl:variable>
     184    <xsl:variable name="label-width">
     185      <xsl:call-template name="dbfo-attribute">
     186        <xsl:with-param name="pis"
     187                        select="processing-instruction('dbfo')"/>
     188        <xsl:with-param name="attribute" select="'label-width'"/>
     189      </xsl:call-template>
     190    </xsl:variable>
     191    <xsl:if test="title">
     192      <xsl:apply-templates select="title" mode="list.title.mode"/>
     193    </xsl:if>
     194    <!-- Preserve order of PIs and comments -->
     195    <xsl:apply-templates
     196        select="*[not(self::listitem
     197                  or self::title
     198                  or self::titleabbrev)]
     199                |comment()[not(preceding-sibling::listitem)]
     200                |processing-instruction()[not(preceding-sibling::listitem)]"/>
     201    <fo:list-block id="{$id}" xsl:use-attribute-sets="list.block.spacing"
     202                  provisional-label-separation="0.2em" text-align="left">
     203      <xsl:attribute name="provisional-distance-between-starts">
     204        <xsl:choose>
     205          <xsl:when test="$label-width != ''">
     206            <xsl:value-of select="$label-width"/>
     207          </xsl:when>
     208          <xsl:otherwise>1.5em</xsl:otherwise>
     209        </xsl:choose>
     210      </xsl:attribute>
     211      <xsl:apply-templates
     212            select="listitem
     213                    |comment()[preceding-sibling::listitem]
     214                    |processing-instruction()[preceding-sibling::listitem]"/>
     215    </fo:list-block>
     216  </xsl:template>
     217
     218    <!-- Addibg a bullet, and left alignament, for packages and paches list. -->
     219
     220<xsl:template match="varlistentry" mode="vl.as.blocks">
     221  <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
     222  <xsl:choose>
     223    <xsl:when test="ancestor::variablelist/@role = 'materials'">
     224      <fo:block id="{$id}" xsl:use-attribute-sets="list.item.spacing"
     225          keep-together.within-column="always"
     226          keep-with-next.within-column="always" text-align="left">
     227        <xsl:text>&#x2022;   </xsl:text>
     228        <xsl:apply-templates select="term"/>
     229      </fo:block>
     230      <fo:block margin-left="0.1in" text-align="left">
     231        <xsl:apply-templates select="listitem"/>
     232      </fo:block>
     233    </xsl:when>
     234    <xsl:otherwise>
     235      <fo:block id="{$id}" xsl:use-attribute-sets="list.item.spacing"
     236          keep-together.within-column="always"
     237          keep-with-next.within-column="always">
     238        <xsl:apply-templates select="term"/>
     239      </fo:block>
     240      <fo:block margin-left="0.25in">
     241        <xsl:apply-templates select="listitem"/>
     242      </fo:block>
     243    </xsl:otherwise>
     244  </xsl:choose>
     245</xsl:template>
     246
    180247</xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.