stylesheets/librognome-html.xsl
changeset 0 7e52f5046fb6
child 7 00ea2985a116
equal deleted inserted replaced
-1:000000000000 0:7e52f5046fb6
       
     1 <?xml version='1.0'?> <!--*- mode: xml -*-->
       
     2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
       
     3                 version="1.0">
       
     4 
       
     5   <!-- import the chunked XSL stylesheet -->
       
     6   <xsl:import href="/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl"/>
       
     7   <xsl:include href="devhelp.xsl"/>
       
     8 
       
     9   <!-- change some parameters -->
       
    10   <xsl:param name="toc.section.depth">1</xsl:param>
       
    11 
       
    12   <xsl:param name="default.encoding" select="'ISO-8859-1'"/>
       
    13   <xsl:param name="chapter.autolabel" select="0"/>
       
    14   <xsl:param name="use.id.as.filename" select="'1'"/>
       
    15   <xsl:param name="html.ext" select="'.html'"/>
       
    16   <xsl:param name="refentry.generate.name" select="0"/>
       
    17   <xsl:param name="refentry.generate.title" select="1"/>
       
    18 
       
    19   <!-- display variablelists as tables -->
       
    20   <xsl:param name="variablelist.as.table" select="1"/>
       
    21 
       
    22   <!-- this gets set on the command line ... -->
       
    23   <xsl:param name="gtkdoc.version" select="''"/>
       
    24   <xsl:param name="gtkdoc.bookname" select="''"/>
       
    25 
       
    26   <!-- ========================================================= -->
       
    27   <!-- template to create the index.sgml anchor index -->
       
    28 
       
    29   <xsl:template match="book|article">
       
    30     <xsl:apply-imports/>
       
    31 
       
    32     <!-- generate the index.sgml href index -->
       
    33     <xsl:call-template name="generate.index"/>
       
    34     <xsl:call-template name="generate.devhelp"/>
       
    35   </xsl:template>
       
    36 
       
    37   <xsl:template name="generate.index">
       
    38     <xsl:call-template name="write.text.chunk">
       
    39       <xsl:with-param name="filename" select="'index.sgml'"/>
       
    40       <xsl:with-param name="content">
       
    41         <!-- check all anchor and refentry elements -->
       
    42         <xsl:apply-templates select="//anchor|//refentry"
       
    43                              mode="generate.index.mode"/>
       
    44       </xsl:with-param>
       
    45       <xsl:with-param name="encoding" select="'utf-8'"/>
       
    46     </xsl:call-template>
       
    47   </xsl:template>
       
    48 
       
    49   <xsl:template match="*" mode="generate.index.mode">
       
    50     <xsl:if test="not(@href)">
       
    51       <xsl:text>&lt;ANCHOR id=&quot;</xsl:text>
       
    52       <xsl:value-of select="@id"/>
       
    53       <xsl:text>&quot; href=&quot;</xsl:text>
       
    54       <xsl:if test="$gtkdoc.bookname">
       
    55         <xsl:value-of select="$gtkdoc.bookname"/>
       
    56         <xsl:text>/</xsl:text>
       
    57       </xsl:if>
       
    58       <xsl:call-template name="href.target"/>
       
    59       <xsl:text>&quot;&gt;
       
    60 </xsl:text>
       
    61     </xsl:if>
       
    62   </xsl:template>
       
    63 
       
    64   <!-- ========================================================= -->
       
    65   <!-- template to output gtkdoclink elements for the unknown targets -->
       
    66 
       
    67   <xsl:template match="link">
       
    68     <xsl:choose>
       
    69       <xsl:when test="id(@linkend)">
       
    70         <xsl:apply-imports/>
       
    71       </xsl:when>
       
    72       <xsl:otherwise>
       
    73         <GTKDOCLINK HREF="{@linkend}">
       
    74           <xsl:apply-templates/>
       
    75         </GTKDOCLINK>
       
    76       </xsl:otherwise>
       
    77     </xsl:choose>
       
    78   </xsl:template>
       
    79 
       
    80   <!-- ========================================================= -->
       
    81   <!-- Below are the visual portions of the stylesheet.  They provide
       
    82        the normal gtk-doc output style. -->
       
    83 
       
    84   <xsl:param name="shade.verbatim" select="0"/>
       
    85   <xsl:param name="refentry.separator" select="0"/>
       
    86 
       
    87   <xsl:template match="refsect2">
       
    88     <xsl:if test="preceding-sibling::refsect2">
       
    89       <hr/>
       
    90     </xsl:if>
       
    91     <xsl:apply-imports/>
       
    92   </xsl:template>
       
    93 
       
    94   <xsl:template name="user.head.content">
       
    95     <xsl:if test="$gtkdoc.version">
       
    96       <meta name="generator"
       
    97             content="GTK-Doc V{$gtkdoc.version} (XML mode)"/>
       
    98     </xsl:if>
       
    99   </xsl:template>
       
   100 
       
   101   <xsl:template match="title" mode="book.titlepage.recto.mode">
       
   102     <table class="navigation" width="100%"
       
   103            cellpadding="2" cellspacing="0">
       
   104       <tr>
       
   105         <th valign="middle">
       
   106           <p class="{name(.)}">
       
   107             <xsl:value-of select="."/>
       
   108           </p>
       
   109         </th>
       
   110       </tr>
       
   111     </table>
       
   112   </xsl:template>
       
   113 
       
   114   <xsl:template name="header.navigation">
       
   115     <xsl:param name="prev" select="/foo"/>
       
   116     <xsl:param name="next" select="/foo"/>
       
   117     <xsl:variable name="home" select="/*[1]"/>
       
   118     <xsl:variable name="up" select="parent::*"/>
       
   119 
       
   120     <xsl:if test="$suppress.navigation = '0' and $home != .">
       
   121       <table class="navigation" width="100%"
       
   122              summary = "Navigation header" cellpadding="2" cellspacing="2">
       
   123         <tr valign="middle">
       
   124           <xsl:if test="count($prev) > 0">
       
   125             <td>
       
   126               <a accesskey="p">
       
   127                 <xsl:attribute name="href">
       
   128                   <xsl:call-template name="href.target">
       
   129                     <xsl:with-param name="object" select="$prev"/>
       
   130                   </xsl:call-template>
       
   131                 </xsl:attribute>
       
   132                 <img src="left.png" width="24" height="24" border="0">
       
   133                   <xsl:attribute name="alt">
       
   134                     <xsl:call-template name="gentext">
       
   135                       <xsl:with-param name="key">nav-prev</xsl:with-param>
       
   136                     </xsl:call-template>
       
   137                   </xsl:attribute>
       
   138                 </img>
       
   139               </a>
       
   140             </td>
       
   141           </xsl:if>
       
   142           <xsl:if test="count($up) > 0 and $up != $home">
       
   143             <td>
       
   144               <a accesskey="u">
       
   145                 <xsl:attribute name="href">
       
   146                   <xsl:call-template name="href.target">
       
   147                     <xsl:with-param name="object" select="$up"/>
       
   148                   </xsl:call-template>
       
   149                 </xsl:attribute>
       
   150                 <img src="up.png" width="24" height="24" border="0">
       
   151                   <xsl:attribute name="alt">
       
   152                     <xsl:call-template name="gentext">
       
   153                       <xsl:with-param name="key">nav-up</xsl:with-param>
       
   154                     </xsl:call-template>
       
   155                   </xsl:attribute>
       
   156                 </img>
       
   157               </a>
       
   158             </td>
       
   159           </xsl:if>
       
   160           <xsl:if test="$home != .">
       
   161             <td>
       
   162               <a accesskey="h">
       
   163                 <xsl:attribute name="href">
       
   164                   <xsl:call-template name="href.target">
       
   165                     <xsl:with-param name="object" select="$home"/>
       
   166                   </xsl:call-template>
       
   167                 </xsl:attribute>
       
   168                 <img src="home.png" width="24" height="24" border="0">
       
   169                   <xsl:attribute name="alt">
       
   170                     <xsl:call-template name="gentext">
       
   171                       <xsl:with-param name="key">nav-home</xsl:with-param>
       
   172                     </xsl:call-template>
       
   173                   </xsl:attribute>
       
   174                 </img>
       
   175               </a>
       
   176             </td>
       
   177           </xsl:if>
       
   178           <th width="100%" align="center">
       
   179             <xsl:apply-templates select="$home"
       
   180                                  mode="object.title.markup"/>
       
   181           </th>
       
   182           <xsl:if test="count($next) > 0">
       
   183             <td>
       
   184               <a accesskey="n">
       
   185                 <xsl:attribute name="href">
       
   186                   <xsl:call-template name="href.target">
       
   187                     <xsl:with-param name="object" select="$next"/>
       
   188                   </xsl:call-template>
       
   189                 </xsl:attribute>
       
   190                 <img src="right.png" width="24" height="24" border="0">
       
   191                   <xsl:attribute name="alt">
       
   192                     <xsl:call-template name="gentext">
       
   193                       <xsl:with-param name="key">nav-next</xsl:with-param>
       
   194                     </xsl:call-template>
       
   195                   </xsl:attribute>
       
   196                 </img>
       
   197               </a>
       
   198             </td>
       
   199           </xsl:if>
       
   200         </tr>
       
   201       </table>
       
   202     </xsl:if>
       
   203   </xsl:template>
       
   204 
       
   205   <xsl:template name="footer.navigation">
       
   206     <xsl:param name="prev" select="/foo"/>
       
   207     <xsl:param name="next" select="/foo"/>
       
   208 
       
   209     <xsl:if test="$suppress.navigation = '0'">
       
   210       <table class="navigation" width="100%"
       
   211              summary="Navigation footer" cellpadding="2" cellspacing="0">
       
   212         <tr valign="middle">
       
   213           <td align="left">
       
   214             <xsl:if test="count($prev) > 0">
       
   215               <a accesskey="p">
       
   216                 <xsl:attribute name="href">
       
   217                   <xsl:call-template name="href.target">
       
   218                     <xsl:with-param name="object" select="$prev"/>
       
   219                   </xsl:call-template>
       
   220                 </xsl:attribute>
       
   221                 <b>
       
   222                   <xsl:text>&lt;&lt;&#160;</xsl:text>
       
   223                   <xsl:apply-templates select="$prev"
       
   224                                        mode="object.title.markup"/>
       
   225                 </b>
       
   226               </a>
       
   227             </xsl:if>
       
   228           </td>
       
   229           <td align="right">
       
   230             <xsl:if test="count($next) > 0">
       
   231               <a accesskey="n">
       
   232                 <xsl:attribute name="href">
       
   233                   <xsl:call-template name="href.target">
       
   234                     <xsl:with-param name="object" select="$next"/>
       
   235                   </xsl:call-template>
       
   236                 </xsl:attribute>
       
   237                 <b>
       
   238                   <xsl:apply-templates select="$next"
       
   239                                        mode="object.title.markup"/>
       
   240                   <xsl:text>&#160;&gt;&gt;</xsl:text>
       
   241                 </b>
       
   242               </a>
       
   243             </xsl:if>
       
   244           </td>
       
   245         </tr>
       
   246       </table>
       
   247     </xsl:if>
       
   248   </xsl:template>
       
   249 
       
   250 <xsl:template match="author" mode="titlepage.mode">
       
   251   <div class="{name(.)}">
       
   252     <xsl:call-template name="person.name"/>
       
   253     <xsl:apply-templates mode="titlepage.mode" select="./contrib"/>
       
   254     <xsl:apply-templates mode="titlepage.mode" select="./affiliation"/>
       
   255     <xsl:apply-templates mode="titlepage.mode" select="./email"/>
       
   256   </div>
       
   257 </xsl:template>
       
   258 
       
   259 <xsl:template match="email" mode="titlepage.mode">
       
   260   <span class="{name(.)}">
       
   261     &lt;<a href="mailto:{.}"><xsl:value-of select="."/></a>&gt;
       
   262   </span>
       
   263 </xsl:template>
       
   264 
       
   265 <xsl:template match="address" mode="titlepage.mode">
       
   266   <span class="{name(.)}">
       
   267 	<xsl:apply-templates mode="titlepage.mode"/>
       
   268   </span>
       
   269 </xsl:template>
       
   270 
       
   271 <xsl:template match="affiliation" mode="titlepage.mode">
       
   272   <span class="{name(.)}">
       
   273 	<xsl:apply-templates mode="titlepage.mode"/>
       
   274   </span>
       
   275 </xsl:template>
       
   276 
       
   277 </xsl:stylesheet>