cvs: php-gtk-doc /manual appendix.xml /stylesheets/common en.xml /stylesheets/html autoidx.xsl autotoc.xsl chunk-common.xsl docbook.xsl glossary.xsl
html.xsl

From: Date: Wed, 12 Apr 2006 13:19:20 +0000
Subject: cvs: php-gtk-doc /manual appendix.xml /stylesheets/common en.xml /stylesheets/html autoidx.xsl autotoc.xsl chunk-common.xsl docbook.xsl glossary.xsl
html.xsl
Groups: php.gtk.doc 
Request: Send a blank email to php-gtk-doc+get-2372@lists.php.net to get a copy of this message
cweiske Wed Apr 12 13:19:20 2006 UTC Added files: /php-gtk-doc/stylesheets/html glossary.xsl Modified files: /php-gtk-doc/stylesheets/common en.xml /php-gtk-doc/stylesheets/html autoidx.xsl autotoc.xsl chunk-common.xsl docbook.xsl html.xsl /php-gtk-doc/manual appendix.xml Log: Glossary support

http://cvs.php.net/viewcvs.cgi/php-gtk-doc/stylesheets/common/en.xml?r1=1.22&r2=1.23&diff_format=u Index: php-gtk-doc/stylesheets/common/en.xml diff -u php-gtk-doc/stylesheets/common/en.xml:1.22 php-gtk-doc/stylesheets/common/en.xml:1.23 --- php-gtk-doc/stylesheets/common/en.xml:1.22 Sun Apr 9 21:04:55 2006 +++ php-gtk-doc/stylesheets/common/en.xml Wed Apr 12 13:19:19 2006 @@ -10,6 +10,7 @@ <gentext key="directsubclasses" text="Direct subclasses"/> <gentext key="editedby" text="Edited by:"/> <gentext key="fields" text="Fields"/> + <gentext key="glossary" text="Glossary"/> <gentext key="implementedby" text="Implemented by"/> <gentext key="implementedinterfaces" text="Implemented interfaces"/> <gentext key="interfacewarning" text="This is an interface and cannot be instantiated directly."/> @@ -41,6 +42,10 @@ <gentext key="tip" text="Tip"/> <gentext key="value" text="Value"/> + <context name="glossary"> + <template name="seealso" text="See also:"/> + </context> + <context name="title"> <template name="appendix" text="Appendix %n. %t"/> <template name="book" text="%t"/> @@ -57,6 +62,7 @@ <template name="field" text="%t"/> <template name="fields" text=""/> <template name="figure" text="Figure %n. %t"/> + <template name="glossary" text="%t"/> <template name="legalnotice" text="%t"/> <template name="index" text="%t"/> <template name="method" text="%t"/> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/stylesheets/html/autoidx.xsl?r1=1.4&r2=1.5&diff_format=u Index: php-gtk-doc/stylesheets/html/autoidx.xsl diff -u php-gtk-doc/stylesheets/html/autoidx.xsl:1.4 php-gtk-doc/stylesheets/html/autoidx.xsl:1.5 --- php-gtk-doc/stylesheets/html/autoidx.xsl:1.4 Mon Apr 11 21:54:43 2005 +++ php-gtk-doc/stylesheets/html/autoidx.xsl Wed Apr 12 13:19:19 2006 @@ -17,6 +17,7 @@ |ancestor-or-self::chapter |ancestor-or-self::classentry |ancestor-or-self::appendix + |ancestor-or-self::glossary |ancestor-or-self::preface |ancestor-or-self::section |ancestor-or-self::sect1 http://cvs.php.net/viewcvs.cgi/php-gtk-doc/stylesheets/html/autotoc.xsl?r1=1.13&r2=1.14&diff_format=u Index: php-gtk-doc/stylesheets/html/autotoc.xsl diff -u php-gtk-doc/stylesheets/html/autotoc.xsl:1.13 php-gtk-doc/stylesheets/html/autotoc.xsl:1.14 --- php-gtk-doc/stylesheets/html/autotoc.xsl:1.13 Sun Mar 26 02:46:07 2006 +++ php-gtk-doc/stylesheets/html/autotoc.xsl Wed Apr 12 13:19:19 2006 @@ -6,7 +6,7 @@ version='1.0'> <!-- ******************************************************************** - $Id: autotoc.xsl,v 1.13 2006/03/26 02:46:07 sfox Exp $ + $Id: autotoc.xsl,v 1.14 2006/04/12 13:19:19 cweiske Exp $ ******************************************************************** This file is part of the XSL DocBook Stylesheet distribution. @@ -66,7 +66,7 @@ <xsl:template name="division.toc"> <xsl:if test="$generate.division.toc != 0"> <xsl:variable name="nodes" select="part|classset|enumset|classtree|index - |chapter|appendix + |chapter|appendix|glossary |refentry|bridgehead"/> <xsl:if test="$nodes"> <div class="toc"> @@ -153,7 +153,7 @@ </xsl:if> </xsl:template> -<xsl:template match="appendix|chapter|classset|enumset|part|sect1" mode="toc"> +<xsl:template match="appendix|glossary|chapter|classset|enumset|part|sect1" mode="toc"> <xsl:variable name="nodes" select="bridgehead"/> <xsl:variable name="subtoc"> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/stylesheets/html/chunk-common.xsl?r1=1.12&r2=1.13&diff_format=u Index: php-gtk-doc/stylesheets/html/chunk-common.xsl diff -u php-gtk-doc/stylesheets/html/chunk-common.xsl:1.12 php-gtk-doc/stylesheets/html/chunk-common.xsl:1.13 --- php-gtk-doc/stylesheets/html/chunk-common.xsl:1.12 Sun Mar 26 02:46:07 2006 +++ php-gtk-doc/stylesheets/html/chunk-common.xsl Wed Apr 12 13:19:19 2006 @@ -90,6 +90,7 @@ <xsl:text>1</xsl:text> </xsl:when> <xsl:when test="name($node)='appendix'">1</xsl:when> + <xsl:when test="name($node)='glossary'">1</xsl:when> <xsl:when test="name($node)='chapter'">1</xsl:when> <xsl:when test="name($node)='part'">1</xsl:when> <xsl:when test="name($node)='refentry'">1</xsl:when> @@ -707,6 +708,7 @@ select="(preceding::book[1] |preceding::chapter[1] |preceding::appendix[1] + |preceding::glossary[1] |preceding::part[1] |preceding::constructor[1] |preceding::method[1] @@ -725,6 +727,7 @@ |ancestor::book[1] |ancestor::chapter[1] |ancestor::appendix[1] + |ancestor::glossary[1] |ancestor::part[1] |ancestor::constructor[1] |ancestor::method[1] @@ -739,6 +742,7 @@ select="(following::book[1] |following::chapter[1] |following::appendix[1] + |following::glossary[1] |following::classset[1] |following::enumset[1] |following::part[1] @@ -756,6 +760,7 @@ |descendant::book[1] |descendant::chapter[1] |descendant::appendix[1] + |descendant::glossary[1] |descendant::part[1] |descendant::field[1] |descendant::prop[1] @@ -784,6 +789,7 @@ select="(preceding::book[1] |preceding::chapter[1] |preceding::appendix[1] + |preceding::glossary[1] |preceding::part[1] |preceding::constructor[1] |preceding::method[1] @@ -802,6 +808,7 @@ |ancestor::book[1] |ancestor::chapter[1] |ancestor::appendix[1] + |ancestor::glossary[1] |ancestor::part[1] |ancestor::constructor[1] |ancestor::method[1] @@ -816,6 +823,7 @@ select="(following::book[1] |following::chapter[1] |following::appendix[1] + |following::glossary[1] |following::classset[1] |following::enumset[1] |following::part[1] @@ -833,6 +841,7 @@ |descendant::book[1] |descendant::chapter[1] |descendant::appendix[1] + |descendant::glossary[1] |descendant::part[1] |descendant::enum[1] |descendant::field[1] @@ -860,6 +869,7 @@ select="(preceding::book[1] |preceding::chapter[1] |preceding::appendix[1] + |preceding::glossary[1] |preceding::part[1] |preceding::constructor[1] |preceding::method[1] @@ -877,6 +887,7 @@ |ancestor::book[1] |ancestor::chapter[1] |ancestor::appendix[1] + |ancestor::glossary[1] |ancestor::part[1] |ancestor::reference[1] |ancestor::constructor[1] @@ -892,6 +903,7 @@ select="(following::book[1] |following::chapter[1] |following::appendix[1] + |following::glossary[1] |following::classset[1] |following::enumset[1] |following::part[1] @@ -908,6 +920,7 @@ |descendant::book[1] |descendant::chapter[1] |descendant::appendix[1] + |descendant::glossary[1] |descendant::part[1] |descendant::enum[1] |descendant::field[1] @@ -1072,7 +1085,7 @@ </xsl:choose> </xsl:template> -<xsl:template match="enumset|classset|classtree|classentry|index|method|signal|field|prop|constructor|enum"> +<xsl:template match="glossary|enumset|classset|classtree|classentry|index|method|signal|field|prop|constructor|enum"> <xsl:call-template name="process-chunk-element"/> </xsl:template> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/stylesheets/html/docbook.xsl?r1=1.8&r2=1.9&diff_format=u Index: php-gtk-doc/stylesheets/html/docbook.xsl diff -u php-gtk-doc/stylesheets/html/docbook.xsl:1.8 php-gtk-doc/stylesheets/html/docbook.xsl:1.9 --- php-gtk-doc/stylesheets/html/docbook.xsl:1.8 Thu Feb 9 20:01:06 2006 +++ php-gtk-doc/stylesheets/html/docbook.xsl Wed Apr 12 13:19:20 2006 @@ -9,7 +9,7 @@ indent="no"/> <!-- ******************************************************************** - $Id: docbook.xsl,v 1.8 2006/02/09 20:01:06 scottmattocks Exp $ + $Id: docbook.xsl,v 1.9 2006/04/12 13:19:20 cweiske Exp $ ******************************************************************** This file is part of the XSL DocBook Stylesheet distribution. @@ -35,6 +35,7 @@ <xsl:include href="division.xsl"/> <xsl:include href="enum.xsl"/> <xsl:include href="formal.xsl"/> +<xsl:include href="glossary.xsl"/> <xsl:include href="graphics.xsl"/> <xsl:include href="hierarchy.xsl"/> <xsl:include href="html.xsl"/> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/stylesheets/html/html.xsl?r1=1.5&r2=1.6&diff_format=u Index: php-gtk-doc/stylesheets/html/html.xsl diff -u php-gtk-doc/stylesheets/html/html.xsl:1.5 php-gtk-doc/stylesheets/html/html.xsl:1.6 --- php-gtk-doc/stylesheets/html/html.xsl:1.5 Mon Apr 11 21:54:44 2005 +++ php-gtk-doc/stylesheets/html/html.xsl Wed Apr 12 13:19:20 2006 @@ -3,7 +3,7 @@ version='1.0'> <!-- ******************************************************************** - $Id: html.xsl,v 1.5 2005/04/11 21:54:44 cweiske Exp $ + $Id: html.xsl,v 1.6 2006/04/12 13:19:20 cweiske Exp $ ******************************************************************** This file is part of the XSL DocBook Stylesheet distribution. @@ -52,5 +52,18 @@ </xsl:choose> </xsl:template> +<xsl:template name="anchor"> + <xsl:param name="node" select="."/> + <xsl:param name="conditional" select="1"/> + <xsl:variable name="id"> + <xsl:call-template name="object.id"> + <xsl:with-param name="object" select="$node"/> + </xsl:call-template> + </xsl:variable> + <xsl:if test="$conditional = 0 or $node/@id or $node/@xml:id"> + <a id="{$id}"/> + </xsl:if> +</xsl:template> + </xsl:stylesheet> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/manual/appendix.xml?r1=1.3&r2=1.4&diff_format=u Index: php-gtk-doc/manual/appendix.xml diff -u php-gtk-doc/manual/appendix.xml:1.3 php-gtk-doc/manual/appendix.xml:1.4 --- php-gtk-doc/manual/appendix.xml:1.3 Sun Mar 26 02:50:40 2006 +++ php-gtk-doc/manual/appendix.xml Wed Apr 12 13:19:20 2006 @@ -5,6 +5,7 @@ &appendix.doccredits; &appendix.license; &appendix.translicense; + &appendix.glossary; <!-- &keysyms;--> <index id="classindex"> http://cvs.php.net/viewcvs.cgi/php-gtk-doc/stylesheets/html/glossary.xsl?view=markup&rev=1.1 Index: php-gtk-doc/stylesheets/html/glossary.xsl +++ php-gtk-doc/stylesheets/html/glossary.xsl <?xml version='1.0'?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'> <!-- ******************************************************************** $Id: glossary.xsl,v 1.1 2006/04/12 13:19:20 cweiske Exp $ ******************************************************************** This file is part of the XSL DocBook Stylesheet distribution. See ../README or http://nwalsh.com/docbook/xsl/ for copyright and other information. ******************************************************************** --> <!-- ==================================================================== --> <xsl:param name="glossentry.show.acronym" select="1"/> <xsl:param name="generate.id.attributes" select="1"/> <xsl:param name="glossterm.auto.link" select="1"/> <xsl:template match="glossary"> <div class="{name(.)}"> <xsl:if test="$generate.id.attributes != 0"> <xsl:attribute name="id"> <xsl:call-template name="object.id"/> </xsl:attribute> </xsl:if> <xsl:call-template name="glossary.titlepage"/> <xsl:choose> <xsl:when test="glossdiv"> <xsl:apply-templates select="(glossdiv[1]/preceding-sibling::*)"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="(glossentry[1]/preceding-sibling::*)"/> </xsl:otherwise> </xsl:choose> <xsl:choose> <xsl:when test="glossdiv"> <xsl:apply-templates select="glossdiv"/> </xsl:when> <xsl:otherwise> <dl> <xsl:apply-templates select="glossentry"/> </dl> </xsl:otherwise> </xsl:choose> <!-- <xsl:if test="not(parent::article)"> <xsl:call-template name="process.footnotes"/> </xsl:if> --> </div> </xsl:template> <xsl:template match="glossary/glossaryinfo"></xsl:template> <xsl:template match="glossary/title"></xsl:template> <xsl:template match="glossary/subtitle"></xsl:template> <xsl:template match="glossary/titleabbrev"></xsl:template> <!-- ==================================================================== --> <xsl:template match="glosslist"> <div class="{name(.)}"> <xsl:call-template name="anchor"/> <xsl:if test="blockinfo/title|title"> <xsl:call-template name="formal.object.heading"/> </xsl:if> <dl> <xsl:apply-templates select="glossentry"/> </dl> </div> </xsl:template> <!-- ==================================================================== --> <xsl:template match="glossdiv"> <div class="{name(.)}"> <xsl:apply-templates select="(glossentry[1]/preceding-sibling::*)"/> <dl> <xsl:apply-templates select="glossentry"/> </dl> </div> </xsl:template> <xsl:template match="glossdiv/title"> <h3 class="{name(.)}"> <xsl:apply-templates/> </h3> </xsl:template> <!-- ==================================================================== --> <!-- GlossEntry ::= GlossTerm, Acronym?, Abbrev?, (IndexTerm)*, RevHistory?, (GlossSee | GlossDef+) --> <xsl:template match="glossentry"> <xsl:choose> <xsl:when test="$glossentry.show.acronym = 'primary'"> <dt> <xsl:call-template name="anchor"> <xsl:with-param name="conditional"> <xsl:choose> <xsl:when test="$glossterm.auto.link != 0">0</xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:with-param> </xsl:call-template> <xsl:choose> <xsl:when test="acronym|abbrev"> <xsl:apply-templates select="acronym|abbrev"/> <xsl:text> (</xsl:text> <xsl:apply-templates select="glossterm"/> <xsl:text>)</xsl:text> </xsl:when> <xsl:otherwise> <xsl:apply-templates select="glossterm"/> </xsl:otherwise> </xsl:choose> </dt> </xsl:when> <xsl:when test="$glossentry.show.acronym = 'yes'"> <dt> <xsl:call-template name="anchor"> <xsl:with-param name="conditional"> <xsl:choose> <xsl:when test="$glossterm.auto.link != 0">0</xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:with-param> </xsl:call-template> <xsl:apply-templates select="glossterm"/> <xsl:if test="acronym|abbrev"> <xsl:text> (</xsl:text> <xsl:apply-templates select="acronym|abbrev"/> <xsl:text>)</xsl:text> </xsl:if> </dt> </xsl:when> <xsl:otherwise> <dt> <xsl:call-template name="anchor"> <xsl:with-param name="conditional"> <xsl:choose> <xsl:when test="$glossterm.auto.link != 0">0</xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:with-param> </xsl:call-template> <xsl:apply-templates select="glossterm"/> </dt> </xsl:otherwise> </xsl:choose> <xsl:apply-templates select="indexterm|revhistory|glosssee|glossdef"/> </xsl:template> <xsl:template match="glossentry/glossterm"> <xsl:apply-templates/> <xsl:if test="following-sibling::glossterm">, </xsl:if> </xsl:template> <xsl:template match="glossentry/acronym"> <xsl:apply-templates/> <xsl:if test="following-sibling::acronym|following-sibling::abbrev">, </xsl:if> </xsl:template> <xsl:template match="glossentry/abbrev"> <xsl:apply-templates/> <xsl:if test="following-sibling::acronym|following-sibling::abbrev">, </xsl:if> </xsl:template> <xsl:template match="glossentry/revhistory"> </xsl:template> <xsl:template match="glossentry/glosssee"> <xsl:variable name="otherterm" select="@otherterm"/> <xsl:variable name="targets" select="//node()[@id=$otherterm]"/> <xsl:variable name="target" select="$targets[1]"/> <dd> <p> <xsl:call-template name="gentext.template"> <xsl:with-param name="context" select="'glossary'"/> <xsl:with-param name="name" select="'see'"/> </xsl:call-template> <xsl:choose> <xsl:when test="$target"> <a> <xsl:attribute name="href"> <xsl:call-template name="href.target"> <xsl:with-param name="object" select="$target"/> </xsl:call-template> </xsl:attribute> <xsl:apply-templates select="$target" mode="xref-to"/> </a> </xsl:when> <xsl:when test="$otherterm != '' and not($target)"> <xsl:message> <xsl:text>Warning: glosssee @otherterm reference not found: </xsl:text> <xsl:value-of select="$otherterm"/> </xsl:message> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> <xsl:text>.</xsl:text> </p> </dd> </xsl:template> <xsl:template match="glossentry/glossdef"> <dd> <xsl:apply-templates select="*[local-name(.) != 'glossseealso']"/> <xsl:if test="glossseealso"> <p> <xsl:call-template name="gentext.template"> <xsl:with-param name="context" select="'glossary'"/> <xsl:with-param name="name" select="'seealso'"/> </xsl:call-template> <xsl:text> </xsl:text> <xsl:apply-templates select="glossseealso"/> </p> </xsl:if> </dd> </xsl:template> <xsl:template match="glossseealso"> <xsl:variable name="otherterm" select="@otherterm"/> <xsl:variable name="targets" select="//node()[@id=$otherterm]"/> <xsl:variable name="target" select="$targets[1]"/> <xsl:choose> <xsl:when test="$target"> <a> <xsl:attribute name="href"> <xsl:call-template name="href.target"> <xsl:with-param name="object" select="$target"/> </xsl:call-template> </xsl:attribute> <!-- This line here doesn't work as we don't have full docbook sheets the line below is simpler and works --> <!-- <xsl:apply-templates select="$target" mode="xref-to"/> --> <xsl:value-of select="$target/glossterm"/> </a> </xsl:when> <xsl:when test="$otherterm != '' and not($target)"> <xsl:message> <xsl:text>Warning: glossseealso @otherterm reference not found: </xsl:text> <xsl:value-of select="$otherterm"/> </xsl:message> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> <xsl:choose> <xsl:when test="position() = last()"> <xsl:text>.</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>, </xsl:text> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ==================================================================== --> <!-- Glossary collection --> <xsl:template match="glossary[@role='auto']" priority="2"> <xsl:variable name="terms" select="//glossterm[not(parent::glossdef)]|//firstterm"/> <xsl:variable name="collection" select="document($glossary.collection, .)"/> <xsl:if test="$glossary.collection = ''"> <xsl:message> <xsl:text>Warning: processing automatic glossary </xsl:text> <xsl:text>without a glossary.collection file.</xsl:text> </xsl:message> </xsl:if> <xsl:if test="not($collection) and $glossary.collection != ''"> <xsl:message> <xsl:text>Warning: processing automatic glossary but unable to </xsl:text> <xsl:text>open glossary.collection file '</xsl:text> <xsl:value-of select="$glossary.collection"/> <xsl:text>'</xsl:text> </xsl:message> </xsl:if> <div class="{name(.)}"> <xsl:if test="$generate.id.attributes != 0"> <xsl:attribute name="id"> <xsl:call-template name="object.id"/> </xsl:attribute> </xsl:if> <xsl:call-template name="glossary.titlepage"/> <xsl:choose> <xsl:when test="glossdiv and $collection//glossdiv"> <xsl:for-each select="$collection//glossdiv"> <!-- first see if there are any in this div --> <xsl:variable name="exist.test"> <xsl:for-each select="glossentry"> <xsl:variable name="cterm" select="glossterm"/> <xsl:if test="$terms[@baseform = $cterm or . = $cterm]"> <xsl:value-of select="glossterm"/> </xsl:if> </xsl:for-each> </xsl:variable> <xsl:if test="$exist.test != ''"> <xsl:apply-templates select="." mode="auto-glossary"> <xsl:with-param name="terms" select="$terms"/> </xsl:apply-templates> </xsl:if> </xsl:for-each> </xsl:when> <xsl:otherwise> <dl> <xsl:for-each select="$collection//glossentry"> <xsl:variable name="cterm" select="glossterm"/> <xsl:if test="$terms[@baseform = $cterm or . = $cterm]"> <xsl:apply-templates select="." mode="auto-glossary"/> </xsl:if> </xsl:for-each> </dl> </xsl:otherwise> </xsl:choose> <xsl:if test="not(parent::article)"> <xsl:call-template name="process.footnotes"/> </xsl:if> </div> </xsl:template> <xsl:template match="*" mode="auto-glossary"> <!-- pop back out to the default mode for most elements --> <xsl:apply-templates select="."/> </xsl:template> <xsl:template match="glossdiv" mode="auto-glossary"> <xsl:param name="terms" select="."/> <div class="{name(.)}"> <xsl:apply-templates select="(glossentry[1]/preceding-sibling::*)"/> <dl> <xsl:for-each select="glossentry"> <xsl:variable name="cterm" select="glossterm"/> <xsl:if test="$terms[@baseform = $cterm or . = $cterm]"> <xsl:apply-templates select="." mode="auto-glossary"/> </xsl:if> </xsl:for-each> </dl> </div> </xsl:template> <!-- ==================================================================== --> </xsl:stylesheet>
« previous php.gtk.doc (#2372) next »