Changeset 11b36cd


Ignore:
Timestamp:
05/07/2004 08:18:37 PM (20 years ago)
Author:
Matthew Burgess <matthew@…>
Children:
215e6dc
Parents:
ff979cd
Message:

Upgraded to lfs-xsl-0.9 (Manuel)

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

Files:
13 added
9 edited

Legend:

Unmodified
Added
Removed
  • INSTALL

    rff979cd r11b36cd  
    1010
    1111-------------------------------------------------------------------------------
    12 If all you want to do is convert XML to HTML perform the following:
     12If all you want to do is convert XML to HTML install the following:
    1313
    1414* libxml2
     
    2424  - http://www.linuxfromscratch.org/blfs/view/cvs/pst/docbook-xsl.html
    2525
     26* HTML Tidy - http://tidy.sourceforge.net/src/tidy_src.tgz
     27
     28  /bin/sh build/gnuauto/setup.sh &&
     29  ./configure --prefix=/usr &&
     30  make &&
     31  su -c "make install"
     32
    2633-------------------------------------------------------------------------------
    2734If you want to be able to convert the book into PDF as well, then you will need
    2835the FOP package.  This takes an XSL-FO file (created with libxslt which you
    29 already installed) and converts it to PDF:
     36already installed) and converts it to PDF.  Additionally you will need
     37the Java Advanced Imaging (JAI) library from
     38http://java.sun.com/products/java-media/jai/downloads/download-1_1_2.html
     39(you'll need either the JDK .bin or JRE .bin file dependent on your
     40particular Java setup).
    3041
    3142  - http://www.apache.org/dist/xml/fop/fop-0.20.5-bin.tar.gz
     
    3748  mv fop-0.20.5 fop
    3849
     50  Install JAI by running:
     51
     52  chmod u+x /path/to/jai-1_1_2-lib-linux-i586-jdk.bin &&
     53  cd $JAVA_HOME &&
     54  /path/to/jai-1_1_2-lib-linux-i586-jdk.bin
     55
    3956  Now set JAVA_HOME, FOP_HOME and PATH to values appropriate to your system.
  • Makefile

    rff979cd r11b36cd  
    2020          index.html part1.html part2.html part3.html longindex.html
    2121
     22        sh goTidy $(BASEDIR)/
     23
    2224pdf:
    2325        xsltproc --xinclude --nonet --output lfs.fo stylesheets/lfs-pdf.xsl \
     
    2628        fop.sh lfs.fo lfs.pdf
    2729
     30print:
     31        xsltproc --xinclude --nonet --output lfs-print.fo \
     32          stylesheets/lfs-print.xsl index.xml
     33        sed -i -e "s/inherit/all/" lfs-print.fo
     34        fop.sh lfs-print.fo lfs-print.pdf
     35
    2836validate:
    2937        xmllint --noout --nonet --xinclude --postvalid index.xml
  • chapter01/changelog.xml

    rff979cd r11b36cd  
    7474</listitem>
    7575
     76<listitem><para>May 7th, 2004 [matt]: Merged Manuel's lfs-xsl-0.9 patches</para>
     77</listitem>
    7678<listitem><para>May 7th, 2004 [matt]: Fixed README error regarding invocation of
    7779`make`</para></listitem>
  • stylesheets/lfs-chunked.xsl

    rff979cd r11b36cd  
    1 <?xml version='1.0'?>
     1<?xml version='1.0' encoding='ISO-8859-1'?>
     2
     3<!-- Version 0.9 - Manuel Canales Esparcia <macana@lfs-es.org>
     4Based on the original lfs-chunked.xsl created by Matthew Burgess -->
     5
    26<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    37                xmlns="http://www.w3.org/1999/xhtml"
    48                version="1.0">
    59
    6   <!-- We use XHTML -->
     10        <!-- We use XHTML -->
    711  <xsl:import href="http://docbook.sourceforge.net/release/xsl/1.65.1/xhtml/chunk.xsl"/>
    812  <xsl:param name="chunker.output.encoding" select="'ISO-8859-1'"/>
     13 
     14        <!-- Including our others customized templates -->
     15  <xsl:include href="xhtml/lfs-admon.xsl"/>
     16  <xsl:include href="xhtml/lfs-index.xsl"/>
     17  <xsl:include href="xhtml/lfs-legalnotice.xsl"/>
     18  <xsl:include href="xhtml/lfs-mixed.xsl"/>
     19  <xsl:include href="xhtml/lfs-navigational.xsl"/>
     20  <xsl:include href="xhtml/lfs-titles.xsl"/>
     21  <xsl:include href="xhtml/lfs-toc.xsl"/>
    922
    10   <!-- The CSS Stylesheet -->
     23        <!-- The CSS Stylesheet -->
    1124  <xsl:param name="html.stylesheet" select="'../stylesheets/lfs.css'"/>
    1225
    13   <!-- Include our customised templates -->
    14   <xsl:include href="xhtml/lfs-toc.xsl"/>
    15   <xsl:include href="xhtml/lfs-index.xsl"/>
    16 
    17   <!-- Use graphics in admonitions -->
    18   <xsl:param name="admon.graphics" select="1"/>
    19   <xsl:param name="admon.graphics.path">../images/</xsl:param>
    20   <xsl:param name="admon.graphics.extension" select="'.png'"/>
    21 
    22   <!-- Legal Notice stuff -->
    23   <xsl:param name="generate.legalnotice.link" select="1"/>
    24   <xsl:template match="legalnotice" mode="titlepage.mode">
    25     <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
    26     <xsl:choose>
    27       <xsl:when test="$generate.legalnotice.link != 0">
    28         <xsl:variable name="filename">
    29           <xsl:call-template name="make-relative-filename">
    30             <xsl:with-param name="base.dir" select="''"/>
    31             <xsl:with-param name="base.name" select="concat($base.dir, 'prologue/legalnotice.html')"/>
    32           </xsl:call-template>
    33         </xsl:variable>
    34         <xsl:variable name="title">
    35           <xsl:apply-templates select="." mode="title.markup"/>
    36         </xsl:variable>
    37         <xsl:element name="a">
    38           <xsl:attribute name="href">
    39             <xsl:value-of select="'prologue/legalnotice.html'"/>
    40           </xsl:attribute>
    41           <xsl:copy-of select="$title"/>
    42         </xsl:element>
    43         <xsl:call-template name="write.chunk">
    44           <xsl:with-param name="filename" select="$filename"/>
    45           <xsl:with-param name="quiet" select="$chunk.quietly"/>
    46           <xsl:with-param name="content">
    47             <html>
    48               <head>
    49                 <xsl:call-template name="system.head.content"/>
    50                 <xsl:call-template name="head.content"/>
    51                 <xsl:call-template name="user.head.content"/>
    52               </head>
    53               <body>
    54                 <xsl:call-template name="body.attributes"/>
    55                 <div class="{local-name(.)}">
    56                   <xsl:apply-templates mode="titlepage.mode"/>
    57                 </div>
    58               </body>
    59             </html>
    60           </xsl:with-param>
    61         </xsl:call-template>
    62       </xsl:when>
    63       <xsl:otherwise>
    64         <div class="{local-name(.)}">
    65           <xsl:apply-templates mode="titlepage.mode"/>
    66         </div>
    67       </xsl:otherwise>
    68     </xsl:choose>
    69   </xsl:template>
    70 
    71   <!--TOC stuff-->
    72   <xsl:param name="generate.toc">
    73     appendix  toc
    74     book      toc,title,figure,table,example,equation
    75     chapter   nop
    76     part      toc
    77     preface   nop
    78     qandadiv  nop
    79     qandaset  nop 
    80     reference nop
    81     sect1     nop
    82     sect2     nop
    83     sect3     nop
    84     sect4     nop
    85     sect5     nop
    86     section   nop
    87     set       nop
    88   </xsl:param>
    89   <xsl:param name="toc.section.depth">1</xsl:param>
    90   <xsl:param name="toc.max.depth">3</xsl:param>
     26        <!-- Dropping some unwanted style attributes -->
     27  <xsl:param name="ulink.target" select="''"></xsl:param>
     28  <xsl:param name="css.decoration" select="0"></xsl:param>
     29 
     30        <!-- No XML declaration -->
     31        <xsl:param name="chunker.output.omit-xml-declaration" select="'yes'"/>
    9132
    9233</xsl:stylesheet>
  • stylesheets/lfs-pdf.xsl

    rff979cd r11b36cd  
    1 <?xml version='1.0'?>
     1<?xml version='1.0' encoding='ISO-8859-1'?>
     2
     3<!-- Version 0.9 - Manuel Canales Esparcia <macana@lfs-es.org>
     4Based on the original lfs-pdf.xsl created by Matthew Burgess -->
     5
    26<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    37                xmlns:fo="http://www.w3.org/1999/XSL/Format"
    4                 xmlns="http://www.w3.org/1999/xhtml"
    58                version="1.0">
    69
     
    912  <xsl:param name="fop.extensions" select="1"/>
    1013  <xsl:param name="draft.mode" select="'no'"/>
     14
     15  <!-- Including our others customized templates -->
     16  <xsl:include href="pdf/lfs-index.xsl"/>
     17  <xsl:include href="pdf/lfs-pagesetup.xsl"/>
     18
    1119  <!-- Probably want to make the paper size configurable -->
    1220  <xsl:param name="paper.type" select="'A4'"/>
    1321
    14   <!-- Include our customised templates -->
    15   <xsl:include href="pdf/lfs-index.xsl"/>
     22  <!-- Don't hyphenate -->
     23  <xsl:param name="hyphenate">false</xsl:param>
     24  <xsl:param name="alignment">left</xsl:param>
    1625
    1726  <!-- Font size -->
     
    1928  <xsl:param name="body.font.size">10pt</xsl:param>
    2029
    21   <!-- Margins -->
    22   <xsl:param name="page.margin.inner">1in</xsl:param>
    23   <xsl:param name="page.margin.outer">0.5in</xsl:param>
    24   <xsl:param name="title.margin.left">-1pc</xsl:param>
     30  <!-- Graphics in admonitions -->
     31  <xsl:param name="admon.graphics" select="1"/>
     32  <xsl:param name="admon.graphics.path"
     33    select="'/usr/share/xml/docbook/xsl-stylesheets-1.65.1/images/'"/>
    2534
    26   <!-- TOC stuff -->
     35  <!-- Shade screen -->
     36  <xsl:param name="shade.verbatim" select="1"/>
     37
     38  <!-- TOC generation -->
    2739  <xsl:param name="generate.toc">
    2840    book      toc
     
    3042  </xsl:param>
    3143  <xsl:param name="toc.section.depth">1</xsl:param>
    32   <xsl:param name="generate.section.toc.level" select="-1"></xsl:param>
    33   <xsl:param name="toc.indent.width" select="18"></xsl:param>
    34 
    35   <!-- Force section1's onto a new page -->
    36   <xsl:attribute-set name="section.level1.properties">
    37     <xsl:attribute name="break-after">page</xsl:attribute>
    38   </xsl:attribute-set>
    39 
    40   <!-- Columns in appendix -->
    41   <xsl:param name="column.count.back" select="2"/>
    42 
    43   <!-- Don't hyphenate -->
    44   <xsl:param name="hyphenate">false</xsl:param>
    45   <xsl:param name="alignment">left</xsl:param>
     44  <xsl:param name="generate.section.toc.level" select="-1"/>
     45  <xsl:param name="toc.indent.width" select="18"/>
    4646
    4747  <!-- Page number in Xref-->
    4848  <xsl:param name="insert.xref.page.number">yes</xsl:param>
    49   <xsl:template match="xref" name="xref">
    50     <xsl:variable name="targets" select="key('id',@linkend)"/>
    51     <xsl:variable name="target" select="$targets[1]"/>
    52     <xsl:variable name="refelem" select="local-name($target)"/>
    53     <xsl:call-template name="check.id.unique">
    54       <xsl:with-param name="linkend" select="@linkend"/>
    55     </xsl:call-template>
    56     <xsl:choose>
    57       <xsl:when test="$refelem=''">
    58         <xsl:message>
    59           <xsl:text>XRef to nonexistent id: </xsl:text>
    60           <xsl:value-of select="@linkend"/>
    61         </xsl:message>
    62         <xsl:text>???</xsl:text>
    63       </xsl:when>
    64       <xsl:when test="@endterm">
    65         <fo:basic-link internal-destination="{@linkend}"
    66                        xsl:use-attribute-sets="xref.properties">
    67           <xsl:variable name="etargets" select="key('id',@endterm)"/>
    68           <xsl:variable name="etarget" select="$etargets[1]"/>
    69           <xsl:choose>
    70             <xsl:when test="count($etarget) = 0">
    71               <xsl:message>
    72                 <xsl:value-of select="count($etargets)"/>
    73                 <xsl:text>Endterm points to nonexistent ID: </xsl:text>
    74                 <xsl:value-of select="@endterm"/>
    75               </xsl:message>
    76               <xsl:text>???</xsl:text>
    77             </xsl:when>
    78             <xsl:otherwise>
    79               <xsl:apply-templates select="$etarget" mode="endterm"/>
    80             </xsl:otherwise>
    81           </xsl:choose>
    82         </fo:basic-link>
    83       </xsl:when>
    84       <xsl:when test="$target/@xreflabel">
    85         <fo:basic-link internal-destination="{@linkend}"
    86                        xsl:use-attribute-sets="xref.properties">
    87           <xsl:call-template name="xref.xreflabel">
    88             <xsl:with-param name="target" select="$target"/>
    89           </xsl:call-template>
    90         </fo:basic-link>
    91       </xsl:when>
    92       <xsl:otherwise>
    93         <fo:basic-link internal-destination="{@linkend}"
    94                        xsl:use-attribute-sets="xref.properties">
    95           <xsl:apply-templates select="$target" mode="xref-to">
    96             <xsl:with-param name="referrer" select="."/>
    97             <xsl:with-param name="xrefstyle">
    98               <xsl:choose>
    99                 <xsl:when test="@role and not(@xrefstyle) and $use.role.as.xrefstyle != 0">
    100                   <xsl:value-of select="@role"/>
    101                 </xsl:when>
    102                 <xsl:otherwise>
    103                   <xsl:value-of select="@xrefstyle"/>
    104                 </xsl:otherwise>
    105               </xsl:choose>
    106             </xsl:with-param>
    107           </xsl:apply-templates>
    108         </fo:basic-link>
    109       </xsl:otherwise>
    110     </xsl:choose>
    111     <xsl:if test="not(starts-with(normalize-space(@xrefstyle), 'select:') != ''
    112                   and (contains(@xrefstyle, 'page')
    113                    or contains(@xrefstyle, 'Page')))
    114                   and ( $insert.xref.page.number = 'yes'
    115                    or $insert.xref.page.number = '1')
    116                    or local-name($target) = 'para'">
    117       <fo:basic-link internal-destination="{@linkend}"
    118                      xsl:use-attribute-sets="xref.properties">
    119         <xsl:text>, p. </xsl:text>
    120         <xsl:apply-templates select="$target" mode="page.citation">
    121           <xsl:with-param name="id" select="@linkend"/>
    122         </xsl:apply-templates>
    123       </fo:basic-link>
    124     </xsl:if>
     49  <xsl:template match="*" mode="page.citation">
     50    <xsl:param name="id" select="'???'"/>
     51    <fo:inline keep-together.within-line="always">
     52      <xsl:text>[p.</xsl:text>
     53      <fo:page-number-citation ref-id="{$id}"/>
     54      <xsl:text>]</xsl:text>
     55    </fo:inline>
    12556  </xsl:template>
    12657
  • stylesheets/lfs.css

    rff979cd r11b36cd  
    11body {
    22  font-weight: normal;
    3   font-size: normal;
     3  font-size: medium;
    44  font-family: verdana, tahoma, helvetica, arial, sans-serif;
    55  text-align: left;
    66}
    77
    8 div.navheader table {
    9     font-size: smaller;
     8.toc ul, .index ul {
     9        list-style: none;
    1010}
    1111
    12 div.navfooter table {
    13     font-size: smaller;
     12.navheader, .navfooter {
     13  font-size: smaller;
     14  text-align: center;
    1415}
    1516
    16 div.navheader img {
    17     border: medium none;
     17div.navheader ul li, div.navfooter ul li {
     18        display: inline;
     19  padding: 4em;
    1820}
    1921
    20 div.navfooter img {
    21     border: medium none;
     22li.preface {
     23        margin-left: 2.5em;
    2224}
    2325
     
    6971}
    7072
    71 div.warning {
    72     border: 1px solid;
     73div.admonition {
     74  border: medium solid;
     75  width: 90%;
     76  margin: .5em auto;
    7377}
    7478
    75 div.note {
    76     border: 1px solid;
     79div.admonhead h3 {
     80        display: inline;
     81        margin-left: 1.5em;
    7782}
    7883
    79 div.important {
    80     border: 1px solid;
    81 }
    82 
    83 div.caution {
    84     border: 1px solid;
    85 }
    86 
    87 div.warning h3.title {
    88     text-align: center
    89 }
    90 
    91 div.warning p {
    92     padding-left: 0.2in
    93 }
    94 
    95 div.note {
    96     padding-left: 0.2in
    97 }
    98 
    99 div.important {
    100     padding-left: 0.2in
    101 }
    102 
    103 div.caution {
    104     padding-left: 0.2in
     84div.admonbody {
     85        margin: .5em;
    10586}
    10687
     
    119100    float: left;
    120101}
    121 
    122 .toc ul, .index ul, .navheader ul, .navfooter ul {
    123         list-style: none;
    124 }
  • stylesheets/pdf/lfs-index.xsl

    rff979cd r11b36cd  
    44<!ENTITY uppercase "'ABCDEFGHIJKLMNOPQRSTUVWXYZ'">
    55<!ENTITY primary   'normalize-space(concat(primary/@sortas, primary[not(@sortas)]))'>
     6<!ENTITY secondary 'normalize-space(concat(secondary/@sortas, secondary[not(@sortas)]))'>
    67<!ENTITY scope 'count(ancestor::node()|$scope) = count(ancestor::node())'>
     8<!ENTITY sep '" "'>
    79]>
    810
    9 <!-- Version 0.8.0 - Manuel Canales Esparcia <macana@lfs-es.org> -->
     11<!-- Version 0.9 - Manuel Canales Esparcia <macana@lfs-es.org> -->
    1012
    1113<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     
    1315                version="1.0">
    1416
    15 <!--Index Stuff-->
    16 
    17         <!--Only one column to fit the targets titles-->
    18   <xsl:param name="column.count.index" select="1"></xsl:param>
     17        <!--Only one column to fit the table layout-->
     18  <xsl:param name="column.count.index" select="1"/>
    1919
    2020    <!--Title-->
    2121  <xsl:template match="index" mode="title.markup">
    22         <xsl:param name="allow-anchors" select="0"/>
    2322    <xsl:text>Index of packages and important installed files</xsl:text>
    2423        </xsl:template>
     
    3938                <xsl:when test="$divtitle = 'A'">
    4039                  <xsl:text>Packages</xsl:text>
    41               </xsl:when>
    42               <xsl:when test="$divtitle = 'B'">
    43                   <xsl:text>Programs</xsl:text>
    44               </xsl:when>
    45               <xsl:when test="$divtitle = 'C'">
    46                   <xsl:text>Libraries</xsl:text>
    47               </xsl:when>
    48               <xsl:when test="$divtitle = 'D'">
    49                   <xsl:text>Scripts</xsl:text>
    50               </xsl:when>
    51               <xsl:when test="$divtitle = 'E'">
    52                   <xsl:text>Others</xsl:text>
    53               </xsl:when>
    54               <xsl:otherwise>
    55                 <xsl:value-of select="$divtitle"/>
    56               </xsl:otherwise>
    57             </xsl:choose>
     40                </xsl:when>
     41                <xsl:when test="$divtitle = 'B'">
     42                    <xsl:text>Programs</xsl:text>
     43                </xsl:when>
     44                <xsl:when test="$divtitle = 'C'">
     45                    <xsl:text>Libraries</xsl:text>
     46                </xsl:when>
     47                <xsl:when test="$divtitle = 'D'">
     48                    <xsl:text>Scripts</xsl:text>
     49                </xsl:when>
     50                <xsl:when test="$divtitle = 'E'">
     51                    <xsl:text>Others</xsl:text>
     52                </xsl:when>
     53                <xsl:otherwise>
     54                  <xsl:value-of select="$divtitle"/>
     55                </xsl:otherwise>
     56                </xsl:choose>
    5857            </xsl:with-param>
    5958          </xsl:call-template>
    6059        </xsl:if>
    61         <fo:block>
    62           <xsl:apply-templates select="key('letter', $key)[&scope;]
    63                                       [count(.|key('primary', &primary;)[&scope;][1])=1]"
    64                               mode="index-primary">
    65             <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
    66             <xsl:with-param name="scope" select="$scope"/>
    67           </xsl:apply-templates>
    68         </fo:block>
     60        <fo:table table-layout="fixed" width="100%">
     61                <fo:table-column column-number="1" column-width="11em"/>
     62                <fo:table-column column-number="2" column-width="19em"/>
     63                <fo:table-column column-number="3"/>
     64          <fo:table-body>
     65            <xsl:apply-templates select="key('letter', $key)[&scope;]
     66                                        [count(.|key('primary', &primary;)[&scope;][1])=1]"
     67                                mode="index-primary">
     68              <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
     69              <xsl:with-param name="scope" select="$scope"/>
     70            </xsl:apply-templates>
     71                </fo:table-body>
     72        </fo:table>
    6973      </fo:block>
    7074    </xsl:if>
    7175  </xsl:template>
    7276
    73         <!-- The separator -->
     77        <!-- Dropping the separator from here -->
    7478  <xsl:template match="indexterm" mode="reference">
    7579    <xsl:param name="scope" select="."/>
    76     <xsl:text>: </xsl:text>
    7780        <xsl:call-template name="reference">
    7881        <xsl:with-param name="zones" select="normalize-space(@zone)"/>
    7982        <xsl:with-param name="scope" select="$scope"/>
    8083      </xsl:call-template>
     84  </xsl:template>
     85
     86        <!-- Changing the output tags and re-addind the separator-->
     87  <xsl:template match="indexterm" mode="index-primary">
     88    <xsl:param name="scope" select="."/>
     89    <xsl:variable name="key" select="&primary;"/>
     90    <xsl:variable name="refs" select="key('primary', $key)[&scope;]"/>
     91    <fo:table-row>
     92        <fo:table-cell>
     93        <fo:block>
     94          <xsl:value-of select="primary"/>
     95          <xsl:text>: </xsl:text>
     96                                </fo:block>
     97      </fo:table-cell>
     98      <xsl:for-each select="$refs[not(see) and not(seealso)
     99                            and not(secondary)]">
     100        <xsl:apply-templates select="." mode="reference">
     101          <xsl:with-param name="scope" select="$scope"/>
     102        </xsl:apply-templates>
     103      </xsl:for-each>
     104                </fo:table-row>
     105                <xsl:if test="$refs/secondary">
     106      <xsl:apply-templates select="$refs[secondary and count(.|key('secondary',
     107                                concat($key, &sep;, &secondary;))[&scope;][1]) = 1]" mode="index-secondary">
     108                                <xsl:with-param name="scope" select="$scope"/>
     109                                <xsl:sort select="translate(&secondary;, &lowercase;, &uppercase;)"/>
     110                        </xsl:apply-templates>
     111                </xsl:if>
     112  </xsl:template>
     113
     114  <xsl:template match="indexterm" mode="index-secondary">
     115    <xsl:param name="scope" select="."/>
     116                <xsl:variable name="key" select="concat(&primary;, &sep;, &secondary;)"/>
     117    <xsl:variable name="refs" select="key('secondary', $key)[&scope;]"/>
     118    <fo:table-row>
     119        <fo:table-cell>
     120                    <fo:block start-indent="1pc">
     121          <xsl:value-of select="secondary"/>
     122          <xsl:text>: </xsl:text>
     123        </fo:block>
     124        </fo:table-cell>
     125      <xsl:for-each select="$refs[not(see) and not(seealso) and not(tertiary)]">
     126        <xsl:apply-templates select="." mode="reference">
     127          <xsl:with-param name="scope" select="$scope"/>
     128        </xsl:apply-templates>
     129      </xsl:for-each>
     130                </fo:table-row>
    81131  </xsl:template>
    82132 
     
    101151          </xsl:call-template>
    102152        </xsl:variable>
    103         <fo:basic-link internal-destination="{$id}">
    104           <xsl:value-of select="$target/title"/>
    105           <xsl:apply-templates select="$target" mode="page.citation">
    106                 <xsl:with-param name="id" select="$id"/>
    107           </xsl:apply-templates>
    108         </fo:basic-link>
    109           <xsl:text>, </xsl:text>
    110         <fo:basic-link internal-destination="{$id2}">
    111                 <xsl:text>description</xsl:text>
    112           <xsl:apply-templates select="$target2" mode="page.citation">
    113                 <xsl:with-param name="id" select="$id2"/>
    114           </xsl:apply-templates>
    115         </fo:basic-link>
     153        <fo:table-cell>
     154                <fo:block>
     155            <fo:basic-link internal-destination="{$id}">
     156              <xsl:value-of select="$target/title"/>
     157              <xsl:apply-templates select="$target" mode="page.citation">
     158                <xsl:with-param name="id" select="$id"/>
     159              </xsl:apply-templates>
     160            </fo:basic-link>
     161                </fo:block>
     162                                </fo:table-cell>
     163        <fo:table-cell>
     164                <fo:block>
     165            <fo:basic-link internal-destination="{$id2}">
     166              <xsl:text>description</xsl:text>
     167              <xsl:apply-templates select="$target2" mode="page.citation">
     168                <xsl:with-param name="id" select="$id2"/>
     169              </xsl:apply-templates>
     170            </fo:basic-link>
     171                </fo:block>
     172                                </fo:table-cell>
    116173      </xsl:when>
    117174      <xsl:otherwise>
     
    123180          </xsl:call-template>
    124181        </xsl:variable>
    125         <fo:basic-link internal-destination="{$id}">
    126           <xsl:value-of select="$target/title"/>
    127           <xsl:apply-templates select="$target" mode="page.citation">
    128                 <xsl:with-param name="id" select="$id"/>
    129           </xsl:apply-templates>
    130         </fo:basic-link>
     182        <fo:table-cell>
     183                <fo:block>
     184            <fo:basic-link internal-destination="{$id}">
     185              <xsl:value-of select="$target/title"/>
     186              <xsl:apply-templates select="$target" mode="page.citation">
     187                <xsl:with-param name="id" select="$id"/>
     188              </xsl:apply-templates>
     189            </fo:basic-link>
     190                </fo:block>
     191                                </fo:table-cell>
    131192      </xsl:otherwise>
    132193    </xsl:choose>
  • stylesheets/xhtml/lfs-index.xsl

    rff979cd r11b36cd  
    77]>
    88
    9 <!-- Version 0.8.0 - Manuel Canales Esparcia <macana@lfs-es.org> -->
     9<!-- Version 0.9 - Manuel Canales Esparcia <macana@lfs-es.org> -->
    1010
    1111<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    1212                xmlns="http://www.w3.org/1999/xhtml"
    1313                version="1.0">
    14 
    15         <!--Index Stuff-->
    1614
    1715    <!--Filename-->
     
    2119
    2220    <!--Title-->
     21  <xsl:param name="index-title">Index of packages and important installed files</xsl:param>
     22 
    2323  <xsl:template match="index" mode="title.markup">
    24         <xsl:param name="allow-anchors" select="0"/>
    25     <xsl:text>Index of packages and important installed files</xsl:text>
     24    <xsl:value-of select="$index-title"/>
    2625        </xsl:template>
     26 
     27  <xsl:template name="index.titlepage">
     28    <div class="titlepage">
     29        <h1 class="index">
     30                <xsl:value-of select="$index-title"/>
     31                        </h1>
     32    </div>
     33  </xsl:template>
    2734
    2835        <!--Divisions-->
     
    110117    </li>
    111118  </xsl:template>
     119
    112120  <xsl:template match="indexterm" mode="index-secondary">
    113121    <xsl:param name="scope" select="."/>
     
    174182    </xsl:choose>
    175183  </xsl:template>
     184 
     185    <!-- Dropping unneeded anchors -->
     186  <xsl:template match="indexterm"/>
    176187
    177188</xsl:stylesheet>
  • stylesheets/xhtml/lfs-toc.xsl

    rff979cd r11b36cd  
    11<?xml version='1.0' encoding='ISO-8859-1'?>
    22
    3 <!-- Version 0.8.0 - Manuel Canales Esparcia <macana@lfs-es.org> -->
     3<!-- Version 0.9 - Manuel Canales Esparcia <macana@lfs-es.org> -->
    44
    55<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    66                xmlns="http://www.w3.org/1999/xhtml"
    77                version="1.0">
    8 
    9 
    10 <!--TOC stuff-->
     8               
     9                <!-- General settings -->
    1110  <xsl:param name="generate.toc">
    1211    appendix  toc
     
    3029
    3130  <xsl:param name="toc.max.depth">3</xsl:param>
    32 
    33     <!-- Type of list-->
    34   <xsl:param name="toc.list.type">ul</xsl:param>
     31 
     32        <!-- Making the TOC -->
     33        <xsl:template name="make.toc">
     34    <xsl:param name="toc-context" select="."/>
     35    <xsl:param name="nodes" select="/NOT-AN-ELEMENT"/>
     36    <xsl:if test="$nodes">
     37      <div class="toc">
     38        <h3>
     39          <xsl:call-template name="gentext">
     40            <xsl:with-param name="key">TableofContents</xsl:with-param>
     41          </xsl:call-template>
     42        </h3>
     43        <ul>
     44          <xsl:apply-templates select="$nodes" mode="toc">
     45            <xsl:with-param name="toc-context" select="$toc-context"/>
     46          </xsl:apply-templates>
     47        </ul>
     48      </div>
     49    </xsl:if>
     50  </xsl:template>
     51       
     52    <!-- Making the subtocs -->
     53  <xsl:template name="subtoc">
     54    <xsl:param name="toc-context" select="."/>
     55    <xsl:param name="nodes" select="NOT-AN-ELEMENT"/>
     56    <xsl:variable name="subtoc">
     57      <ul>
     58        <xsl:apply-templates mode="toc" select="$nodes">
     59          <xsl:with-param name="toc-context" select="$toc-context"/>
     60        </xsl:apply-templates>
     61      </ul>
     62    </xsl:variable>
     63    <xsl:variable name="depth">
     64      <xsl:choose>
     65        <xsl:when test="local-name(.) = 'sect1'">1</xsl:when>
     66        <xsl:otherwise>0</xsl:otherwise>
     67      </xsl:choose>
     68    </xsl:variable>
     69    <xsl:variable name="depth.from.context"
     70            select="count(ancestor::*)-count($toc-context/ancestor::*)"/>
     71    <li class="{name(.)}">
     72      <xsl:call-template name="toc.line">
     73        <xsl:with-param name="toc-context" select="$toc-context"/>
     74      </xsl:call-template>
     75      <xsl:if test="$toc.section.depth &gt; $depth and count($nodes)&gt;0
     76                                and $toc.max.depth &gt; $depth.from.context">
     77        <xsl:copy-of select="$subtoc"/>
     78      </xsl:if>
     79    </li>
     80  </xsl:template>
    3581
    3682    <!--Adding the h* tags and dropping redundats links-->
     
    4187    <xsl:choose>
    4288      <xsl:when test="local-name(.) = 'sect1'">
    43         <span>
    44           <xsl:attribute name="class"><xsl:value-of select="local-name(.)"/></xsl:attribute>
    45           <a>
     89        <a>
     90          <xsl:attribute name="href">
     91            <xsl:call-template name="href.target">
     92              <xsl:with-param name="context" select="$toc-context"/>
     93            </xsl:call-template>
     94          </xsl:attribute>
     95          <xsl:apply-templates select="." mode="titleabbrev.markup"/>
     96        </a>
     97      </xsl:when>
     98      <xsl:when test="local-name(.) = 'chapter' or local-name(.) = 'preface'">
     99        <h4>
     100          <xsl:variable name="label">
     101            <xsl:apply-templates select="." mode="label.markup"/>
     102          </xsl:variable>
     103          <xsl:copy-of select="$label"/>
     104          <xsl:if test="$label != ''">
     105            <xsl:value-of select="$autotoc.label.separator"/>
     106          </xsl:if>
     107          <xsl:apply-templates select="." mode="titleabbrev.markup"/>
     108        </h4>
     109      </xsl:when>
     110      <xsl:when test="local-name(.) = 'part'">
     111        <h3>
     112          <xsl:variable name="label">
     113            <xsl:apply-templates select="." mode="label.markup"/>
     114          </xsl:variable>
     115          <xsl:copy-of select="$label"/>
     116          <xsl:if test="$label != ''">
     117            <xsl:value-of select="$autotoc.label.separator"/>
     118          </xsl:if>
     119          <xsl:apply-templates select="." mode="titleabbrev.markup"/>
     120        </h3>
     121      </xsl:when>
     122      <xsl:otherwise>
     123        <h3>
     124            <a>
    46125            <xsl:attribute name="href">
    47126              <xsl:call-template name="href.target">
     
    49128              </xsl:call-template>
    50129            </xsl:attribute>
    51             <xsl:apply-templates select="." mode="titleabbrev.markup"/>
    52           </a>
    53         </span>
    54       </xsl:when>
    55       <xsl:when test="local-name(.) = 'chapter' or local-name(.) = 'preface'">
    56         <h4>
    57           <span>
    58             <xsl:attribute name="class"><xsl:value-of select="local-name(.)"/></xsl:attribute>
    59130            <xsl:variable name="label">
    60131              <xsl:apply-templates select="." mode="label.markup"/>
     
    65136            </xsl:if>
    66137            <xsl:apply-templates select="." mode="titleabbrev.markup"/>
    67           </span>
    68         </h4>
    69       </xsl:when>
    70       <xsl:when test="local-name(.) = 'part'">
    71         <h3>
    72           <span>
    73             <xsl:attribute name="class"><xsl:value-of select="local-name(.)"/></xsl:attribute>
    74             <xsl:variable name="label">
    75               <xsl:apply-templates select="." mode="label.markup"/>
    76             </xsl:variable>
    77             <xsl:copy-of select="$label"/>
    78             <xsl:if test="$label != ''">
    79               <xsl:value-of select="$autotoc.label.separator"/>
    80             </xsl:if>
    81             <xsl:apply-templates select="." mode="titleabbrev.markup"/>
    82           </span>
    83         </h3>
    84       </xsl:when>
    85       <xsl:otherwise>
    86         <h3>
    87           <span>
    88             <xsl:attribute name="class"><xsl:value-of select="local-name(.)"/></xsl:attribute>
    89             <a>
    90               <xsl:attribute name="href">
    91                 <xsl:call-template name="href.target">
    92                   <xsl:with-param name="context" select="$toc-context"/>
    93                 </xsl:call-template>
    94               </xsl:attribute>
    95               <xsl:variable name="label">
    96                 <xsl:apply-templates select="." mode="label.markup"/>
    97               </xsl:variable>
    98               <xsl:copy-of select="$label"/>
    99               <xsl:if test="$label != ''">
    100                 <xsl:value-of select="$autotoc.label.separator"/>
    101               </xsl:if>
    102               <xsl:apply-templates select="." mode="titleabbrev.markup"/>
    103             </a>
    104           </span>
     138          </a>
    105139        </h3>
    106140      </xsl:otherwise>
Note: See TracChangeset for help on using the changeset viewer.