Ignore:
Timestamp:
12/10/2013 11:37:38 PM (11 years ago)
Author:
Krejzi <krejzi@…>
Branches:
7.5-systemd, 7.6-systemd, 7.7-systemd, 7.8-systemd, 7.9-systemd
Children:
112db9d
Parents:
f2a5108
Message:

Import new branch

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

File:
1 moved

Legend:

Unmodified
Added
Removed
  • stylesheets/lfs-xsl/docbook-xsl-1.78.1/xhtml/autotoc.xsl

    rf2a5108 rb1a51ac1  
    55
    66<!-- ********************************************************************
    7      $Id$
     7     $Id: autotoc.xsl 9692 2012-12-16 02:31:34Z dcramer $
    88     ********************************************************************
    99
     
    3838  <xsl:variable name="toc.title">
    3939    <xsl:if test="$toc.title.p">
    40       <p>
    41         <b>
    42           <xsl:call-template name="gentext">
    43             <xsl:with-param name="key">TableofContents</xsl:with-param>
    44           </xsl:call-template>
    45         </b>
    46       </p>
     40      <xsl:choose>
     41        <xsl:when test="$make.clean.html != 0">
     42          <div class="toc-title">
     43            <xsl:call-template name="gentext">
     44              <xsl:with-param name="key">TableofContents</xsl:with-param>
     45            </xsl:call-template>
     46          </div>
     47        </xsl:when>
     48        <xsl:otherwise>
     49          <p>
     50            <strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">
     51              <xsl:call-template name="gentext">
     52                <xsl:with-param name="key">TableofContents</xsl:with-param>
     53              </xsl:call-template>
     54            </strong>
     55          </p>
     56        </xsl:otherwise>
     57      </xsl:choose>
    4758    </xsl:if>
    4859  </xsl:variable>
     
    5970          <xsl:copy-of select="$toc.title"/>
    6071          <xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml">
     72            <xsl:call-template name="toc.list.attributes">
     73              <xsl:with-param name="toc-context" select="$toc-context"/>
     74              <xsl:with-param name="toc.title.p" select="$toc.title.p"/>
     75              <xsl:with-param name="nodes" select="$nodes"/>
     76            </xsl:call-template>
    6177            <xsl:call-template name="manual-toc">
    6278              <xsl:with-param name="tocentry" select="$tocentry/*[1]"/>
     
    7389              <xsl:copy-of select="$toc.title"/>
    7490              <xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml">
     91                <xsl:call-template name="toc.list.attributes">
     92                  <xsl:with-param name="toc-context" select="$toc-context"/>
     93                  <xsl:with-param name="toc.title.p" select="$toc.title.p"/>
     94                  <xsl:with-param name="nodes" select="$nodes"/>
     95                </xsl:call-template>
    7596                <xsl:apply-templates select="$nodes.plus" mode="toc">
    7697                  <xsl:with-param name="toc-context" select="$toc-context"/>
     
    85106              <xsl:copy-of select="$toc.title"/>
    86107              <xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml">
     108                <xsl:call-template name="toc.list.attributes">
     109                  <xsl:with-param name="toc-context" select="$toc-context"/>
     110                  <xsl:with-param name="toc.title.p" select="$toc.title.p"/>
     111                  <xsl:with-param name="nodes" select="$nodes"/>
     112                </xsl:call-template>
    87113                <xsl:apply-templates select="$nodes" mode="toc">
    88114                  <xsl:with-param name="toc-context" select="$toc-context"/>
     
    98124</xsl:template>
    99125
     126<xsl:template name="toc.list.attributes">
     127  <xsl:param name="toc-context" select="."/>
     128  <xsl:param name="toc.title.p" select="true()"/>
     129  <xsl:param name="nodes" select="/NOT-AN-ELEMENT"/>
     130
     131  <xsl:attribute name="class">toc</xsl:attribute>
     132</xsl:template>
     133
    100134<xsl:template name="make.lots">
    101135  <xsl:param name="toc.params" select="''"/>
     
    116150    <xsl:call-template name="list.of.titles">
    117151      <xsl:with-param name="titles" select="'table'"/>
    118       <xsl:with-param name="nodes" select=".//table"/>
     152      <xsl:with-param name="nodes" select=".//table[not(@tocentry = 0)]"/>
    119153    </xsl:call-template>
    120154  </xsl:if>
     
    151185    <xsl:with-param name="toc-context" select="$toc-context"/>
    152186    <xsl:with-param name="toc.title.p" select="$toc.title.p"/>
    153     <xsl:with-param name="nodes" select="book|setindex"/>
     187    <xsl:with-param name="nodes" select="book|setindex|set"/>
    154188  </xsl:call-template>
    155189</xsl:template>
     
    162196    <xsl:with-param name="toc-context" select="$toc-context"/>
    163197    <xsl:with-param name="toc.title.p" select="$toc.title.p"/>
    164     <xsl:with-param name="nodes" select="part|reference                                          |preface|chapter|appendix                                          |article                                          |bibliography|glossary|index                                          |refentry                                          |bridgehead[$bridgehead.in.toc != 0]"/>
     198    <xsl:with-param name="nodes" select="part|reference                                          |preface|chapter|appendix                                          |article                                          |topic                                          |bibliography|glossary|index                                          |refentry                                          |bridgehead[$bridgehead.in.toc != 0]"/>
    165199
    166200  </xsl:call-template>
     
    174208    <xsl:with-param name="toc-context" select="$toc-context"/>
    175209    <xsl:with-param name="toc.title.p" select="$toc.title.p"/>
    176     <xsl:with-param name="nodes" select="section|sect1                                          |simplesect[$simplesect.in.toc != 0]                                          |refentry                                          |article|bibliography|glossary                                          |appendix|index                                          |bridgehead[not(@renderas)                                                      and $bridgehead.in.toc != 0]                                          |.//bridgehead[@renderas='sect1'                                                         and $bridgehead.in.toc != 0]"/>
     210    <xsl:with-param name="nodes" select="section|sect1                                          |simplesect[$simplesect.in.toc != 0]                                          |topic                                          |refentry                                          |article|bibliography|glossary                                          |appendix|index                                          |bridgehead[not(@renderas)                                                      and $bridgehead.in.toc != 0]                                          |.//bridgehead[@renderas='sect1'                                                         and $bridgehead.in.toc != 0]"/>
    177211  </xsl:call-template>
    178212</xsl:template>
     
    237271      <xsl:when test="local-name(.) = 'refsect2'">2</xsl:when>
    238272      <xsl:when test="local-name(.) = 'refsect3'">3</xsl:when>
     273      <xsl:when test="local-name(.) = 'topic'">1</xsl:when>
    239274      <xsl:when test="local-name(.) = 'simplesect'">
    240275        <!-- sigh... -->
     
    248283          <xsl:when test="local-name(..) = 'sect4'">5</xsl:when>
    249284          <xsl:when test="local-name(..) = 'sect5'">6</xsl:when>
     285          <xsl:when test="local-name(..) = 'topic'">2</xsl:when>
    250286          <xsl:when test="local-name(..) = 'refsect1'">2</xsl:when>
    251287          <xsl:when test="local-name(..) = 'refsect2'">3</xsl:when>
     
    277313      <xsl:with-param name="toc-context" select="$toc-context"/>
    278314    </xsl:call-template>
    279     <xsl:if test="$toc.listitem.type = 'li'                   and $toc.section.depth &gt; $depth and                    ( ($qanda.in.toc = 0 and count($nodes)&gt;0) or                     ($qanda.in.toc != 0 and count($nodes.plus)&gt;0) )                   and $toc.max.depth &gt; $depth.from.context">
     315    <xsl:if test="$toc.listitem.type = 'li' and                   ( (self::set or self::book or self::part) or                          $toc.section.depth &gt; $depth) and                    ( ($qanda.in.toc = 0 and count($nodes)&gt;0) or                     ($qanda.in.toc != 0 and count($nodes.plus)&gt;0) )                   and $toc.max.depth &gt; $depth.from.context">
    280316      <xsl:copy-of select="$subtoc.list"/>
    281317    </xsl:if>
    282318  </xsl:element>
    283   <xsl:if test="$toc.listitem.type != 'li'                 and $toc.section.depth &gt; $depth and                  ( ($qanda.in.toc = 0 and count($nodes)&gt;0) or                   ($qanda.in.toc != 0 and count($nodes.plus)&gt;0) )                 and $toc.max.depth &gt; $depth.from.context">
     319  <xsl:if test="$toc.listitem.type != 'li' and                   ( (self::set or self::book or self::part) or                          $toc.section.depth &gt; $depth) and                  ( ($qanda.in.toc = 0 and count($nodes)&gt;0) or                   ($qanda.in.toc != 0 and count($nodes.plus)&gt;0) )                 and $toc.max.depth &gt; $depth.from.context">
    284320    <xsl:copy-of select="$subtoc.list"/>
    285321  </xsl:if>
     
    336372  <xsl:call-template name="subtoc">
    337373    <xsl:with-param name="toc-context" select="$toc-context"/>
    338     <xsl:with-param name="nodes" select="part|reference                                          |preface|chapter|appendix                                          |article                                          |bibliography|glossary|index                                          |refentry                                          |bridgehead[$bridgehead.in.toc != 0]"/>
     374    <xsl:with-param name="nodes" select="part|reference                                          |preface|chapter|appendix                                          |article                                          |topic                                          |bibliography|glossary|index                                          |refentry                                          |bridgehead[$bridgehead.in.toc != 0]"/>
    339375  </xsl:call-template>
    340376</xsl:template>
     
    356392  <xsl:call-template name="subtoc">
    357393    <xsl:with-param name="toc-context" select="$toc-context"/>
    358     <xsl:with-param name="nodes" select="appendix|chapter|article                                          |index|glossary|bibliography                                          |preface|reference|refentry                                          |bridgehead[$bridgehead.in.toc != 0]"/>
    359   </xsl:call-template>
    360 </xsl:template>
    361 
    362 <xsl:template match="preface|chapter|appendix|article" mode="toc">
    363   <xsl:param name="toc-context" select="."/>
    364 
    365   <xsl:call-template name="subtoc">
    366     <xsl:with-param name="toc-context" select="$toc-context"/>
    367     <xsl:with-param name="nodes" select="section|sect1                                          |simplesect[$simplesect.in.toc != 0]                                          |refentry                                          |glossary|bibliography|index                                          |bridgehead[$bridgehead.in.toc != 0]"/>
     394    <xsl:with-param name="nodes" select="appendix|chapter|article|topic                                          |index|glossary|bibliography                                          |preface|reference|refentry                                          |bridgehead[$bridgehead.in.toc != 0]"/>
     395  </xsl:call-template>
     396</xsl:template>
     397
     398<xsl:template match="preface|chapter|appendix|article|topic" mode="toc">
     399  <xsl:param name="toc-context" select="."/>
     400
     401  <xsl:call-template name="subtoc">
     402    <xsl:with-param name="toc-context" select="$toc-context"/>
     403    <xsl:with-param name="nodes" select="section|sect1                                          |simplesect[$simplesect.in.toc != 0]                                          |topic                                          |refentry                                          |glossary|bibliography|index                                          |bridgehead[$bridgehead.in.toc != 0]"/>
    368404  </xsl:call-template>
    369405</xsl:template>
     
    425461  <xsl:call-template name="subtoc">
    426462    <xsl:with-param name="toc-context" select="$toc-context"/>
    427     <xsl:with-param name="nodes" select="section                                          |bridgehead[$bridgehead.in.toc != 0]"/>
     463    <xsl:with-param name="nodes" select="section|refentry                                          |simplesect[$simplesect.in.toc != 0]                                          |bridgehead[$bridgehead.in.toc != 0]"/>
     464  </xsl:call-template>
     465</xsl:template>
     466
     467<xsl:template match="topic" mode="toc">
     468  <xsl:param name="toc-context" select="."/>
     469
     470  <xsl:call-template name="subtoc">
     471    <xsl:with-param name="toc-context" select="$toc-context"/>
     472    <xsl:with-param name="nodes" select="section|refentry                                          |simplesect[$simplesect.in.toc != 0]                                          |bridgehead[$bridgehead.in.toc != 0]"/>
    428473  </xsl:call-template>
    429474</xsl:template>
     
    496541        <!-- * is allowed in refpurpose; so we need to run -->
    497542        <!-- * apply-templates on refpurpose here, instead of value-of  -->
    498         <xsl:apply-templates select="refnamediv/refpurpose"/>
     543        <xsl:apply-templates select="refnamediv/refpurpose" mode="no.anchor.mode"/>
    499544      </xsl:if>
    500545    </span>
     
    519564  <xsl:param name="toc-context" select="."/>
    520565  <xsl:param name="tocentry"/>
     566  <xsl:param name="toc.title.p" select="true()"/>
     567  <xsl:param name="nodes" select="/NOT-AN-ELEMENT"/>
    521568
    522569  <!-- be careful, we don't want to change the current document to the other tree! -->
     
    546593    <xsl:if test="$tocentry/*">
    547594      <xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml">
     595        <xsl:call-template name="toc.list.attributes">
     596          <xsl:with-param name="toc-context" select="$toc-context"/>
     597          <xsl:with-param name="toc.title.p" select="$toc.title.p"/>
     598          <xsl:with-param name="nodes" select="$nodes"/>
     599        </xsl:call-template>
    548600        <xsl:call-template name="manual-toc">
    549601          <xsl:with-param name="tocentry" select="$tocentry/*[1]"/>
     
    569621  <xsl:if test="$nodes">
    570622    <div class="list-of-{$titles}s">
    571       <p>
    572         <b>
    573           <xsl:call-template name="gentext">
    574             <xsl:with-param name="key">
    575               <xsl:choose>
    576                 <xsl:when test="$titles='table'">ListofTables</xsl:when>
    577                 <xsl:when test="$titles='figure'">ListofFigures</xsl:when>
    578                 <xsl:when test="$titles='equation'">ListofEquations</xsl:when>
    579                 <xsl:when test="$titles='example'">ListofExamples</xsl:when>
    580                 <xsl:when test="$titles='procedure'">ListofProcedures</xsl:when>
    581                 <xsl:otherwise>ListofUnknown</xsl:otherwise>
    582               </xsl:choose>
    583             </xsl:with-param>
    584           </xsl:call-template>
    585         </b>
    586       </p>
     623      <xsl:choose>
     624        <xsl:when test="$make.clean.html != 0">
     625          <div class="toc-title">
     626            <xsl:call-template name="gentext">
     627              <xsl:with-param name="key">
     628                <xsl:choose>
     629                  <xsl:when test="$titles='table'">ListofTables</xsl:when>
     630                  <xsl:when test="$titles='figure'">ListofFigures</xsl:when>
     631                  <xsl:when test="$titles='equation'">ListofEquations</xsl:when>
     632                  <xsl:when test="$titles='example'">ListofExamples</xsl:when>
     633                  <xsl:when test="$titles='procedure'">ListofProcedures</xsl:when>
     634                  <xsl:otherwise>ListofUnknown</xsl:otherwise>
     635                </xsl:choose>
     636              </xsl:with-param>
     637            </xsl:call-template>
     638          </div>
     639        </xsl:when>
     640        <xsl:otherwise>
     641          <p>
     642            <strong xmlns:xslo="http://www.w3.org/1999/XSL/Transform">
     643              <xsl:call-template name="gentext">
     644                <xsl:with-param name="key">
     645                  <xsl:choose>
     646                    <xsl:when test="$titles='table'">ListofTables</xsl:when>
     647                    <xsl:when test="$titles='figure'">ListofFigures</xsl:when>
     648                    <xsl:when test="$titles='equation'">ListofEquations</xsl:when>
     649                    <xsl:when test="$titles='example'">ListofExamples</xsl:when>
     650                    <xsl:when test="$titles='procedure'">ListofProcedures</xsl:when>
     651                    <xsl:otherwise>ListofUnknown</xsl:otherwise>
     652                  </xsl:choose>
     653                </xsl:with-param>
     654              </xsl:call-template>
     655            </strong>
     656          </p>
     657        </xsl:otherwise>
     658      </xsl:choose>
    587659
    588660      <xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml">
Note: See TracChangeset for help on using the changeset viewer.