cvs: php-gtk-doc /dbxml phpgtkdoc.dtd /stylesheets/xsl/html chunk-common.xsl enum.xsl label.xsl title.xsl

From: Date: Sat, 09 Jun 2001 10:12:41 +0000
Subject: cvs: php-gtk-doc /dbxml phpgtkdoc.dtd /stylesheets/xsl/html chunk-common.xsl enum.xsl label.xsl title.xsl
Groups: php.gtk 
Request: Send a blank email to php-gtk+get-1931@lists.php.net to get a copy of this message
jmoore Sat Jun 9 12:12:41 2001 EDT Modified files: /php-gtk-doc/dbxml phpgtkdoc.dtd /php-gtk-doc/stylesheets/xsl/html chunk-common.xsl enum.xsl label.xsl title.xsl Log: - Adding Enum support to stylesheets Index: php-gtk-doc/dbxml/phpgtkdoc.dtd diff -u php-gtk-doc/dbxml/phpgtkdoc.dtd:1.1.1.1 php-gtk-doc/dbxml/phpgtkdoc.dtd:1.2 --- php-gtk-doc/dbxml/phpgtkdoc.dtd:1.1.1.1 Fri Jun 1 16:33:46 2001 +++ php-gtk-doc/dbxml/phpgtkdoc.dtd Sat Jun 9 12:12:40 2001 @@ -1,7 +1,8 @@ <!-- Docbook Customiszation layer of PHP-GTK docs + Authors: James Moore <jmoore@php.net> - $Id: phpgtkdoc.dtd,v 1.1.1.1 2001/06/01 14:33:46 andrei Exp $ + $Id: phpgtkdoc.dtd,v 1.2 2001/06/09 10:12:40 jmoore Exp $ --> @@ -23,7 +24,7 @@ - Must contain classmeta - Must contain one or more classentry's --> -<!ELEMENT classset ((classsetmeta), (classentry)+)> +<!ELEMENT classset ((classsetmeta), (classentry, enum)+)> <!ATTLIST classset %common.attrib; > @@ -250,3 +251,43 @@ <!ATTLIST attributename %common.attrib; > + +<!-- + + - enum: contains enum and flag information + +--> +<!ELEMENT enum ((enumname),(enumoption)+) > +<!ATTLIST enum + %common.attrib; +> + +<!-- + + - enumname: contains symbolic name of enum or flag + +--> +<!ELEMENT enumname (%docinfo.char.mix;)* > +<!ATTLIST enumname + %common.attrib; +> + +<!-- + + - enumname: contains each option of an enum + +--> +<!ELEMENT enumoption ((optionname),(shortdesc)) > +<!ATTLIST enumoption + %common.attrib; +> + +<!-- + + - optionname: contains symbolic name of a flag or enum option. + +--> +<!ELEMENT optionname (%docinfo.char.mix;)* > +<!ATTLIST optionname + %common.attrib; +> \ No newline at end of file Index: php-gtk-doc/stylesheets/xsl/html/chunk-common.xsl diff -u php-gtk-doc/stylesheets/xsl/html/chunk-common.xsl:1.1.1.1 php-gtk-doc/stylesheets/xsl/html/chunk-common.xsl:1.2 --- php-gtk-doc/stylesheets/xsl/html/chunk-common.xsl:1.1.1.1 Fri Jun 1 16:33:47 2001 +++ php-gtk-doc/stylesheets/xsl/html/chunk-common.xsl Sat Jun 9 12:12:40 2001 @@ -44,6 +44,7 @@ <xsl:when test="name($node)='signal'">1</xsl:when> <xsl:when test="name($node)='constructor'">1</xsl:when> <xsl:when test="name($node)='legalnotice'">1</xsl:when> + <xsl:when test="name($node)='enum'">1</xsl:when> <xsl:otherwise>0</xsl:otherwise> </xsl:choose> </xsl:template> @@ -157,6 +158,7 @@ |preceding::classentry[1] |preceding::reference[1] |preceding::refentry[1] + |preceding::enum[1] |preceding::colophon[1] |preceding::sect1[name(preceding-sibling::*[1]) = 'sect1'][1] |preceding::section[name(preceding-sibling::*[1]) = 'section' @@ -196,6 +198,7 @@ |following::reference[1] |following::refentry[1] |following::colophon[1] + |following::enum[1] |following::sect1[1] |following::section[name(parent::*) != 'section'][1] |following::bibliography[1] @@ -212,6 +215,7 @@ |descendant::glossary[1] |descendant::index[1] |descendant::colophon[1] + |descendant::enum[1] |descendant::setindex[1] |descendant::part[1] |descendant::constructor[1] @@ -286,7 +290,7 @@ <!-- ==================================================================== --> -<xsl:template match="classset|classentry|method|signal|attribute|constructor"> +<xsl:template match="classset|classentry|method|signal|attribute|constructor|enum"> <xsl:call-template name="process-chunk-element"/> </xsl:template> Index: php-gtk-doc/stylesheets/xsl/html/enum.xsl diff -u php-gtk-doc/stylesheets/xsl/html/enum.xsl:1.1.1.1 php-gtk-doc/stylesheets/xsl/html/enum.xsl:1.2 --- php-gtk-doc/stylesheets/xsl/html/enum.xsl:1.1.1.1 Fri Jun 1 16:33:47 2001 +++ php-gtk-doc/stylesheets/xsl/html/enum.xsl Sat Jun 9 12:12:40 2001 @@ -1,8 +1,88 @@ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> -<xsl:template match="enumname"> - <xsl:apply-templates /> -</xsl:template> + <xsl:template match="enumname"> + <xsl:choose> + <xsl:when test="name(parent::node())='enum'"> + <xsl:apply-templates /> + </xsl:when> + <xsl:otherwise> + <xsl:variable name="knownenum"> + <xsl:call-template name="is.known.enum"> + <xsl:with-param name="enumname"> + <xsl:value-of select="."/> + </xsl:with-param> + </xsl:call-template> + </xsl:variable> + + <xsl:choose> + <xsl:when test="$knownenum='1'"> + <a> + <xsl:attribute name="href"> + <xsl:call-template name="gen.enumname.url"> + <xsl:with-param name="enumname"> + <xsl:value-of select="."/> + </xsl:with-param> + </xsl:call-template> + </xsl:attribute> + <xsl:apply-templates /> + </a> + </xsl:when> + <xsl:otherwise> + <b> + <xsl:apply-templates /> + </b> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + + </xsl:choose> + </xsl:template> + + <xsl:template match="enum"> + <table cellpadding="2" cellspacing="1"> + <tr> + <td colspan="2"> + <h1> + <xsl:attribute name="class"> + <xsl:value-of select="name(.)" /> + </xsl:attribute> + <xsl:apply-templates select="./enumname" /> + </h1> + </td> + </tr> + <xsl:apply-templates select="./enumoption" /> + </table> + </xsl:template> + + <xsl:template match="enumoption"> + <tr valign="top"> + <td> + <xsl:apply-templates select="./optionname" /> + </td> + <td> + <xsl:apply-templates select="./shortdesc" /> + </td> + </tr> + </xsl:template> + + <xsl:template match="optionname"> + <xsl:apply-templates /> + </xsl:template> + +<!-- ================================================================ --> + <xsl:template name="gen.enumname.url"> + <xsl:param name="enumname" /> + + <xsl:variable name="enumnode" select="//enum[enumname='$enumname']" /> + + <xsl:call-template name="href.target"> + <xsl:with-param name="object" select="$enumnode"/> + </xsl:call-template> + </xsl:template> + + <xsl:template name="is.known.enum"> + <xsl:value-of select="1"/> + </xsl:template> </xsl:stylesheet> Index: php-gtk-doc/stylesheets/xsl/html/label.xsl diff -u php-gtk-doc/stylesheets/xsl/html/label.xsl:1.1.1.1 php-gtk-doc/stylesheets/xsl/html/label.xsl:1.2 --- php-gtk-doc/stylesheets/xsl/html/label.xsl:1.1.1.1 Fri Jun 1 16:33:47 2001 +++ php-gtk-doc/stylesheets/xsl/html/label.xsl Sat Jun 9 12:12:40 2001 @@ -29,7 +29,7 @@ </xsl:if> </xsl:template> -<xsl:template match="method|signal|attribute|constructor|legalnotice" mode="label.content"> +<xsl:template match="method|signal|attribute|constructor|legalnotice|enum" mode="label.content"> <xsl:param name="punct">.</xsl:param> <xsl:if test="@label"> <xsl:value-of select="@label"/> Index: php-gtk-doc/stylesheets/xsl/html/title.xsl diff -u php-gtk-doc/stylesheets/xsl/html/title.xsl:1.1.1.1 php-gtk-doc/stylesheets/xsl/html/title.xsl:1.2 --- php-gtk-doc/stylesheets/xsl/html/title.xsl:1.1.1.1 Fri Jun 1 16:33:47 2001 +++ php-gtk-doc/stylesheets/xsl/html/title.xsl Sat Jun 9 12:12:40 2001 @@ -79,5 +79,11 @@ <xsl:value-of select="(./funcsynopsis/funcprototype/funcdef/function)[1]"/> </xsl:template> +<xsl:template match="enum" mode="title.content" > + <xsl:param name="text-only" select="'0'"/> + <xsl:param name="allow-anchors" select="'0'"/> + <xsl:value-of select="./enumname"/> +</xsl:template> + </xsl:stylesheet>

« previous php.gtk (#1931) next »