[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-gtk-doc
Subject:    [PHP-GTK-DOC] cvs: php-gtk-doc / Makefile.in configure.in mtoc.xml.in  /stylesheets/html autotoc.xsl
From:       "Christian Weiske" <cweiske () php ! net>
Date:       2004-10-07 15:44:46
Message-ID: cvscweiske1097163886 () cvsserver
[Download RAW message or body]

cweiske		Thu Oct  7 11:44:46 2004 EDT

  Added files:                 
    /php-gtk-doc	mtoc.xml.in 

  Modified files:              
    /php-gtk-doc/stylesheets/html	autotoc.xsl 
    /php-gtk-doc	Makefile.in configure.in 
  Log:
  Added an extension for "machine readable" TOCs (table of contents)
  They can be used by programs/IDEs to integrate the php-gtk manual
  I am currently writing a PHP-Gtk manual browser, similar to the chm version
  of the php manual, and it is the first program which makes use of this.
  
http://cvs.php.net/diff.php/php-gtk-doc/stylesheets/html/autotoc.xsl?r1=1.6&r2=1.7&ty=u
                
Index: php-gtk-doc/stylesheets/html/autotoc.xsl
diff -u php-gtk-doc/stylesheets/html/autotoc.xsl:1.6 \
                php-gtk-doc/stylesheets/html/autotoc.xsl:1.7
--- php-gtk-doc/stylesheets/html/autotoc.xsl:1.6	Sun Aug  1 12:41:29 2004
+++ php-gtk-doc/stylesheets/html/autotoc.xsl	Thu Oct  7 11:44:44 2004
@@ -1,4 +1,4 @@
-<?xml version='1.0'?>
+<?xml version='1.0' encoding="iso-8859-1" ?>
 <!DOCTYPE xsl:stylesheet [
 <!ENTITY nbsp "&#160;">
 ]>
@@ -6,7 +6,7 @@
                 version='1.0'>
 
 <!-- ********************************************************************
-     $Id: autotoc.xsl,v 1.6 2004/08/01 16:41:29 cweiske Exp $
+     $Id: autotoc.xsl,v 1.7 2004/10/07 15:44:44 cweiske Exp $
      ********************************************************************
 
      This file is part of the XSL DocBook Stylesheet distribution.
@@ -282,5 +282,91 @@
 </xsl:template>
 
 
+<!-- machine-readable TOC in XML format-->
+<!-- 
+TODO:
+- use given directory
+- Methods, properties and signals shall be Uppercase (word) 
+-->
+<xsl:template match="mtoc">
+  <xsl:call-template name="write.chunk">
+    <xsl:with-param name="filename">testbuild/mtoc.xml</xsl:with-param>
+    <xsl:with-param name="indent">'yes'</xsl:with-param>
+    <xsl:with-param name="content">
+     <xsl:text disable-output-escaping="yes"><![CDATA[<?xml version='1.0' \
encoding='utf-8' ?> +]]></xsl:text>
+      <mtoc>
+        <xsl:call-template name="tocentry">
+          <xsl:with-param name="indent">
+            <xsl:text><![CDATA[
+]]>  </xsl:text>
+          </xsl:with-param>
+        </xsl:call-template>
+      <xsl:text><![CDATA[
+]]></xsl:text>
+      </mtoc>
+    </xsl:with-param>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="tocentry">
+  <xsl:param name="indent"/>
+  <xsl:for-each select="*[@id!='']|methods|properties|signals|enums/enum">
+    <xsl:variable name="title">
+      <xsl:choose>
+        <xsl:when test="name(.)='classentry'">
+          <xsl:value-of select="classmeta/classtitle"/>
+        </xsl:when>
+        <xsl:when test="name(.)='constructor'">
+          <xsl:text>Constructor</xsl:text>
+        </xsl:when>
+        
+        <xsl:when test="(name(.)='methods') or (name(.)='properties') or \
(name(.)='signals')"> +          <xsl:value-of select="name(.)"/>
+        </xsl:when>
+        
+        <xsl:when test="name(.)='prop'">
+          <xsl:value-of select="propname"/>
+        </xsl:when>
+        <xsl:when test="name(.)='method'">
+          <xsl:value-of select="funcsynopsis/funcprototype/funcdef/function"/>
+        </xsl:when>
+        <xsl:when test="name(.)='signal'">
+          <xsl:value-of select="signalname"/>
+        </xsl:when>
+        <xsl:when test="name(.)='enum'">
+          <xsl:value-of select="enumname"/>
+        </xsl:when>
+        
+        <xsl:otherwise>
+          <xsl:value-of select="title" />
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <xsl:if test="$title!=''">
+      <xsl:value-of select="$indent"/>
+      <xsl:variable name="file">
+        <xsl:choose>
+          <xsl:when test="@id!=''"><xsl:value-of \
select="@id"/><xsl:text>.html</xsl:text></xsl:when> +          \
<xsl:otherwise></xsl:otherwise> +        </xsl:choose>
+      </xsl:variable>
+      <tocentry file="{$file}">
+        <xsl:value-of select="$indent"/>
+        <xsl:text>  </xsl:text>
+        <title>    
+          <xsl:value-of select="$title" />
+        </title>
+        
+        <xsl:call-template name="tocentry">
+          <xsl:with-param name="indent"><xsl:value-of select="$indent"/><xsl:text>  \
</xsl:text></xsl:with-param> +        </xsl:call-template>
+      <xsl:value-of select="$indent"/>
+      </tocentry>
+    </xsl:if>
+  </xsl:for-each>
+
+</xsl:template>
+
 </xsl:stylesheet>
 
http://cvs.php.net/diff.php/php-gtk-doc/Makefile.in?r1=1.20&r2=1.21&ty=u
Index: php-gtk-doc/Makefile.in
diff -u php-gtk-doc/Makefile.in:1.20 php-gtk-doc/Makefile.in:1.21
--- php-gtk-doc/Makefile.in:1.20	Sat Aug  7 01:54:56 2004
+++ php-gtk-doc/Makefile.in	Thu Oct  7 11:44:45 2004
@@ -14,7 +14,7 @@
 # +----------------------------------------------------------------------+
 
 #
-# $Id: Makefile.in,v 1.20 2004/08/07 05:54:56 andrei Exp $
+# $Id: Makefile.in,v 1.21 2004/10/07 15:44:45 cweiske Exp $
 #
 
 #
@@ -43,6 +43,7 @@
 #
 bigmanual.html: $(BUILD)/bigmanual.html
 html: $(BUILD)/html/index.html
+mtoc: $(BUILD_TEST)/mtoc.xml
 phpweb: $(BUILD)/php/index.php
 searchable_zip: $(BUILD)/searchable_manual_$(LANG).zip
 searchable_tar: $(BUILD)/searchable_manual_$(LANG).tar.gz
@@ -114,6 +115,10 @@
 	@mkdir -p $(BUILD_TEST)
 	$(XSLTPROC) --param base.dir "'$(BUILD_TEST)/'" $(chunk) testmanual.xml
 
+$(BUILD_TEST)/mtoc.xml: mtoc.xml
+	@mkdir -p $(BUILD_TEST)
+	$(XSLTPROC) --param base.dir "'$(BUILD_TEST)/'" $(chunk) mtoc.xml
+
 
 #
 # The 'searchable' builds should only ever be created LOCALLY!!!
http://cvs.php.net/diff.php/php-gtk-doc/configure.in?r1=1.23&r2=1.24&ty=u
Index: php-gtk-doc/configure.in
diff -u php-gtk-doc/configure.in:1.23 php-gtk-doc/configure.in:1.24
--- php-gtk-doc/configure.in:1.23	Sat Jul 31 23:50:25 2004
+++ php-gtk-doc/configure.in	Thu Oct  7 11:44:46 2004
@@ -14,7 +14,7 @@
 # +----------------------------------------------------------------------+
 
 #
-# $Id: configure.in,v 1.23 2004/08/01 03:50:25 andrei Exp $
+# $Id: configure.in,v 1.24 2004/10/07 15:44:46 cweiske Exp $
 #
 
 AC_INIT(global.ent)
@@ -199,6 +199,7 @@
 AC_OUTPUT(\
 Makefile \
 manual.xml \
+mtoc.xml \
 testmanual.xml \
 stylesheets/html/phpweb.xsl \
 scripts/genchapterents.php )

http://cvs.php.net/co.php/php-gtk-doc/mtoc.xml.in?r=1.1&p=1
Index: php-gtk-doc/mtoc.xml.in
+++ php-gtk-doc/mtoc.xml.in
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE book PUBLIC "@DOCBOOK_DOCTYPE@" "@srcdir@/dbxml/phpgtkdoc.dtd"[

<!-- Defaults for entities that should be defined in language-defs -->
<!ENTITY % language-defs    SYSTEM "@UTF8LANG@/language-defs.ent">
%language-defs;

<!-- These are language independent -->
<!ENTITY phpgtk.build-date "@PHP_GTK_DOC_BUILD_DATE@">
<!ENTITY % global.entities  SYSTEM "global.ent">
<!ENTITY % global.chapters  SYSTEM "chapters.ent">
%global.entities;
%global.chapters;

<!ENTITY userguide   SYSTEM "userguide.xml">
<!ENTITY tutorials   SYSTEM "tutorials.xml">
<!ENTITY reference   SYSTEM "reference.xml">
<!ENTITY appendix    SYSTEM "appendix.xml">
<!ENTITY keysyms     SYSTEM "keysyms.xml">
<!ENTITY license     SYSTEM "license.xml">

]>

<mtoc>
 &bookinfo;
 &preface;
 &userguide;
 &tutorials;
 &reference;
 &appendix;
</mtoc>

-- 
PHP-GTK Documentation Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic