svn: /phpdoc/doc-base/branches/gtk-docgen/scripts/docgen/ docgen.php gtk/book.tpl gtk/part.tpl

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn: /phpdoc/doc-base/branches/gtk-docgen/scripts/docgen/ docgen.php gtk/book.tpl gtk/part.tpl

Justin Martin-5
frozenfire                               Sat, 26 Feb 2011 23:07:27 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=308716

Log:
Added subextension templates and code.

Changed paths:
    U   phpdoc/doc-base/branches/gtk-docgen/scripts/docgen/docgen.php
    U   phpdoc/doc-base/branches/gtk-docgen/scripts/docgen/gtk/book.tpl
    A   phpdoc/doc-base/branches/gtk-docgen/scripts/docgen/gtk/part.tpl

Modified: phpdoc/doc-base/branches/gtk-docgen/scripts/docgen/docgen.php
===================================================================
--- phpdoc/doc-base/branches/gtk-docgen/scripts/docgen/docgen.php 2011-02-26 21:17:36 UTC (rev 308715)
+++ phpdoc/doc-base/branches/gtk-docgen/scripts/docgen/docgen.php 2011-02-26 23:07:27 UTC (rev 308716)
@@ -271,10 +271,9 @@
  $content = str_replace('{EMPTY_REVISION_KEYWORD}', '<!-- '. chr(36) .'Revision$ -->', $content);

  if($OPTION['gtk']) {
- if(!$INFO['subextension']) $INFO['subextension'] = '';
-
  /* {SUB_EXT_NAME_ID} */
- $content = preg_replace('/\{SUB_EXT_NAME_ID\}/', '.'.$INFO['subextension'], $content);
+ if(!empty($INFO['subextension'])) foreach($INFO['subextension'] as $extname => $subext) if($subext['current'] === TRUE)
+ $content = preg_replace('/\{SUB_EXT_NAME_ID\}/', '.'.$extname, $content);
  }

  return $content;
@@ -874,6 +873,18 @@
  save_file($filename, global_check($content));
  }
  }
+ break;
+
+ case DOC_PART:
+ $path = $OPTION['output'] .'/../';
+ $filename = $path .'part.'. format_filename($obj) .'.xml';
+
+ $content = file_get_contents(dirname(__FILE__) .'/'. $TEMPLATE[$type]);
+
+ $content = preg_replace('/\{PART_NAME_ID\}/', format_id($obj), $content);
+ $content = preg_replace('/\{PART_NAME\}/', $obj, $content);
+
+ save_file($filename, $content);
  break;

  /* Methods */
@@ -990,14 +1001,16 @@
  $dirsep = DIRECTORY_SEPARATOR;
  $initialOutput = $OPTION["output"];
  $exts = glob("{$OPTION['gtk']}{$dirsep}*", GLOB_ONLYDIR);
+ $INFO['subextension'] = array();
  foreach($exts as $ext) {
  $extname = format_id(basename($ext));
  if ($OPTION['verbose']) echo "Generating ".$extname." PHP-GTK sub-extension.".PHP_EOL;
  $classes = array();
  $OPTION["output"] = $OPTION["output"].$dirsep.$extname;
- $INFO['subextension'] = $extname;
  create_dir($OPTION["output"]);

+ write_doc($extname, DOC_PART);
+
  $defs = glob("{$ext}{$dirsep}*.defs");
  if(empty($defs)) continue;
  foreach($defs as &$defsfile) {
@@ -1019,22 +1032,33 @@

  if($extname == "gtkplus") {
  $classLevelOutput = $OPTION["output"];
+ $INFO['subextension'][$extname] = array('current'=>FALSE, 'classes'=>array());

  if(is_int(stripos($classtmp, "Gtk"))) {
  $OPTION["output"] = $OPTION["output"]."{$dirsep}gtk";
- $INFO['subextension'] = "$extname.gtk";
+ $INFO['subextension'][$extname]['classes'][] = $classtmp;
+ create_dir($OPTION["output"]);
+
+ write_doc("GTK", DOC_PART);
  } elseif(is_int(stripos($classtmp, "Atk"))) {
  $OPTION["output"] = $OPTION["output"]."{$dirsep}atk";
- $INFO['subextension'] = "$extname.atk";
+ $INFO['subextension'][$extname][] = $classtmp;
+ create_dir($OPTION["output"]);
+
+ write_doc("ATK", DOC_PART);
  } elseif(is_int(stripos($classtmp, "Gdk"))) {
  $OPTION["output"] = $OPTION["output"]."{$dirsep}gdk";
- $INFO['subextension'] = "$extname.gdk";
+ $INFO['subextension'][$extname][] = $classtmp;
+ create_dir($OPTION["output"]);
+
+ write_doc("GDK", DOC_PART);
  } elseif(is_int(stripos($classtmp, "Pango"))) {
  $OPTION["output"] = $OPTION["output"]."{$dirsep}pango";
- $INFO['subextension'] = "$extname.pango";
+ $INFO['subextension'][$extname][] = $classtmp;
+ create_dir($OPTION["output"]);
+
+ write_doc("Pango", DOC_PART);
  }
-
- create_dir($OPTION["output"]);
  }
  gen_docs($class->name, DOC_CLASS);

@@ -1355,7 +1379,9 @@

 if (!empty($OPTION['gtk'])) {
  define('DOC_SIGNAL', 1<<5);
+ define('DOC_PART', 1<<6);
  $DOC_EXT['book.xml'] = 'gtk/book.tpl';
+ $TEMPLATE[DOC_PART] = 'gtk/part.tpl';
  $TEMPLATE[DOC_CLASS] = 'gtk/class.tpl';
  $TEMPLATE[DOC_SIGNAL] = 'gtk/signal.tpl';
 }

Modified: phpdoc/doc-base/branches/gtk-docgen/scripts/docgen/gtk/book.tpl
===================================================================
--- phpdoc/doc-base/branches/gtk-docgen/scripts/docgen/gtk/book.tpl 2011-02-26 21:17:36 UTC (rev 308715)
+++ phpdoc/doc-base/branches/gtk-docgen/scripts/docgen/gtk/book.tpl 2011-02-26 23:07:27 UTC (rev 308716)
@@ -12,13 +12,8 @@
   </para>
  </preface>

- &reference.php-gtk.setup;
- &reference.php-gtk.constants;
-
- &reference.php-gtk.gtkplus.entities.atk;
- &reference.php-gtk.gtkplus.entities.gdk;
- &reference.php-gtk.gtkplus.entities.gtk;
- &reference.php-gtk.gtkplus.entities.pango;
+ &reference.{EXT_NAME_ID}.setup;
+ &reference.{EXT_NAME_ID}.constants;
 </book>

 <!-- Keep this comment at the end of the file

Added: phpdoc/doc-base/branches/gtk-docgen/scripts/docgen/gtk/part.tpl
===================================================================
--- phpdoc/doc-base/branches/gtk-docgen/scripts/docgen/gtk/part.tpl                        (rev 0)
+++ phpdoc/doc-base/branches/gtk-docgen/scripts/docgen/gtk/part.tpl 2011-02-26 23:07:27 UTC (rev 308716)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+{EMPTY_REVISION_KEYWORD}
+
+<part xml:id="part.{PART_NAME_ID}" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <title>{PART_NAME}</title>
+ <titleabbrev>{PART_NAME}</title>
+
+ <preface xml:id="intro.{PART_NAME_ID}">
+  &reftitle.intro;
+  <para>
+
+  </para>
+ </preface>
+
+
+</part>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:1
+sgml-indent-data:t
+indent-tabs-mode:nil
+sgml-parent-document:nil
+sgml-default-dtd-file:"~/.phpdoc/manual.ced"
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+vim600: syn=xml fen fdm=syntax fdl=2 si
+vim: et tw=78 syn=sgml
+vi: ts=1 sw=1
+-->


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