Changeset 3fe8b511 for stylesheets/print


Ignore:
Timestamp:
01/07/2005 05:14:15 AM (19 years ago)
Author:
Bruce Dubbs <bdubbs@…>
Branches:
10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 6.0, 6.1, 6.2, 6.2.0, 6.2.0-rc1, 6.2.0-rc2, 6.3, 6.3-rc1, 6.3-rc2, 6.3-rc3, 7.10, 7.4, 7.5, 7.6, 7.6-blfs, 7.6-systemd, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, basic, bdubbs/svn, elogind, gnome, kde5-13430, kde5-14269, kde5-14686, kea, ken/TL2024, ken/inkscape-core-mods, ken/tuningfonts, krejzi/svn, lazarus, lxqt, nosym, perl-modules, plabs/newcss, plabs/python-mods, python3.11, qt5new, rahul/power-profiles-daemon, renodr/vulkan-addition, systemd-11177, systemd-13485, trunk, upgradedb, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
Children:
d8dc77a
Parents:
bad8b53
Message:

Update stylesheets and fix Python references

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@3217 af4574ff-66df-0310-9fd7-8a98e5e911e0

Location:
stylesheets/print
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stylesheets/print/lfs-index.xsl

    rbad8b53 r3fe8b511  
    1 <?xml version='1.0' encoding='ISO-8859-1'?>
    2 <!DOCTYPE xsl:stylesheet [
    3 <!ENTITY lowercase "'abcdefghijklmnopqrstuvwxyz'">
    4 <!ENTITY uppercase "'ABCDEFGHIJKLMNOPQRSTUVWXYZ'">
    5 <!ENTITY primary   'normalize-space(concat(primary/@sortas, primary[not(@sortas)]))'>
    6 <!ENTITY scope 'count(ancestor::node()|$scope) = count(ancestor::node())'>
    7 ]>
    8 
    9 <!-- Version 0.9 - Manuel Canales Esparcia <macana@lfs-es.org> -->
    10 
    11 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    12                 xmlns:fo="http://www.w3.org/1999/XSL/Format"
    13                 version="1.0">
    14 
    15     <!--Title-->
    16   <xsl:template match="index" mode="title.markup">
    17         <xsl:param name="allow-anchors" select="0"/>
    18     <xsl:text>Index of packages and important installed files</xsl:text>
    19         </xsl:template>
    20 
    21         <!-- Divisions-->
    22   <xsl:template match="indexterm" mode="index-div">
    23     <xsl:param name="scope" select="."/>
    24     <xsl:variable name="key"
    25                   select="translate(substring(&primary;, 1, 1),&lowercase;,&uppercase;)"/>
    26     <xsl:variable name="divtitle" select="translate($key, &lowercase;, &uppercase;)"/>
    27     <xsl:if test="key('letter', $key)[&scope;]
    28                   [count(.|key('primary', &primary;)[&scope;][1]) = 1]">
    29       <fo:block>
    30         <xsl:if test="contains(concat(&lowercase;, &uppercase;), $key)">
    31           <xsl:call-template name="indexdiv.title">
    32             <xsl:with-param name="titlecontent">
    33               <xsl:choose>
    34                 <xsl:when test="$divtitle = 'A'">
    35                   <xsl:text>Packages</xsl:text>
    36               </xsl:when>
    37               <xsl:when test="$divtitle = 'B'">
    38                   <xsl:text>Programs</xsl:text>
    39               </xsl:when>
    40               <xsl:when test="$divtitle = 'C'">
    41                   <xsl:text>Libraries</xsl:text>
    42               </xsl:when>
    43               <xsl:when test="$divtitle = 'D'">
    44                   <xsl:text>Scripts</xsl:text>
    45               </xsl:when>
    46               <xsl:when test="$divtitle = 'E'">
    47                   <xsl:text>Others</xsl:text>
    48               </xsl:when>
    49               <xsl:otherwise>
    50                 <xsl:value-of select="$divtitle"/>
    51               </xsl:otherwise>
    52             </xsl:choose>
    53             </xsl:with-param>
    54           </xsl:call-template>
    55         </xsl:if>
    56         <fo:block>
    57           <xsl:apply-templates select="key('letter', $key)[&scope;]
    58                                       [count(.|key('primary', &primary;)[&scope;][1])=1]"
    59                               mode="index-primary">
    60             <xsl:sort select="translate(&primary;, &lowercase;, &uppercase;)"/>
    61             <xsl:with-param name="scope" select="$scope"/>
    62           </xsl:apply-templates>
    63         </fo:block>
    64       </fo:block>
    65     </xsl:if>
    66   </xsl:template>
    67 
    68         <!-- The separator -->
    69   <xsl:template match="indexterm" mode="reference">
    70     <xsl:param name="scope" select="."/>
    71     <xsl:text>:   </xsl:text>
    72         <xsl:call-template name="reference">
    73         <xsl:with-param name="zones" select="normalize-space(@zone)"/>
    74         <xsl:with-param name="scope" select="$scope"/>
    75       </xsl:call-template>
    76   </xsl:template>
    77  
    78         <!--Bookmarks-->
    79   <xsl:template name="reference">
    80     <xsl:param name="scope" select="."/>
    81     <xsl:param name="zones"/>
    82     <xsl:choose>
    83       <xsl:when test="contains($zones, ' ')">
    84         <xsl:variable name="zone" select="substring-before($zones, ' ')"/>
    85         <xsl:variable name="zone2" select="substring-after($zones, ' ')"/>
    86         <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>
    87         <xsl:variable name="target2" select="key('id', $zone2)[&scope;]"/>
    88         <xsl:variable name="id">
    89           <xsl:call-template name="object.id">
    90             <xsl:with-param name="object" select="$target[1]"/>
    91           </xsl:call-template>
    92         </xsl:variable>
    93         <xsl:variable name="id2">
    94           <xsl:call-template name="object.id">
    95             <xsl:with-param name="object" select="$target2[1]"/>
    96           </xsl:call-template>
    97         </xsl:variable>
    98         <fo:basic-link internal-destination="{$id}">
    99           <xsl:apply-templates select="$target" mode="page.citation">
    100                 <xsl:with-param name="id" select="$id"/>
    101           </xsl:apply-templates>
    102         </fo:basic-link>
    103           <xsl:text> ,  </xsl:text>
    104         <fo:basic-link internal-destination="{$id2}">
    105           <xsl:apply-templates select="$target2" mode="page.citation">
    106                 <xsl:with-param name="id" select="$id2"/>
    107           </xsl:apply-templates>
    108         </fo:basic-link>
    109       </xsl:when>
    110       <xsl:otherwise>
    111         <xsl:variable name="zone" select="$zones"/>
    112         <xsl:variable name="target" select="key('id', $zone)[&scope;]"/>
    113         <xsl:variable name="id">
    114           <xsl:call-template name="object.id">
    115             <xsl:with-param name="object" select="$target[1]"/>
    116           </xsl:call-template>
    117         </xsl:variable>
    118         <fo:basic-link internal-destination="{$id}">
    119           <xsl:apply-templates select="$target" mode="page.citation">
    120                 <xsl:with-param name="id" select="$id"/>
    121           </xsl:apply-templates>
    122         </fo:basic-link>
    123       </xsl:otherwise>
    124     </xsl:choose>
    125   </xsl:template>
    126 
    127 </xsl:stylesheet>
  • stylesheets/print/lfs-pagesetup.xsl

    rbad8b53 r3fe8b511  
    1 <?xml version='1.0' encoding='ISO-8859-1'?>
    2 
    3 <!-- Version 0.9 - Manuel Canales Esparcia <macana@lfs-es.org> -->
    4 
    5 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    6                 xmlns:fo="http://www.w3.org/1999/XSL/Format"
    7                 version="1.0">
    8 
    9         <!-- Force section1's onto a new page -->
    10   <xsl:attribute-set name="section.level1.properties">
    11         <xsl:attribute name="break-after">
    12         <xsl:choose>
    13                         <xsl:when test="not(position()=last())">
    14                 <xsl:text>page</xsl:text>
    15                 </xsl:when>
    16         <xsl:otherwise>
    17                 <xsl:text>auto</xsl:text>
    18         </xsl:otherwise>
    19       </xsl:choose>
    20     </xsl:attribute>
    21   </xsl:attribute-set>
    22 
    23                 <!-- Header -->
    24   <xsl:template name="header.content">
    25         <xsl:param name="sequence" select="''"/>
    26                 <fo:block>
    27       <xsl:attribute name="text-align">
    28         <xsl:choose>
    29           <xsl:when test="$sequence = 'first' or $sequence = 'odd'">right</xsl:when>
    30           <xsl:otherwise>left</xsl:otherwise>
    31         </xsl:choose>
    32       </xsl:attribute>
    33       <xsl:value-of select="/book/bookinfo/title"/>
    34       <xsl:text> - </xsl:text>
    35       <xsl:value-of select="/book/bookinfo/subtitle"/>
    36     </fo:block>
    37   </xsl:template>
    38 
    39   <xsl:template name="header.table">
    40         <xsl:param name="sequence" select="''"/>
    41     <xsl:param name="gentext-key" select="''"/>
    42     <xsl:choose>
    43       <xsl:when test="$gentext-key = 'book' or $sequence = 'blank'"/>
    44       <xsl:otherwise>
    45         <xsl:call-template name="header.content">
    46                                         <xsl:with-param name="sequence" select="$sequence"/>
    47                                 </xsl:call-template>
    48       </xsl:otherwise>
    49     </xsl:choose>
    50   </xsl:template>
    51 
    52                 <!-- Centered titles for book and part -->
    53   <xsl:template name="book.titlepage">
    54     <fo:block space-before="2in">
    55       <fo:block>
    56         <xsl:call-template name="book.titlepage.before.recto"/>
    57         <xsl:call-template name="book.titlepage.recto"/>
    58       </fo:block>
    59       <fo:block>
    60         <xsl:call-template name="book.titlepage.before.verso"/>
    61         <xsl:call-template name="book.titlepage.verso"/>
    62       </fo:block>
    63       <xsl:call-template name="book.titlepage.separator"/>
    64     </fo:block>
    65   </xsl:template>
    66 
    67   <xsl:template name="part.titlepage">
    68     <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format">
    69       <fo:block space-before="2.5in">
    70         <xsl:call-template name="part.titlepage.before.recto"/>
    71         <xsl:call-template name="part.titlepage.recto"/>
    72       </fo:block>
    73       <fo:block>
    74         <xsl:call-template name="part.titlepage.before.verso"/>
    75         <xsl:call-template name="part.titlepage.verso"/>
    76       </fo:block>
    77       <xsl:call-template name="part.titlepage.separator"/>
    78     </fo:block>
    79   </xsl:template>
    80 
    81         <!-- Margins -->
    82   <xsl:param name="page.margin.inner">1in</xsl:param>
    83   <xsl:param name="page.margin.outer">0.5in</xsl:param>
    84   <xsl:param name="title.margin.left">-1pc</xsl:param>
    85   <xsl:attribute-set name="normal.para.spacing">
    86     <xsl:attribute name="space-before.optimum">0.8em</xsl:attribute>
    87     <xsl:attribute name="space-before.minimum">0.6em</xsl:attribute>
    88     <xsl:attribute name="space-before.maximum">1em</xsl:attribute>
    89   </xsl:attribute-set>
    90   <xsl:attribute-set name="list.block.spacing">
    91     <xsl:attribute name="space-before.optimum">0.8em</xsl:attribute>
    92     <xsl:attribute name="space-before.minimum">0.6em</xsl:attribute>
    93     <xsl:attribute name="space-before.maximum">1em</xsl:attribute>
    94     <xsl:attribute name="space-after.optimum">0.8em</xsl:attribute>
    95     <xsl:attribute name="space-after.minimum">0.6em</xsl:attribute>
    96     <xsl:attribute name="space-after.maximum">1em</xsl:attribute>
    97   </xsl:attribute-set>
    98   <xsl:attribute-set name="list.item.spacing">
    99     <xsl:attribute name="space-before.optimum">0.6em</xsl:attribute>
    100     <xsl:attribute name="space-before.minimum">0.4em</xsl:attribute>
    101     <xsl:attribute name="space-before.maximum">0.8em</xsl:attribute>
    102   </xsl:attribute-set>
    103   <xsl:attribute-set name="verbatim.properties">
    104     <xsl:attribute name="space-before.minimum">0.6em</xsl:attribute>
    105     <xsl:attribute name="space-before.optimum">0.8em</xsl:attribute>
    106     <xsl:attribute name="space-before.maximum">1em</xsl:attribute>
    107     <xsl:attribute name="space-after.minimum">0.6em</xsl:attribute>
    108     <xsl:attribute name="space-after.optimum">0.8em</xsl:attribute>
    109     <xsl:attribute name="space-after.maximum">1em</xsl:attribute>
    110   </xsl:attribute-set>
    111 
    112         <!-- Others-->
    113   <xsl:param name="header.rule" select="0"></xsl:param>
    114   <xsl:param name="footer.rule" select="0"></xsl:param>
    115         <xsl:param name="marker.section.level" select="-1"></xsl:param>
    116 
    117         <!-- Dropping a blank page -->
    118         <xsl:template name="book.titlepage.separator"/>
    119 
    120 </xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.