- Timestamp:
- 12/10/2013 11:37:38 PM (11 years ago)
- Branches:
- 7.5-systemd, 7.6-systemd, 7.7-systemd, 7.8-systemd, 7.9-systemd
- Children:
- 112db9d
- Parents:
- f2a5108
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
stylesheets/lfs-xsl/docbook-xsl-1.78.1/xhtml/autotoc.xsl
rf2a5108 rb1a51ac1 5 5 6 6 <!-- ******************************************************************** 7 $Id $7 $Id: autotoc.xsl 9692 2012-12-16 02:31:34Z dcramer $ 8 8 ******************************************************************** 9 9 … … 38 38 <xsl:variable name="toc.title"> 39 39 <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> 47 58 </xsl:if> 48 59 </xsl:variable> … … 59 70 <xsl:copy-of select="$toc.title"/> 60 71 <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> 61 77 <xsl:call-template name="manual-toc"> 62 78 <xsl:with-param name="tocentry" select="$tocentry/*[1]"/> … … 73 89 <xsl:copy-of select="$toc.title"/> 74 90 <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> 75 96 <xsl:apply-templates select="$nodes.plus" mode="toc"> 76 97 <xsl:with-param name="toc-context" select="$toc-context"/> … … 85 106 <xsl:copy-of select="$toc.title"/> 86 107 <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> 87 113 <xsl:apply-templates select="$nodes" mode="toc"> 88 114 <xsl:with-param name="toc-context" select="$toc-context"/> … … 98 124 </xsl:template> 99 125 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 100 134 <xsl:template name="make.lots"> 101 135 <xsl:param name="toc.params" select="''"/> … … 116 150 <xsl:call-template name="list.of.titles"> 117 151 <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)]"/> 119 153 </xsl:call-template> 120 154 </xsl:if> … … 151 185 <xsl:with-param name="toc-context" select="$toc-context"/> 152 186 <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"/> 154 188 </xsl:call-template> 155 189 </xsl:template> … … 162 196 <xsl:with-param name="toc-context" select="$toc-context"/> 163 197 <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]"/> 165 199 166 200 </xsl:call-template> … … 174 208 <xsl:with-param name="toc-context" select="$toc-context"/> 175 209 <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]"/> 177 211 </xsl:call-template> 178 212 </xsl:template> … … 237 271 <xsl:when test="local-name(.) = 'refsect2'">2</xsl:when> 238 272 <xsl:when test="local-name(.) = 'refsect3'">3</xsl:when> 273 <xsl:when test="local-name(.) = 'topic'">1</xsl:when> 239 274 <xsl:when test="local-name(.) = 'simplesect'"> 240 275 <!-- sigh... --> … … 248 283 <xsl:when test="local-name(..) = 'sect4'">5</xsl:when> 249 284 <xsl:when test="local-name(..) = 'sect5'">6</xsl:when> 285 <xsl:when test="local-name(..) = 'topic'">2</xsl:when> 250 286 <xsl:when test="local-name(..) = 'refsect1'">2</xsl:when> 251 287 <xsl:when test="local-name(..) = 'refsect2'">3</xsl:when> … … 277 313 <xsl:with-param name="toc-context" select="$toc-context"/> 278 314 </xsl:call-template> 279 <xsl:if test="$toc.listitem.type = 'li' and $toc.section.depth > $depthand ( ($qanda.in.toc = 0 and count($nodes)>0) or ($qanda.in.toc != 0 and count($nodes.plus)>0) ) and $toc.max.depth > $depth.from.context">315 <xsl:if test="$toc.listitem.type = 'li' and ( (self::set or self::book or self::part) or $toc.section.depth > $depth) and ( ($qanda.in.toc = 0 and count($nodes)>0) or ($qanda.in.toc != 0 and count($nodes.plus)>0) ) and $toc.max.depth > $depth.from.context"> 280 316 <xsl:copy-of select="$subtoc.list"/> 281 317 </xsl:if> 282 318 </xsl:element> 283 <xsl:if test="$toc.listitem.type != 'li' and $toc.section.depth > $depthand ( ($qanda.in.toc = 0 and count($nodes)>0) or ($qanda.in.toc != 0 and count($nodes.plus)>0) ) and $toc.max.depth > $depth.from.context">319 <xsl:if test="$toc.listitem.type != 'li' and ( (self::set or self::book or self::part) or $toc.section.depth > $depth) and ( ($qanda.in.toc = 0 and count($nodes)>0) or ($qanda.in.toc != 0 and count($nodes.plus)>0) ) and $toc.max.depth > $depth.from.context"> 284 320 <xsl:copy-of select="$subtoc.list"/> 285 321 </xsl:if> … … 336 372 <xsl:call-template name="subtoc"> 337 373 <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]"/> 339 375 </xsl:call-template> 340 376 </xsl:template> … … 356 392 <xsl:call-template name="subtoc"> 357 393 <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]"/> 368 404 </xsl:call-template> 369 405 </xsl:template> … … 425 461 <xsl:call-template name="subtoc"> 426 462 <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]"/> 428 473 </xsl:call-template> 429 474 </xsl:template> … … 496 541 <!-- * is allowed in refpurpose; so we need to run --> 497 542 <!-- * 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"/> 499 544 </xsl:if> 500 545 </span> … … 519 564 <xsl:param name="toc-context" select="."/> 520 565 <xsl:param name="tocentry"/> 566 <xsl:param name="toc.title.p" select="true()"/> 567 <xsl:param name="nodes" select="/NOT-AN-ELEMENT"/> 521 568 522 569 <!-- be careful, we don't want to change the current document to the other tree! --> … … 546 593 <xsl:if test="$tocentry/*"> 547 594 <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> 548 600 <xsl:call-template name="manual-toc"> 549 601 <xsl:with-param name="tocentry" select="$tocentry/*[1]"/> … … 569 621 <xsl:if test="$nodes"> 570 622 <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> 587 659 588 660 <xsl:element name="{$toc.list.type}" namespace="http://www.w3.org/1999/xhtml">
Note:
See TracChangeset
for help on using the changeset viewer.