cvs: php-gtk /docs udocs.in /docs/stylesheets/xsl/html phpweb.xsl
| From: | James Moore | Date: | Wed, 09 May 2001 20:00:00 +0000 |
| Subject: | cvs: php-gtk /docs udocs.in /docs/stylesheets/xsl/html phpweb.xsl | ||
| Groups: | php.gtk | ||
| Request: | Send a blank email to php-gtk+get-1764@lists.php.net to get a copy of this message | ||
jmoore Wed May 9 13:00:00 2001 EDT
Modified files:
/php-gtk/docs udocs.in
/php-gtk/docs/stylesheets/xsl/html phpweb.xsl
Log:
- Adding phpweb stylesheets with nice navigation.
- Fixed bug in make stylesheet=phpweb updatexml where saxon wouldnt run.
# - Andrei Ill leave you to commit name_to_id.xsl when your happy with gtkbutton.
Index: php-gtk/docs/udocs.in diff -u php-gtk/docs/udocs.in:1.7 php-gtk/docs/udocs.in:1.8 --- php-gtk/docs/udocs.in:1.7 Mon May 7 09:11:22 2001 +++ php-gtk/docs/udocs.in Wed May 9 12:59:57 2001 @@ -1,7 +1,7 @@ #!/bin/bash # -# $Id: udocs.in,v 1.7 2001/05/07 16:11:22 andrei Exp $ +# $Id: udocs.in,v 1.8 2001/05/09 19:59:57 jmoore Exp $ # SAXON="@SAXON@" @@ -77,7 +77,7 @@ then xmlfilepath=$srcdir/$LANGDIR/$xmlfile else - xmlfilepath=$srcdir/en/$xmlfile + xmlfilepath=$srcdir/en/$xmlfile fi ID=`head -n 1 $xmlfilepath | sed -e's%<[a-zA-Z0-9 \t\n]\+id="\([A-Za-z0-9.]\+\)"[a-zA-Z0-9 \t\n]\?>%\1%g'` @@ -122,6 +122,8 @@ done fi +IDS="" + case $mode in s ) for file in $xmlfiles do @@ -131,11 +133,12 @@ echo "Could not find ID in $file" exit 1 fi - if [ -n $IDS ] + if test $IDS="" then - IDS="$IDS|" + IDS="//£[@id=\'$ID\']" + else + IDS="$IDS|//£[@id=\'$ID\']" fi - IDS="$IDS//£[@id=\'$ID\']" done IDS=`echo $IDS | sed -e"s%£%*%g"` cat "$STYLESHEETDIR/update.xsl" | sed -e"s%STYLESHEET%$stylesheet%g" | sed -e's%<xsl:message[a-zA-Z0-9 \t\n].*</xsl:message>%%g' | sed -e's%[<!]*--[>]\?%%g' | sed -e"s%IDMARKER%$IDS%g" > $STYLESHEETDIR/temp.xsl Index: php-gtk/docs/stylesheets/xsl/html/phpweb.xsl diff -u php-gtk/docs/stylesheets/xsl/html/phpweb.xsl:1.2 php-gtk/docs/stylesheets/xsl/html/phpweb.xsl:1.3 --- php-gtk/docs/stylesheets/xsl/html/phpweb.xsl:1.2 Tue May 8 11:03:03 2001 +++ php-gtk/docs/stylesheets/xsl/html/phpweb.xsl Wed May 9 12:59:58 2001 @@ -88,62 +88,112 @@ <xsl:variable name="home" select="/*[1]"/> <xsl:processing-instruction name="php"> - <xsl:text>commonHeader("</xsl:text> - <xsl:apply-templates mode="title.content" select="."/> - <xsl:text>");</xsl:text> + <xsl:text> + require('shared-manual.inc'); + sendManualHeaders('ISO-8859-1','en'); + setupNavigation(array('home' => array(' + </xsl:text> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$home"/> + </xsl:call-template> + <xsl:text> + ', 'PHP-GTK Manual'), + 'prev' => array(' + </xsl:text> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$prev"/> + </xsl:call-template> + <xsl:text>', '</xsl:text> + <xsl:apply-templates select="$prev" mode="title.content" /> + <xsl:text>'), + 'next' => array('</xsl:text> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$next"/> + </xsl:call-template> + <xsl:text>', ' </xsl:text> + <xsl:apply-templates select="$next" mode="title.content" /> + <xsl:text>'), + 'up' => array('</xsl:text> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$up"/> + </xsl:call-template> + <xsl:text>', '</xsl:text> + <xsl:apply-templates select="$up" mode="title.content"/> + <xsl:text>'), + 'toc' => array(</xsl:text> + <xsl:call-template name="gen.toc.array"> + <xsl:with-param name="node" select="." /> + </xsl:call-template> + <xsl:text>))); + manualHeader('</xsl:text> + <xsl:apply-templates select="." mode="title.content"/> + <xsl:text>','</xsl:text> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="."/> + </xsl:call-template> + <xsl:text>');</xsl:text> <xsl:text>?</xsl:text> </xsl:processing-instruction> +</xsl:template> - <xsl:if test="$suppress.navigation = '0'"> - <div class="navheader"> - <table width="100%"> - <tr> - <th colspan="3" align="center"> -   - </th> - </tr> - <tr> - <td width="20%" align="left"> - <xsl:if test="count($prev)>0"> - <a> - <xsl:attribute name="href"> - <xsl:call-template name="href.target"> - <xsl:with-param name="object" select="$prev"/> - </xsl:call-template> - </xsl:attribute> - <xsl:call-template name="gentext.nav.prev"/> - </a> - </xsl:if> - <xsl:text> </xsl:text> - </td> - <th width="60%" align="center"> - <xsl:choose> - <xsl:when test="count($up) > 0 and $up != $home"> - <xsl:apply-templates select="$up" mode="title.ref"/> - </xsl:when> - <xsl:otherwise> </xsl:otherwise> - </xsl:choose> - </th> - <td width="20%" align="right"> - <xsl:text> </xsl:text> - <xsl:if test="count($next)>0"> - <a> - <xsl:attribute name="href"> - <xsl:call-template name="href.target"> - <xsl:with-param name="object" select="$next"/> - </xsl:call-template> - </xsl:attribute> - <xsl:call-template name="gentext.nav.next"/> - </a> - </xsl:if> - </td> - </tr> - </table> - <hr/> - </div> - </xsl:if> +<xsl:template name="gen.toc.array"> + <xsl:param name="node" select="." /> + <!-- we need a few special cases here so that we can handle constructor, methods and signals.. --> + <xsl:choose> + + <xsl:when test="name($node)='constructor' or name($node)='method' or name($node)='signal'"> + <xsl:variable name="classentry" select="ancestor::classentry"/> + <xsl:for-each select="$classentry/constructor|$classentry/methods/*|$classentry/signals/*|$classentry/attributes/*"> + <xsl:call-template name="gen.text.toc.array"> + <xsl:with-param name="node" select="." /> + </xsl:call-template> + </xsl:for-each> + </xsl:when> + + <xsl:when test="name($node)='classentry'"> + <xsl:for-each select="preceding-sibling::classentry|self::*|following-sibling::classentry"> + <xsl:call-template name="gen.text.toc.array"> + <xsl:with-param name="node" select="." /> + </xsl:call-template> + </xsl:for-each> + </xsl:when> + + <xsl:when test="name($node)='sect1'"> + <xsl:for-each select="preceding-sibling::sect1|self::*|following-sibling::sect1"> + <xsl:call-template name="gen.text.toc.array"> + <xsl:with-param name="node" select="." /> + </xsl:call-template> + </xsl:for-each> + </xsl:when> + + + <xsl:otherwise> + <xsl:for-each select="preceding-sibling::node()|self::node()|following-sibling::node()"> + <xsl:call-template name="gen.text.toc.array"> + <xsl:with-param name="node" select="." /> + </xsl:call-template> + </xsl:for-each> + </xsl:otherwise> + </xsl:choose> </xsl:template> +<xsl:template name="gen.text.toc.array"> + <xsl:param name="node" select="."/> + <xsl:variable name="ischunk"> + <xsl:call-template name="chunk"> + <xsl:with-param name="node" select="$node"/> + </xsl:call-template> + </xsl:variable> + <xsl:if test="$ischunk='1'"> + <xsl:text>array('</xsl:text> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$node"/> + </xsl:call-template> + <xsl:text>','</xsl:text> + <xsl:apply-templates select="$node" mode="title.content"/> + <xsl:text>'),</xsl:text> + </xsl:if> +</xsl:template> <xsl:template name="footer.navigation"> <xsl:param name="prev" select="/foo"/> @@ -151,87 +201,16 @@ <xsl:param name="up" select="parent::*"/> <xsl:variable name="home" select="/*[1]"/> - <xsl:if test="$suppress.navigation = '0'"> - <div class="navfooter"> - <hr/> - <table width="100%"> - <tr> - <td width="40%" align="left"> - <xsl:if test="count($prev)>0"> - <a> - <xsl:attribute name="href"> - <xsl:call-template name="href.target"> - <xsl:with-param name="object" select="$prev"/> - </xsl:call-template> - </xsl:attribute> - <xsl:call-template name="gentext.nav.prev"/> - </a> - </xsl:if> - <xsl:text> </xsl:text> - </td> - <td width="20%" align="center"> - <xsl:choose> - <xsl:when test="$home != ."> - <a> - <xsl:attribute name="href"> - <xsl:call-template name="href.target"> - <xsl:with-param name="object" select="$home"/> - </xsl:call-template> - </xsl:attribute> - <xsl:call-template name="gentext.nav.home"/> - </a> - </xsl:when> - <xsl:otherwise> </xsl:otherwise> - </xsl:choose> - </td> - <td width="40%" align="right"> - <xsl:text> </xsl:text> - <xsl:if test="count($next)>0"> - <a> - <xsl:attribute name="href"> - <xsl:call-template name="href.target"> - <xsl:with-param name="object" select="$next"/> - </xsl:call-template> - </xsl:attribute> - <xsl:call-template name="gentext.nav.next"/> - </a> - </xsl:if> - </td> - </tr> - - <tr> - <td width="40%" align="left"> - <xsl:apply-templates select="$prev" mode="title.ref"/> - <xsl:text> </xsl:text> - </td> - <td width="20%" align="center"> - <xsl:choose> - <xsl:when test="count($up)>0"> - <a> - <xsl:attribute name="href"> - <xsl:call-template name="href.target"> - <xsl:with-param name="object" select="$up"/> - </xsl:call-template> - </xsl:attribute> - <xsl:call-template name="gentext.nav.up"/> - </a> - </xsl:when> - <xsl:otherwise> </xsl:otherwise> - </xsl:choose> - </td> - <td width="40%" align="right"> - <xsl:text> </xsl:text> - <xsl:apply-templates select="$next" mode="title.ref"/> - </td> - </tr> - </table> - </div> <xsl:processing-instruction name="php"> - <xsl:text>commonFooter();</xsl:text> + <xsl:text>manualFooter('</xsl:text> + <xsl:apply-templates select="." mode="title.content"/> + <xsl:text>','</xsl:text> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="."/> + </xsl:call-template> + <xsl:text>');</xsl:text> <xsl:text>?</xsl:text> </xsl:processing-instruction> - - </xsl:if> </xsl:template> <xsl:template name="chunk-element-content">
Index: php-gtk/docs/udocs.in diff -u php-gtk/docs/udocs.in:1.7 php-gtk/docs/udocs.in:1.8 --- php-gtk/docs/udocs.in:1.7 Mon May 7 09:11:22 2001 +++ php-gtk/docs/udocs.in Wed May 9 12:59:57 2001 @@ -1,7 +1,7 @@ #!/bin/bash # -# $Id: udocs.in,v 1.7 2001/05/07 16:11:22 andrei Exp $ +# $Id: udocs.in,v 1.8 2001/05/09 19:59:57 jmoore Exp $ # SAXON="@SAXON@" @@ -77,7 +77,7 @@ then xmlfilepath=$srcdir/$LANGDIR/$xmlfile else - xmlfilepath=$srcdir/en/$xmlfile + xmlfilepath=$srcdir/en/$xmlfile fi ID=`head -n 1 $xmlfilepath | sed -e's%<[a-zA-Z0-9 \t\n]\+id="\([A-Za-z0-9.]\+\)"[a-zA-Z0-9 \t\n]\?>%\1%g'` @@ -122,6 +122,8 @@ done fi +IDS="" + case $mode in s ) for file in $xmlfiles do @@ -131,11 +133,12 @@ echo "Could not find ID in $file" exit 1 fi - if [ -n $IDS ] + if test $IDS="" then - IDS="$IDS|" + IDS="//£[@id=\'$ID\']" + else + IDS="$IDS|//£[@id=\'$ID\']" fi - IDS="$IDS//£[@id=\'$ID\']" done IDS=`echo $IDS | sed -e"s%£%*%g"` cat "$STYLESHEETDIR/update.xsl" | sed -e"s%STYLESHEET%$stylesheet%g" | sed -e's%<xsl:message[a-zA-Z0-9 \t\n].*</xsl:message>%%g' | sed -e's%[<!]*--[>]\?%%g' | sed -e"s%IDMARKER%$IDS%g" > $STYLESHEETDIR/temp.xsl Index: php-gtk/docs/stylesheets/xsl/html/phpweb.xsl diff -u php-gtk/docs/stylesheets/xsl/html/phpweb.xsl:1.2 php-gtk/docs/stylesheets/xsl/html/phpweb.xsl:1.3 --- php-gtk/docs/stylesheets/xsl/html/phpweb.xsl:1.2 Tue May 8 11:03:03 2001 +++ php-gtk/docs/stylesheets/xsl/html/phpweb.xsl Wed May 9 12:59:58 2001 @@ -88,62 +88,112 @@ <xsl:variable name="home" select="/*[1]"/> <xsl:processing-instruction name="php"> - <xsl:text>commonHeader("</xsl:text> - <xsl:apply-templates mode="title.content" select="."/> - <xsl:text>");</xsl:text> + <xsl:text> + require('shared-manual.inc'); + sendManualHeaders('ISO-8859-1','en'); + setupNavigation(array('home' => array(' + </xsl:text> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$home"/> + </xsl:call-template> + <xsl:text> + ', 'PHP-GTK Manual'), + 'prev' => array(' + </xsl:text> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$prev"/> + </xsl:call-template> + <xsl:text>', '</xsl:text> + <xsl:apply-templates select="$prev" mode="title.content" /> + <xsl:text>'), + 'next' => array('</xsl:text> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$next"/> + </xsl:call-template> + <xsl:text>', ' </xsl:text> + <xsl:apply-templates select="$next" mode="title.content" /> + <xsl:text>'), + 'up' => array('</xsl:text> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$up"/> + </xsl:call-template> + <xsl:text>', '</xsl:text> + <xsl:apply-templates select="$up" mode="title.content"/> + <xsl:text>'), + 'toc' => array(</xsl:text> + <xsl:call-template name="gen.toc.array"> + <xsl:with-param name="node" select="." /> + </xsl:call-template> + <xsl:text>))); + manualHeader('</xsl:text> + <xsl:apply-templates select="." mode="title.content"/> + <xsl:text>','</xsl:text> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="."/> + </xsl:call-template> + <xsl:text>');</xsl:text> <xsl:text>?</xsl:text> </xsl:processing-instruction> +</xsl:template> - <xsl:if test="$suppress.navigation = '0'"> - <div class="navheader"> - <table width="100%"> - <tr> - <th colspan="3" align="center"> -   - </th> - </tr> - <tr> - <td width="20%" align="left"> - <xsl:if test="count($prev)>0"> - <a> - <xsl:attribute name="href"> - <xsl:call-template name="href.target"> - <xsl:with-param name="object" select="$prev"/> - </xsl:call-template> - </xsl:attribute> - <xsl:call-template name="gentext.nav.prev"/> - </a> - </xsl:if> - <xsl:text> </xsl:text> - </td> - <th width="60%" align="center"> - <xsl:choose> - <xsl:when test="count($up) > 0 and $up != $home"> - <xsl:apply-templates select="$up" mode="title.ref"/> - </xsl:when> - <xsl:otherwise> </xsl:otherwise> - </xsl:choose> - </th> - <td width="20%" align="right"> - <xsl:text> </xsl:text> - <xsl:if test="count($next)>0"> - <a> - <xsl:attribute name="href"> - <xsl:call-template name="href.target"> - <xsl:with-param name="object" select="$next"/> - </xsl:call-template> - </xsl:attribute> - <xsl:call-template name="gentext.nav.next"/> - </a> - </xsl:if> - </td> - </tr> - </table> - <hr/> - </div> - </xsl:if> +<xsl:template name="gen.toc.array"> + <xsl:param name="node" select="." /> + <!-- we need a few special cases here so that we can handle constructor, methods and signals.. --> + <xsl:choose> + + <xsl:when test="name($node)='constructor' or name($node)='method' or name($node)='signal'"> + <xsl:variable name="classentry" select="ancestor::classentry"/> + <xsl:for-each select="$classentry/constructor|$classentry/methods/*|$classentry/signals/*|$classentry/attributes/*"> + <xsl:call-template name="gen.text.toc.array"> + <xsl:with-param name="node" select="." /> + </xsl:call-template> + </xsl:for-each> + </xsl:when> + + <xsl:when test="name($node)='classentry'"> + <xsl:for-each select="preceding-sibling::classentry|self::*|following-sibling::classentry"> + <xsl:call-template name="gen.text.toc.array"> + <xsl:with-param name="node" select="." /> + </xsl:call-template> + </xsl:for-each> + </xsl:when> + + <xsl:when test="name($node)='sect1'"> + <xsl:for-each select="preceding-sibling::sect1|self::*|following-sibling::sect1"> + <xsl:call-template name="gen.text.toc.array"> + <xsl:with-param name="node" select="." /> + </xsl:call-template> + </xsl:for-each> + </xsl:when> + + + <xsl:otherwise> + <xsl:for-each select="preceding-sibling::node()|self::node()|following-sibling::node()"> + <xsl:call-template name="gen.text.toc.array"> + <xsl:with-param name="node" select="." /> + </xsl:call-template> + </xsl:for-each> + </xsl:otherwise> + </xsl:choose> </xsl:template> +<xsl:template name="gen.text.toc.array"> + <xsl:param name="node" select="."/> + <xsl:variable name="ischunk"> + <xsl:call-template name="chunk"> + <xsl:with-param name="node" select="$node"/> + </xsl:call-template> + </xsl:variable> + <xsl:if test="$ischunk='1'"> + <xsl:text>array('</xsl:text> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$node"/> + </xsl:call-template> + <xsl:text>','</xsl:text> + <xsl:apply-templates select="$node" mode="title.content"/> + <xsl:text>'),</xsl:text> + </xsl:if> +</xsl:template> <xsl:template name="footer.navigation"> <xsl:param name="prev" select="/foo"/> @@ -151,87 +201,16 @@ <xsl:param name="up" select="parent::*"/> <xsl:variable name="home" select="/*[1]"/> - <xsl:if test="$suppress.navigation = '0'"> - <div class="navfooter"> - <hr/> - <table width="100%"> - <tr> - <td width="40%" align="left"> - <xsl:if test="count($prev)>0"> - <a> - <xsl:attribute name="href"> - <xsl:call-template name="href.target"> - <xsl:with-param name="object" select="$prev"/> - </xsl:call-template> - </xsl:attribute> - <xsl:call-template name="gentext.nav.prev"/> - </a> - </xsl:if> - <xsl:text> </xsl:text> - </td> - <td width="20%" align="center"> - <xsl:choose> - <xsl:when test="$home != ."> - <a> - <xsl:attribute name="href"> - <xsl:call-template name="href.target"> - <xsl:with-param name="object" select="$home"/> - </xsl:call-template> - </xsl:attribute> - <xsl:call-template name="gentext.nav.home"/> - </a> - </xsl:when> - <xsl:otherwise> </xsl:otherwise> - </xsl:choose> - </td> - <td width="40%" align="right"> - <xsl:text> </xsl:text> - <xsl:if test="count($next)>0"> - <a> - <xsl:attribute name="href"> - <xsl:call-template name="href.target"> - <xsl:with-param name="object" select="$next"/> - </xsl:call-template> - </xsl:attribute> - <xsl:call-template name="gentext.nav.next"/> - </a> - </xsl:if> - </td> - </tr> - - <tr> - <td width="40%" align="left"> - <xsl:apply-templates select="$prev" mode="title.ref"/> - <xsl:text> </xsl:text> - </td> - <td width="20%" align="center"> - <xsl:choose> - <xsl:when test="count($up)>0"> - <a> - <xsl:attribute name="href"> - <xsl:call-template name="href.target"> - <xsl:with-param name="object" select="$up"/> - </xsl:call-template> - </xsl:attribute> - <xsl:call-template name="gentext.nav.up"/> - </a> - </xsl:when> - <xsl:otherwise> </xsl:otherwise> - </xsl:choose> - </td> - <td width="40%" align="right"> - <xsl:text> </xsl:text> - <xsl:apply-templates select="$next" mode="title.ref"/> - </td> - </tr> - </table> - </div> <xsl:processing-instruction name="php"> - <xsl:text>commonFooter();</xsl:text> + <xsl:text>manualFooter('</xsl:text> + <xsl:apply-templates select="." mode="title.content"/> + <xsl:text>','</xsl:text> + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="."/> + </xsl:call-template> + <xsl:text>');</xsl:text> <xsl:text>?</xsl:text> </xsl:processing-instruction> - - </xsl:if> </xsl:template> <xsl:template name="chunk-element-content">