cvs: phpdoc /xsl html-chunk.xsl html-common.xsl html.xsl phpweb.xsl

From: Date: Wed, 23 Apr 2003 17:32:51 +0000
Subject: cvs: phpdoc /xsl html-chunk.xsl html-common.xsl html.xsl phpweb.xsl
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969352832@lists.php.net to get a copy of this message
goba Wed Apr 23 13:32:51 2003 EDT Added files: /phpdoc/xsl html-chunk.xsl Modified files: /phpdoc/xsl html-common.xsl html.xsl phpweb.xsl Log: Move out the <legalnotice> and <function> related customizations to the html-chunk.xsl (following the naming of html-common.xsl). Also moved some common parameters Using this from html.xsl and phpweb.xsl

Index: phpdoc/xsl/html-common.xsl diff -u phpdoc/xsl/html-common.xsl:1.21 phpdoc/xsl/html-common.xsl:1.22 --- phpdoc/xsl/html-common.xsl:1.21 Tue Apr 22 07:43:41 2003 +++ phpdoc/xsl/html-common.xsl Wed Apr 23 13:32:51 2003 @@ -3,6 +3,8 @@ html-common.xsl: Common HTML customizations + $Id: html-common.xsl,v 1.22 2003/04/23 17:32:51 goba Exp $ + --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> @@ -600,7 +602,5 @@ </tr> </table> </xsl:template> - - </xsl:stylesheet> Index: phpdoc/xsl/html.xsl diff -u phpdoc/xsl/html.xsl:1.2 phpdoc/xsl/html.xsl:1.3 --- phpdoc/xsl/html.xsl:1.2 Sat Apr 19 13:21:57 2003 +++ phpdoc/xsl/html.xsl Wed Apr 23 13:32:51 2003 @@ -3,7 +3,7 @@ html.xsl: Chunked HTML specific stylesheet - $Id: html.xsl,v 1.2 2003/04/19 17:21:57 goba Exp $ + $Id: html.xsl,v 1.3 2003/04/23 17:32:51 goba Exp $ --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" @@ -11,90 +11,11 @@ <xsl:import href="./docbook/html/chunkfast.xsl"/> <xsl:include href="html-common.xsl"/> +<xsl:include href="html-chunk.xsl"/> <!-- Output files to the 'html' dir, and name them using the IDs in documents --> <xsl:param name="base.dir" select="'html/'"/> -<xsl:param name="use.id.as.filename" select="1"/> - -<!-- Speed up generation (no file name printouts) --> -<xsl:param name="chunk.quietly">1</xsl:param> - - -<!-- Make LEGALNOTICE an extra-file, omit extra-link on start-page (link - directly from the original <COPYRIGHT>), and make nav-header/footer --> -<xsl:template match="copyright" mode="titlepage.mode"> - <p> - <a href="{concat('copyright',$html.ext)}"> - <xsl:call-template name="gentext"> - <xsl:with-param name="key" select="'Copyright'"/> - </xsl:call-template> - </a> - <xsl:text> </xsl:text> - <xsl:call-template name="dingbat"> - <xsl:with-param name="dingbat">copyright</xsl:with-param> - </xsl:call-template> - <xsl:text> </xsl:text> - <xsl:call-template name="copyright.years"> - <xsl:with-param name="years" select="year"/> - <xsl:with-param name="print.ranges" select="$make.year.ranges"/> - <xsl:with-param name="single.year.ranges" - select="$make.single.year.ranges"/> - </xsl:call-template> - <xsl:text> </xsl:text> - <xsl:apply-templates select="holder" mode="titlepage.mode"/> - </p> -</xsl:template> - -<xsl:template match="legalnotice" mode="titlepage.mode"> - <xsl:variable name="filename"> - <xsl:value-of select="concat($base.dir,'copyright',$html.ext)"/> - </xsl:variable> - - <xsl:call-template name="write.chunk"> - <xsl:with-param name="filename" select="$filename"/> - <xsl:with-param name="quiet" select="$chunk.quietly"/> - <xsl:with-param name="content"> - <html> - <head> - <xsl:call-template name="system.head.content"/> - <title> - <xsl:apply-templates select="." mode="object.title.markup.textonly"/> - </title> - </head> - <body> - <xsl:call-template name="body.attributes"/> - <table width="100%" summary="Navigation header"> - <tr> - <th align="center"><xsl:value-of select="/book/title"/></th> - </tr> - </table> - <hr/> - <xsl:apply-templates mode="titlepage.mode"/> - <hr/> - <table width="100%" summary="Navigation footer"> - <tr> - <td align="center"> - <a accesskey="h"> - <xsl:attribute name="href"> - <xsl:call-template name="href.target"> - <xsl:with-param name="object" select="/*[1]"/> - </xsl:call-template> - </xsl:attribute> - <xsl:call-template name="navig.content"> - <xsl:with-param name="direction" select="'home'"/> - </xsl:call-template> - </a> - </td> - </tr> - </table> - </body> - </html> - </xsl:with-param> - </xsl:call-template> -</xsl:template> - - <!-- NAVIGATION-HEADERS: let them look similar to dsssl (not in 1st page, 1st line always "PHP manual", titles @@ -173,7 +94,6 @@ </div> </xsl:template> - <!-- NAVIGATION-FOOTERS: label just with e.g. 'A.' instead of 'appendix A.') --> <xsl:template name="footer.navigation"> <xsl:param name="prev" select="/foo"/> @@ -294,35 +214,6 @@ </div> </xsl:template> - -<!-- Add parenthesis FUNCTIONS, and if target exists link - them to their refentry, otherweise make it bold --> -<xsl:template match="function"> - <xsl:variable name="content"> - <xsl:apply-templates/><xsl:text>()</xsl:text> - </xsl:variable> - <xsl:variable name="targetid"> - <xsl:value-of select="concat('function.', translate(string(current()),'_','-'))"/> - </xsl:variable> - - <xsl:choose> - <xsl:when test="ancestor::refentry/refnamediv/refname=translate(current(), - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz') - or count(/*/part[@id='funcref']/*/refentry[@id=$targetid]) = 0"> - <b><xsl:copy-of select="$content"/></b> - </xsl:when> - <xsl:otherwise> - <a> - <xsl:attribute name="href"> - <xsl:value-of select="concat($targetid, '.html')"/> - </xsl:attribute> - <xsl:copy-of select="$content"/> - </a> - </xsl:otherwise> - </xsl:choose> -</xsl:template> - - <!-- Suppress Links in html-header --> <xsl:template name="html.head"> <xsl:param name="prev"/> @@ -334,8 +225,6 @@ </head> </xsl:template> - - <!-- Don't let the "next"-links of navigation-headers(footers) point to a section below reference/partintro, which is no chunk --> <xsl:template name="chunk-first-section-with-parent"> @@ -453,7 +342,5 @@ <xsl:with-param name="content" select="$content"/> </xsl:call-template> </xsl:template> - - </xsl:stylesheet> Index: phpdoc/xsl/phpweb.xsl diff -u phpdoc/xsl/phpweb.xsl:1.5 phpdoc/xsl/phpweb.xsl:1.6 --- phpdoc/xsl/phpweb.xsl:1.5 Mon Apr 21 15:33:48 2003 +++ phpdoc/xsl/phpweb.xsl Wed Apr 23 13:32:51 2003 @@ -3,7 +3,7 @@ PHP.net web site specific stylesheet - $Id: phpweb.xsl,v 1.5 2003/04/21 19:33:48 goba Exp $ + $Id: phpweb.xsl,v 1.6 2003/04/23 17:32:51 goba Exp $ --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" @@ -11,15 +11,11 @@ <xsl:import href="./docbook/html/chunkfast.xsl"/> <xsl:include href="html-common.xsl"/> +<xsl:include href="html-chunk.xsl"/> -<!-- Output files to the 'php' dir, use the '.php' extension - and name them using the IDs in documents --> +<!-- Write files to the 'php' dir, use the '.php' extension --> <xsl:param name="base.dir" select="'php/'"/> <xsl:param name="html.ext" select="'.php'"/> -<xsl:param name="use.id.as.filename" select="1"/> - -<!-- Speed up generation (no file name printouts) --> -<xsl:param name="chunk.quietly">1</xsl:param> <!-- Special PHP code navigation for generated pages There are some xsl:text parts added for formatting! @@ -131,9 +127,19 @@ <xsl:template name="phpdoc.nav.array"> <xsl:param name="node" select="/foo"/> <xsl:text>array('</xsl:text> - <xsl:call-template name="href.target"> - <xsl:with-param name="object" select="$node"/> - </xsl:call-template> + <xsl:choose> + <!-- special handling for copyright, as we have it + in it's own chunk, but the stylesheets don't + know about it --> + <xsl:when test="local-name($node) = 'legalnotice'"> + <xsl:value-of select="concat('copyright',$html.ext)"/> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$node"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> <xsl:text>','</xsl:text> <xsl:apply-templates select="$node" mode="phpdoc.object.title"/> <xsl:text>')</xsl:text> Index: phpdoc/xsl/html-chunk.xsl +++ phpdoc/xsl/html-chunk.xsl <?xml version="1.0" encoding="iso-8859-1"?> <!-- html-common.xsl: Common HTML customizations $Id: html-chunk.xsl,v 1.1 2003/04/23 17:32:51 goba Exp $ --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- Use the IDs to create filenames --> <xsl:param name="use.id.as.filename" select="1"/> <!-- Speed up generation (no file name printouts) --> <xsl:param name="chunk.quietly">1</xsl:param> <!-- Make LEGALNOTICE an extra-file, omit extra-link on start-page (link directly from the original <COPYRIGHT>), and make nav-header/footer --> <xsl:template match="copyright" mode="titlepage.mode"> <p> <a href="{concat('copyright',$html.ext)}"> <xsl:call-template name="gentext"> <xsl:with-param name="key" select="'Copyright'"/> </xsl:call-template> </a> <xsl:text> </xsl:text> <xsl:call-template name="dingbat"> <xsl:with-param name="dingbat">copyright</xsl:with-param> </xsl:call-template> <xsl:text> </xsl:text> <xsl:call-template name="copyright.years"> <xsl:with-param name="years" select="year"/> <xsl:with-param name="print.ranges" select="$make.year.ranges"/> <xsl:with-param name="single.year.ranges" select="$make.single.year.ranges"/> </xsl:call-template> <xsl:text> </xsl:text> <xsl:apply-templates select="holder" mode="titlepage.mode"/> </p> </xsl:template> <xsl:template match="legalnotice" mode="titlepage.mode"> <xsl:variable name="filename"> <xsl:value-of select="concat($base.dir,'copyright',$html.ext)"/> </xsl:variable> <xsl:call-template name="write.chunk"> <xsl:with-param name="filename" select="$filename"/> <xsl:with-param name="quiet" select="$chunk.quietly"/> <xsl:with-param name="content"> <xsl:call-template name="chunk-element-content"> <xsl:with-param name="prev" select="/foo"/> <xsl:with-param name="next" select="/foo"/> <xsl:with-param name="content"> <xsl:apply-templates mode="titlepage.mode"/> </xsl:with-param> </xsl:call-template> </xsl:with-param> </xsl:call-template> </xsl:template> <!-- Add parenthesis FUNCTIONS, and if target exists link them to their refentry, otherweise make it bold --> <xsl:template match="function"> <xsl:variable name="content"> <xsl:apply-templates/><xsl:text>()</xsl:text> </xsl:variable> <xsl:variable name="targetid"> <xsl:value-of select="concat('function.', translate(string(current()),'_','-'))"/> </xsl:variable> <xsl:choose> <xsl:when test="ancestor::refentry/refnamediv/refname=translate(current(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz') or count(/*/part[@id='funcref']/*/refentry[@id=$targetid]) = 0"> <b><xsl:copy-of select="$content"/></b> </xsl:when> <xsl:otherwise> <a> <xsl:attribute name="href"> <xsl:value-of select="concat($targetid,$html.ext)"/> </xsl:attribute> <xsl:copy-of select="$content"/> </a> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet>
« previous php.doc (#969352832) next »