techtonik Mon Oct 18 16:20:33 2004 EDT Added files: /phpdoc/xsl htmlhelp.xsl
Removed files: /phpdoc/xsl htmlhelp.xsl.in Modified files: /phpdoc/xsl .cvsignore Log: moved htmlhelp.xsl.in to htmlhelp.xsl as we now have configure/able parameters stored in html-config.xsl.in
http://cvs.php.net/diff.php/phpdoc/xsl/.cvsignore?r1=1.7&r2=1.8&ty=u Index: phpdoc/xsl/.cvsignore diff -u phpdoc/xsl/.cvsignore:1.7 phpdoc/xsl/.cvsignore:1.8 --- phpdoc/xsl/.cvsignore:1.7 Mon Oct 18 16:11:13 2004 +++ phpdoc/xsl/.cvsignore Mon Oct 18 16:20:32 2004 @@ -1,3 +1,2 @@ htmlhelp-config.xsl -htmlhelp.xsl param_html.xsl http://cvs.php.net/co.php/phpdoc/xsl/htmlhelp.xsl?r=1.1&p=1 Index: phpdoc/xsl/htmlhelp.xsl +++ phpdoc/xsl/htmlhelp.xsl <?xml version="1.0" encoding="iso-8859-1"?> <!-- HTML Help specific stylesheet $Id: htmlhelp.xsl,v 1.1 2004/10/18 20:20:32 techtonik Exp $ --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:stbl="http://nwalsh.com/xslt/ext/com.nwalsh.saxon.Table" xmlns:xtbl="com.nwalsh.xalan.Table" exclude-result-prefixes="stbl xtbl" version="1.0"> <xsl:import href="htmlhelp-db.xsl"/> <xsl:import href="html-common.xsl"/> <xsl:include href="htmlhelp-config.xsl"/> <xsl:param name="base.dir" select="'htmlhelp/html/'"/> <xsl:param name="use.id.as.filename" select="1"/> <xsl:param name="saxon.character.representation" select="'native'"/> <xsl:param name="ulink.target" select="'_blank'"/> <!-- ====================================================================== Custom XSL code for PHP CHM Manual --> <!-- Custom head content to make HTML files *small* --> <xsl:template name="head.content"> <xsl:param name="node" select="."/> <title> <xsl:apply-templates select="$node" mode="object.title.markup.textonly"/> </title> <script language="JavaScript1.2" src="_script.js"></script> </xsl:template> <!-- We need quite different body attributes than the defaults --> <xsl:template name="body.attributes"> <xsl:attribute name="onload">displayPage();</xsl:attribute> <xsl:attribute name="oncontextmenu">if(prefs_context_override){return false;}</xsl:attribute> </xsl:template> <!-- Our HTML head part is *extra* slim --> <xsl:template name="html.head"> <head> <xsl:call-template name="head.content"/> </head> </xsl:template> <!-- We need no header navigation (we'll need footer, so this is why I have not used supress.navigation=1) --> <xsl:template name="header.navigation" /> <!-- Footer part with special table for our special needs ;) --> <xsl:template name="footer.navigation"> <xsl:param name="prev" select="/foo"/> <xsl:param name="next" select="/foo"/> <a name="_user_notes"></a> <div id="pageNotes"></div> <script language="JavaScript1.2"> function displayNotes() { _displayNotes(); } loadNotes(); </script> <div id="pageNav"> <table width="100%" border="0" cellspacing="10" cellpadding="0" class="navigation"> <tr align="left" valign="middle"> <td> <xsl:if test="count($prev)>0"> <span id="navPrev"> <a accesskey="p"> <xsl:attribute name="href"> <xsl:call-template name="href.target"> <xsl:with-param name="object" select="$prev"/> </xsl:call-template> </xsl:attribute> <xsl:text><< </xsl:text> <xsl:apply-templates select="$prev" mode="phpdoc.object.title"/> </a> </span> </xsl:if> </td> <td align="center"> <span id="navPath"> <xsl:apply-templates select="." mode="path.to.this.page"> <xsl:with-param name="actpage" select="true()"/> </xsl:apply-templates> </span> </td> <td align="right"> <xsl:if test="count($next)>0"> <span id="navNext"> <a accesskey="n"> <xsl:attribute name="href"> <xsl:call-template name="href.target"> <xsl:with-param name="object" select="$next"/> </xsl:call-template> </xsl:attribute> <xsl:apply-templates select="$next" mode="phpdoc.object.title"/> <xsl:text> >></xsl:text> </a> </span> </xsl:if> </td> </tr> <tr align="center" valign="middle"> <td colspan="3"> <span id="navOnline"> <span id="navThisOnline"><a href="javascript:thisPageOnline();">This page online</a></span> <xsl:text disable-output-escaping="yes"> &nbsp; </xsl:text> <span id="navReportBug"><a href="javascript:bugOnPage();">Report a bug</a></span> </span> </td> </tr> </table> </div> </xsl:template> <!-- Try to figure out the path to this page from the main page --> <xsl:template match="*" mode="path.to.this.page"> <xsl:param name="actpage" select="false()"/> <xsl:variable name="up" select="parent::*"/> <!-- Call this recursively for the parent --> <xsl:if test="count($up)>0"> <xsl:apply-templates select="parent::*" mode="path.to.this.page"> <xsl:with-param name="actpage" select="false()"/> </xsl:apply-templates> </xsl:if> <!-- Choose our own title, different from the default if this is the main page --> <xsl:variable name="object.title"> <xsl:choose> <xsl:when test="count($up)>0"> <xsl:apply-templates select="." mode="phpdoc.object.title"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="'Main'"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <!-- Do not link if actual page, put " : " between links --> <xsl:choose> <xsl:when test="$actpage = true()"> <xsl:value-of select="$object.title"/> </xsl:when> <xsl:otherwise> <a> <xsl:attribute name="href"> <xsl:call-template name="href.target"> <xsl:with-param name="object" select="."/> </xsl:call-template> </xsl:attribute> <xsl:value-of select="$object.title"/> </a> <xsl:text> : </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- This is the same as in DocBook XSL, except that we print out a » HTML entity before the link and add a CSS class to the link --> <xsl:template match="ulink" name="ulink"> <a class="ulink"> <xsl:if test="@id"> <xsl:attribute name="name"> <xsl:value-of select="@id"/> </xsl:attribute> </xsl:if> <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute> <xsl:if test="$ulink.target != ''"> <xsl:attribute name="target"> <xsl:value-of select="$ulink.target"/> </xsl:attribute> </xsl:if> <xsl:text disable-output-escaping="yes">&raquo; </xsl:text> <xsl:choose> <xsl:when test="count(child::node())=0"> <xsl:value-of select="@url"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> </a> </xsl:template> <!-- Special reference page formatting for HH --> <!-- Function page sample: <h2 class="subheader">Format a local time/date. (PHP 3, PHP 4 >= 4.0.0)<br> Usage: string date (string format, int [timestamp])<br></h2> --> <xsl:template match="refnamediv"> <div class="{name(.)}"> <xsl:call-template name="anchor"/> <h2 class="subheader"> <span id="funcPurpose"><xsl:value-of select="./refpurpose"/></span> (<span id="funcAvail"><xsl:value-of select="$version/[EMAIL PROTECTED](current()/refname)]/@from"/></span>) <br/> <span id="funcUsage"><xsl:apply-templates select="../refsect1/methodsynopsis" mode="htmlhelp.methodsyn"/></span> </h2> </div> </xsl:template> <!-- Drop out constant "Description" --> <xsl:template match="refsect1/title"/> <xsl:template match="refsect1/refpurpose"/> <!-- Avoid printout of methosyns, where we do not want them, but print out them in header --> <xsl:template match="methodsynopsis"/> <xsl:template match="methodsynopsis" mode="htmlhelp.methodsyn"> <xsl:apply-templates select="." mode="php"/><br/> </xsl:template> <!-- do not enclose <methodname> in a <tt> --> <xsl:template match="methodname"> <xsl:call-template name="inline.charseq"/> </xsl:template> <!-- Use simple bold text for admonitions --> <xsl:template name="nongraphical.admonition"> <div class="{name(.)}"> <xsl:if test="$admon.style"> <xsl:attribute name="style"> <xsl:value-of select="$admon.style"/> </xsl:attribute> </xsl:if> <b> <xsl:call-template name="anchor"/> <xsl:apply-templates select="." mode="object.title.markup"/> <xsl:text>: </xsl:text> </b> <xsl:apply-templates/> </div> </xsl:template> <!-- Different table formatting for default simplelist --> <xsl:template match="simplelist"> <!-- with no type specified, the default is 'vert' --> <xsl:call-template name="anchor"/> <table border="0" cellspacing="1" cellpadding="2" class="datatable"> <xsl:call-template name="simplelist.vert"> <xsl:with-param name="cols"> <xsl:choose> <xsl:when test="@columns"> <xsl:value-of select="@columns"/> </xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:with-param> </xsl:call-template> </table> </xsl:template> <!-- This is a copy from tables.xsl, except that we have different attributes for table than the default style sheets, provided here in the second line literally, and as a default 0 border --> <xsl:template match="tgroup"> <table cellspacing="1" cellpadding="2" class="datatable"> <xsl:choose> <!-- If there's a <?dbhtml table-summary="foo"?> PI, use it for the HTML table summary attribute --> <xsl:when test="processing-instruction('dbhtml')"> <xsl:variable name="summary"> <xsl:call-template name="dbhtml-attribute"> <xsl:with-param name="pis" select="processing-instruction('dbhtml')[1]"/> <xsl:with-param name="attribute" select="'table-summary'"/> </xsl:call-template> </xsl:variable> <xsl:if test="$summary != ''"> <xsl:attribute name="summary"> <xsl:value-of select="$summary"/> </xsl:attribute> </xsl:if> </xsl:when> <!-- Otherwise, if there's a title, use that --> <xsl:when test="../title"> <xsl:attribute name="summary"> <xsl:value-of select="string(../title)"/> </xsl:attribute> </xsl:when> <!-- Otherwise, forget the whole idea --> <xsl:otherwise><!-- nevermind --></xsl:otherwise> </xsl:choose> <xsl:if test="../@pgwide=1"> <xsl:attribute name="width">100%</xsl:attribute> </xsl:if> <xsl:choose> <xsl:when test="../@frame='none'"> <xsl:attribute name="border">0</xsl:attribute> </xsl:when> <xsl:when test="$table.borders.with.css != 0"> <xsl:attribute name="border">0</xsl:attribute> <xsl:choose> <xsl:when test="../@frame='topbot' or ../@frame='top'"> <xsl:attribute name="style"> <xsl:call-template name="border"> <xsl:with-param name="side" select="'top'"/> </xsl:call-template> </xsl:attribute> </xsl:when> <xsl:when test="../@frame='sides'"> <xsl:attribute name="style"> <xsl:call-template name="border"> <xsl:with-param name="side" select="'left'"/> </xsl:call-template> <xsl:call-template name="border"> <xsl:with-param name="side" select="'right'"/> </xsl:call-template> </xsl:attribute> </xsl:when> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:attribute name="border">0</xsl:attribute> </xsl:otherwise> </xsl:choose> <xsl:variable name="colgroup"> <colgroup> <xsl:call-template name="generate.colgroup"> <xsl:with-param name="cols" select="@cols"/> </xsl:call-template> </colgroup> </xsl:variable> <xsl:variable name="explicit.table.width"> <xsl:call-template name="dbhtml-attribute"> <xsl:with-param name="pis" select="../processing-instruction('dbhtml')[1]"/> <xsl:with-param name="attribute" select="'table-width'"/> </xsl:call-template> </xsl:variable> <xsl:variable name="table.width"> <xsl:choose> <xsl:when test="$explicit.table.width != ''"> <xsl:value-of select="$explicit.table.width"/> </xsl:when> <xsl:when test="$default.table.width = ''"> <xsl:text>100%</xsl:text> </xsl:when> <xsl:otherwise> <xsl:value-of select="$default.table.width"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:if test="$default.table.width != '' or $explicit.table.width != ''"> <xsl:attribute name="width"> <xsl:choose> <xsl:when test="contains($table.width, '%')"> <xsl:value-of select="$table.width"/> </xsl:when> <xsl:when test="$use.extensions != 0 and $tablecolumns.extension != 0"> <xsl:choose> <xsl:when test="function-available('stbl:convertLength')"> <xsl:value-of select="stbl:convertLength($table.width)"/> </xsl:when> <xsl:when test="function-available('xtbl:convertLength')"> <xsl:value-of select="xtbl:convertLength($table.width)"/> </xsl:when> <xsl:otherwise> <xsl:message terminate="yes"> <xsl:text>No convertLength function available.</xsl:text> </xsl:message> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:value-of select="$table.width"/> </xsl:otherwise> </xsl:choose> </xsl:attribute> </xsl:if> <xsl:choose> <xsl:when test="$use.extensions != 0 and $tablecolumns.extension != 0"> <xsl:choose> <xsl:when test="function-available('stbl:adjustColumnWidths')"> <xsl:copy-of select="stbl:adjustColumnWidths($colgroup)"/> </xsl:when> <xsl:when test="function-available('xtbl:adjustColumnWidths')"> <xsl:copy-of select="xtbl:adjustColumnWidths($colgroup)"/> </xsl:when> <xsl:otherwise> <xsl:message terminate="yes"> <xsl:text>No adjustColumnWidths function available.</xsl:text> </xsl:message> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:copy-of select="$colgroup"/> </xsl:otherwise> </xsl:choose> <xsl:apply-templates select="thead"/> <xsl:apply-templates select="tbody"/> <xsl:apply-templates select="tfoot"/> <xsl:if test=".//footnote"> <tbody class="footnotes"> <tr> <td colspan="[EMAIL PROTECTED]"> <xsl:apply-templates select=".//footnote" mode="table.footnote.mode"/> </td> </tr> </tbody> </xsl:if> </table> </xsl:template> <!-- output formal object titles enclosed in <h3> tags --> <xsl:template name="formal.object.heading"> <h3 class="formalhead"> <xsl:call-template name="anchor"/> <xsl:apply-templates select="." mode="object.title.markup"> <xsl:with-param name="allow-anchors" select="1"/> </xsl:apply-templates> </h3> </xsl:template> </xsl:stylesheet>