cvs: phd / TODO.RENDERER build.php config.php package.xml /include PhDPartialReader.class.php /themes/php chunkedhtml.php phpweb.php
| From: | Hannes Magnusson | Date: | Sun, 21 Oct 2007 11:42:33 +0000 |
| Subject: | cvs: phd / TODO.RENDERER build.php config.php package.xml /include PhDPartialReader.class.php /themes/php chunkedhtml.php phpweb.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-249@lists.php.net to get a copy of this message | ||
bjori Sun Oct 21 11:42:33 2007 UTC
Added files:
/phd/include PhDPartialReader.class.php
Modified files:
/phd TODO.RENDERER build.php config.php package.xml
/phd/themes/php chunkedhtml.php phpweb.php
Log:
Added the possibility to render only specific IDs
http://cvs.php.net/viewvc.cgi/phd/TODO.RENDERER?r1=1.2&r2=1.3&diff_format=u Index: phd/TODO.RENDERER diff -u phd/TODO.RENDERER:1.2 phd/TODO.RENDERER:1.3 --- phd/TODO.RENDERER:1.2 Sat Oct 20 10:16:37 2007 +++ phd/TODO.RENDERER Sun Oct 21 11:42:32 2007 @@ -7,7 +7,6 @@ - Implement generic theme - Implement CHM format which should generate the CHM indexing files - Implement "mktoc.php" caching using SQLite - - Look for ways to generate single pages (i.e `php build.php <ID>`) - Write more tests - Implement method to generate markup for the default attributes - Implement the remaining elements and attributes of the Docbook format http://cvs.php.net/viewvc.cgi/phd/build.php?r1=1.32&r2=1.33&diff_format=u Index: phd/build.php diff -u phd/build.php:1.32 phd/build.php:1.33 --- phd/build.php:1.32 Thu Oct 4 13:16:07 2007 +++ phd/build.php Sun Oct 21 11:42:32 2007 @@ -1,6 +1,6 @@ #!@php_bin@ <?php -/* $Id: build.php,v 1.32 2007/10/04 13:16:07 bjori Exp $ */ +/* $Id: build.php,v 1.33 2007/10/21 11:42:32 bjori Exp $ */ function err($no, $str, $file, $line) { global $notify; @@ -41,6 +41,7 @@ $OPTIONS["xml_file"] = $OPTIONS["xml_root"] . "/.manual.xml"; require $ROOT. "/include/PhDReader.class.php"; +require $ROOT. "/include/PhDPartialReader.class.php"; require $ROOT. "/include/PhDHelper.class.php"; require $ROOT. "/include/PhDFormat.class.php"; @@ -112,7 +113,12 @@ } } - $reader = new PhDReader($OPTIONS); + if (!empty($OPTIONS["render_ids"])) { + $reader = new PhDPartialReader($OPTIONS); + } else { + $reader = new PhDReader($OPTIONS); + } + while($reader->read()) { $nodetype = $reader->nodeType; http://cvs.php.net/viewvc.cgi/phd/config.php?r1=1.2&r2=1.3&diff_format=u Index: phd/config.php diff -u phd/config.php:1.2 phd/config.php:1.3 --- phd/config.php:1.2 Tue Oct 2 10:10:09 2007 +++ phd/config.php Sun Oct 21 11:42:32 2007 @@ -1,5 +1,5 @@ <?php -/* Generated by PhD $Id: config.php,v 1.2 2007/10/02 10:10:09 bjori Exp $ at Thu, 09 Aug 2007 15:10:10 +0200. */ +/* Generated by PhD $Id: config.php,v 1.3 2007/10/21 11:42:32 bjori Exp $ at Thu, 09 Aug 2007 15:10:10 +0200. */ $OPTIONS = array ( 'output_format' => array('xhtml'), @@ -13,13 +13,22 @@ ), ), 'index' => true, - 'xml_root' => '/home/bjori/php/doc', + 'xml_root' => '.', 'language' => 'en', 'fallback_language' => 'en', 'enforce_revisions' => false, 'compatibility_mode' => true, 'build_log_file' => 'none', 'debug' => true, + 'render_ids' => array( + /* + "manual" => false, + "ref.strings" => false, + "function.strpos" => true, + "function.sprintf" => true, + "ref.filesystem" => true, + */ + ), ); if ($argc == 2) { http://cvs.php.net/viewvc.cgi/phd/package.xml?r1=1.6&r2=1.7&diff_format=u Index: phd/package.xml diff -u phd/package.xml:1.6 phd/package.xml:1.7 --- phd/package.xml:1.6 Sat Oct 20 10:19:25 2007 +++ phd/package.xml Sun Oct 21 11:42:32 2007 @@ -15,8 +15,8 @@ </lead> <date>2007-10-20</date> <version> - <release>0.1.0</release> - <api>0.1.0</api> + <release>0.2.0</release> + <api>0.2.0</api> </version> <stability> <release>beta</release> @@ -24,30 +24,7 @@ </stability> <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD Style</license> <notes> - - Add example numbering - - Improved support for modifiers in fieldsynopsis - - Remove () from refname when looking for version info (reported by Paul Reinheimer) - - Print notes inline with its title (reported by Philip Olson) - - Check if we have an open "{" before we print "}" - - Escape the version info (patch by Richard Q.) - - Fixed variablelist titles - - Fixed table info titles - - Fixed empty table cells (reported by Mark Wiesemann) - - Fixed table title markup (reported by Richard Q.) - - Fixed non-closing b element for empty <title />s (reported by Joshua Thompson and Philip Olson) - - Fixed bug#43013 (Description rather then function name for right arrows on extension pages) (patch by Richard Q.) - - Fixed bug#42906 (docs.php.net bold instead of links) - - Fixed bug#42860 (cannot render <orgname> element) - - Fixed bug#42845 (Copyright page has no TOC) - - Language support (for autogenerated texts): - * Bulgarian (by Kouber Saparev) - * Czech (by Jakub Vrana) - * German (by Oliver Albers) - * Italian (by Marco Cucinato) - * Japanese (by TAKAGI Masahiro) - * Polish (by Jaroslaw Glowacki) - * Brazilian Portuguese (by Diego Feitosa) - * Romanian (by Simion Onea) + - Added partial rendering </notes> <contents> <dir baseinstalldir="phd" name="/"> @@ -55,6 +32,7 @@ <file baseinstalldir="phd" name="include/PhDFormat.class.php" role="php"/> <file baseinstalldir="phd" name="include/PhDHelper.class.php" role="php"/> <file baseinstalldir="phd" name="include/PhDReader.class.php" role="php"/> + <file baseinstalldir="phd" name="include/PhDPartialReader.class.php" role="php"/> <file baseinstalldir="phd" name="include/langs/bg.xml" role="php"/> <file baseinstalldir="phd" name="include/langs/cs.xml" role="php"/> <file baseinstalldir="phd" name="include/langs/de.xml" role="php"/> @@ -136,6 +114,45 @@ <notes>Initial release</notes> </release> </changelog> + <changelog> + <release> + <version> + <release>0.1.0</release> + <api>0.1.0</api> + </version> + <stability> + <release>beta</release> + <api>devel</api> + </stability> + <date>2007-10-20</date> + <notes> + - Add example numbering + - Improved support for modifiers in fieldsynopsis + - Remove () from refname when looking for version info (reported by Paul Reinheimer) + - Print notes inline with its title (reported by Philip Olson) + - Check if we have an open "{" before we print "}" + - Escape the version info (patch by Richard Q.) + - Fixed variablelist titles + - Fixed table info titles + - Fixed empty table cells (reported by Mark Wiesemann) + - Fixed table title markup (reported by Richard Q.) + - Fixed non-closing b element for empty <title />s (reported by Joshua Thompson and Philip Olson) + - Fixed bug#43013 (Description rather then function name for right arrows on extension pages) (patch by Richard Q.) + - Fixed bug#42906 (docs.php.net bold instead of links) + - Fixed bug#42860 (cannot render <orgname> element) + - Fixed bug#42845 (Copyright page has no TOC) + - Language support (for autogenerated texts): + * Bulgarian (by Kouber Saparev) + * Czech (by Jakub Vrana) + * German (by Oliver Albers) + * Italian (by Marco Cucinato) + * Japanese (by TAKAGI Masahiro) + * Polish (by Jaroslaw Glowacki) + * Brazilian Portuguese (by Diego Feitosa) + * Romanian (by Simion Onea) + </notes> + </release> + </changelog> </package> <!-- vim: et sw=2 ts=2 http://cvs.php.net/viewvc.cgi/phd/themes/php/chunkedhtml.php?r1=1.5&r2=1.6&diff_format=u Index: phd/themes/php/chunkedhtml.php diff -u phd/themes/php/chunkedhtml.php:1.5 phd/themes/php/chunkedhtml.php:1.6 --- phd/themes/php/chunkedhtml.php:1.5 Fri Aug 17 09:18:50 2007 +++ phd/themes/php/chunkedhtml.php Sun Oct 21 11:42:33 2007 @@ -44,7 +44,9 @@ return "<hr />$nav</body></html>\n"; } public function __destruct() { - copy("html/manual.html", "html/index.html"); + if (file_exists("html/manual.html")) { + copy("html/manual.html", "html/index.html"); + } } } http://cvs.php.net/viewvc.cgi/phd/themes/php/phpweb.php?r1=1.14&r2=1.15&diff_format=u Index: phd/themes/php/phpweb.php diff -u phd/themes/php/phpweb.php:1.14 phd/themes/php/phpweb.php:1.15 --- phd/themes/php/phpweb.php:1.14 Thu Oct 18 10:58:42 2007 +++ phd/themes/php/phpweb.php Sun Oct 21 11:42:33 2007 @@ -1,5 +1,5 @@ <?php -/* $Id: phpweb.php,v 1.14 2007/10/18 10:58:42 bjori Exp $ */ +/* $Id: phpweb.php,v 1.15 2007/10/21 11:42:33 bjori Exp $ */ class phpweb extends phpdotnet implements PhDTheme { protected $streams = array(); @@ -185,7 +185,9 @@ return $next; } public function __destruct() { - copy("php/manual.php", "php/index.php"); + if (file_exists("php/manual.php")) { + copy("php/manual.php", "php/index.php"); + } } public function format_qandaset($open, $name, $attrs) { if ($open) { http://cvs.php.net/viewvc.cgi/phd/include/PhDPartialReader.class.php?view=markup&rev=1.1 Index: phd/include/PhDPartialReader.class.php +++ phd/include/PhDPartialReader.class.php <?php /* $Id: PhDPartialReader.class.php,v 1.1 2007/10/21 11:42:33 bjori Exp $ */ class PhDPartialReader extends PhDReader { protected $partial = array(); public function __construct($opts, $encoding = "UTF-8", $xml_opts = NULL) { parent::__construct($opts, $encoding, $xml_opts); if (isset($opts["render_ids"])) { if (is_array($opts["render_ids"])) { $this->partial = $opts["render_ids"]; } else { $this->partial[$opts["render_ids"]] = 1; } } else { throw new Exception("Didn't get any IDs to seek"); } } public function read() { static $seeked = 0; static $currently_reading = false; $ignore = false; while($ret = parent::read()) { if ($this->isChunk) { $id = $this->getAttributeNs("id", PhDReader::XMLNS_XML); if (isset($this->partial[$id])) { if ($this->isChunk == PhDReader::CLOSE_CHUNK) { unset($this->partial[$id]); --$seeked; $currently_reading = false; } else { $currently_reading = $id; ++$seeked; } return $ret; } elseif ($currently_reading && $this->partial[$currently_reading]) { return $ret; } else { $ignore = true; } } elseif (!$ignore && $seeked > 0) { return $ret; } } return $ret; } } /* * vim600: sw=4 ts=4 fdm=syntax syntax=php et * vim<600: sw=4 ts=4 */
http://cvs.php.net/viewvc.cgi/phd/TODO.RENDERER?r1=1.2&r2=1.3&diff_format=u Index: phd/TODO.RENDERER diff -u phd/TODO.RENDERER:1.2 phd/TODO.RENDERER:1.3 --- phd/TODO.RENDERER:1.2 Sat Oct 20 10:16:37 2007 +++ phd/TODO.RENDERER Sun Oct 21 11:42:32 2007 @@ -7,7 +7,6 @@ - Implement generic theme - Implement CHM format which should generate the CHM indexing files - Implement "mktoc.php" caching using SQLite - - Look for ways to generate single pages (i.e `php build.php <ID>`) - Write more tests - Implement method to generate markup for the default attributes - Implement the remaining elements and attributes of the Docbook format http://cvs.php.net/viewvc.cgi/phd/build.php?r1=1.32&r2=1.33&diff_format=u Index: phd/build.php diff -u phd/build.php:1.32 phd/build.php:1.33 --- phd/build.php:1.32 Thu Oct 4 13:16:07 2007 +++ phd/build.php Sun Oct 21 11:42:32 2007 @@ -1,6 +1,6 @@ #!@php_bin@ <?php -/* $Id: build.php,v 1.32 2007/10/04 13:16:07 bjori Exp $ */ +/* $Id: build.php,v 1.33 2007/10/21 11:42:32 bjori Exp $ */ function err($no, $str, $file, $line) { global $notify; @@ -41,6 +41,7 @@ $OPTIONS["xml_file"] = $OPTIONS["xml_root"] . "/.manual.xml"; require $ROOT. "/include/PhDReader.class.php"; +require $ROOT. "/include/PhDPartialReader.class.php"; require $ROOT. "/include/PhDHelper.class.php"; require $ROOT. "/include/PhDFormat.class.php"; @@ -112,7 +113,12 @@ } } - $reader = new PhDReader($OPTIONS); + if (!empty($OPTIONS["render_ids"])) { + $reader = new PhDPartialReader($OPTIONS); + } else { + $reader = new PhDReader($OPTIONS); + } + while($reader->read()) { $nodetype = $reader->nodeType; http://cvs.php.net/viewvc.cgi/phd/config.php?r1=1.2&r2=1.3&diff_format=u Index: phd/config.php diff -u phd/config.php:1.2 phd/config.php:1.3 --- phd/config.php:1.2 Tue Oct 2 10:10:09 2007 +++ phd/config.php Sun Oct 21 11:42:32 2007 @@ -1,5 +1,5 @@ <?php -/* Generated by PhD $Id: config.php,v 1.2 2007/10/02 10:10:09 bjori Exp $ at Thu, 09 Aug 2007 15:10:10 +0200. */ +/* Generated by PhD $Id: config.php,v 1.3 2007/10/21 11:42:32 bjori Exp $ at Thu, 09 Aug 2007 15:10:10 +0200. */ $OPTIONS = array ( 'output_format' => array('xhtml'), @@ -13,13 +13,22 @@ ), ), 'index' => true, - 'xml_root' => '/home/bjori/php/doc', + 'xml_root' => '.', 'language' => 'en', 'fallback_language' => 'en', 'enforce_revisions' => false, 'compatibility_mode' => true, 'build_log_file' => 'none', 'debug' => true, + 'render_ids' => array( + /* + "manual" => false, + "ref.strings" => false, + "function.strpos" => true, + "function.sprintf" => true, + "ref.filesystem" => true, + */ + ), ); if ($argc == 2) { http://cvs.php.net/viewvc.cgi/phd/package.xml?r1=1.6&r2=1.7&diff_format=u Index: phd/package.xml diff -u phd/package.xml:1.6 phd/package.xml:1.7 --- phd/package.xml:1.6 Sat Oct 20 10:19:25 2007 +++ phd/package.xml Sun Oct 21 11:42:32 2007 @@ -15,8 +15,8 @@ </lead> <date>2007-10-20</date> <version> - <release>0.1.0</release> - <api>0.1.0</api> + <release>0.2.0</release> + <api>0.2.0</api> </version> <stability> <release>beta</release> @@ -24,30 +24,7 @@ </stability> <license uri="http://www.opensource.org/licenses/bsd-license.php">BSD Style</license> <notes> - - Add example numbering - - Improved support for modifiers in fieldsynopsis - - Remove () from refname when looking for version info (reported by Paul Reinheimer) - - Print notes inline with its title (reported by Philip Olson) - - Check if we have an open "{" before we print "}" - - Escape the version info (patch by Richard Q.) - - Fixed variablelist titles - - Fixed table info titles - - Fixed empty table cells (reported by Mark Wiesemann) - - Fixed table title markup (reported by Richard Q.) - - Fixed non-closing b element for empty <title />s (reported by Joshua Thompson and Philip Olson) - - Fixed bug#43013 (Description rather then function name for right arrows on extension pages) (patch by Richard Q.) - - Fixed bug#42906 (docs.php.net bold instead of links) - - Fixed bug#42860 (cannot render <orgname> element) - - Fixed bug#42845 (Copyright page has no TOC) - - Language support (for autogenerated texts): - * Bulgarian (by Kouber Saparev) - * Czech (by Jakub Vrana) - * German (by Oliver Albers) - * Italian (by Marco Cucinato) - * Japanese (by TAKAGI Masahiro) - * Polish (by Jaroslaw Glowacki) - * Brazilian Portuguese (by Diego Feitosa) - * Romanian (by Simion Onea) + - Added partial rendering </notes> <contents> <dir baseinstalldir="phd" name="/"> @@ -55,6 +32,7 @@ <file baseinstalldir="phd" name="include/PhDFormat.class.php" role="php"/> <file baseinstalldir="phd" name="include/PhDHelper.class.php" role="php"/> <file baseinstalldir="phd" name="include/PhDReader.class.php" role="php"/> + <file baseinstalldir="phd" name="include/PhDPartialReader.class.php" role="php"/> <file baseinstalldir="phd" name="include/langs/bg.xml" role="php"/> <file baseinstalldir="phd" name="include/langs/cs.xml" role="php"/> <file baseinstalldir="phd" name="include/langs/de.xml" role="php"/> @@ -136,6 +114,45 @@ <notes>Initial release</notes> </release> </changelog> + <changelog> + <release> + <version> + <release>0.1.0</release> + <api>0.1.0</api> + </version> + <stability> + <release>beta</release> + <api>devel</api> + </stability> + <date>2007-10-20</date> + <notes> + - Add example numbering + - Improved support for modifiers in fieldsynopsis + - Remove () from refname when looking for version info (reported by Paul Reinheimer) + - Print notes inline with its title (reported by Philip Olson) + - Check if we have an open "{" before we print "}" + - Escape the version info (patch by Richard Q.) + - Fixed variablelist titles + - Fixed table info titles + - Fixed empty table cells (reported by Mark Wiesemann) + - Fixed table title markup (reported by Richard Q.) + - Fixed non-closing b element for empty <title />s (reported by Joshua Thompson and Philip Olson) + - Fixed bug#43013 (Description rather then function name for right arrows on extension pages) (patch by Richard Q.) + - Fixed bug#42906 (docs.php.net bold instead of links) + - Fixed bug#42860 (cannot render <orgname> element) + - Fixed bug#42845 (Copyright page has no TOC) + - Language support (for autogenerated texts): + * Bulgarian (by Kouber Saparev) + * Czech (by Jakub Vrana) + * German (by Oliver Albers) + * Italian (by Marco Cucinato) + * Japanese (by TAKAGI Masahiro) + * Polish (by Jaroslaw Glowacki) + * Brazilian Portuguese (by Diego Feitosa) + * Romanian (by Simion Onea) + </notes> + </release> + </changelog> </package> <!-- vim: et sw=2 ts=2 http://cvs.php.net/viewvc.cgi/phd/themes/php/chunkedhtml.php?r1=1.5&r2=1.6&diff_format=u Index: phd/themes/php/chunkedhtml.php diff -u phd/themes/php/chunkedhtml.php:1.5 phd/themes/php/chunkedhtml.php:1.6 --- phd/themes/php/chunkedhtml.php:1.5 Fri Aug 17 09:18:50 2007 +++ phd/themes/php/chunkedhtml.php Sun Oct 21 11:42:33 2007 @@ -44,7 +44,9 @@ return "<hr />$nav</body></html>\n"; } public function __destruct() { - copy("html/manual.html", "html/index.html"); + if (file_exists("html/manual.html")) { + copy("html/manual.html", "html/index.html"); + } } } http://cvs.php.net/viewvc.cgi/phd/themes/php/phpweb.php?r1=1.14&r2=1.15&diff_format=u Index: phd/themes/php/phpweb.php diff -u phd/themes/php/phpweb.php:1.14 phd/themes/php/phpweb.php:1.15 --- phd/themes/php/phpweb.php:1.14 Thu Oct 18 10:58:42 2007 +++ phd/themes/php/phpweb.php Sun Oct 21 11:42:33 2007 @@ -1,5 +1,5 @@ <?php -/* $Id: phpweb.php,v 1.14 2007/10/18 10:58:42 bjori Exp $ */ +/* $Id: phpweb.php,v 1.15 2007/10/21 11:42:33 bjori Exp $ */ class phpweb extends phpdotnet implements PhDTheme { protected $streams = array(); @@ -185,7 +185,9 @@ return $next; } public function __destruct() { - copy("php/manual.php", "php/index.php"); + if (file_exists("php/manual.php")) { + copy("php/manual.php", "php/index.php"); + } } public function format_qandaset($open, $name, $attrs) { if ($open) { http://cvs.php.net/viewvc.cgi/phd/include/PhDPartialReader.class.php?view=markup&rev=1.1 Index: phd/include/PhDPartialReader.class.php +++ phd/include/PhDPartialReader.class.php <?php /* $Id: PhDPartialReader.class.php,v 1.1 2007/10/21 11:42:33 bjori Exp $ */ class PhDPartialReader extends PhDReader { protected $partial = array(); public function __construct($opts, $encoding = "UTF-8", $xml_opts = NULL) { parent::__construct($opts, $encoding, $xml_opts); if (isset($opts["render_ids"])) { if (is_array($opts["render_ids"])) { $this->partial = $opts["render_ids"]; } else { $this->partial[$opts["render_ids"]] = 1; } } else { throw new Exception("Didn't get any IDs to seek"); } } public function read() { static $seeked = 0; static $currently_reading = false; $ignore = false; while($ret = parent::read()) { if ($this->isChunk) { $id = $this->getAttributeNs("id", PhDReader::XMLNS_XML); if (isset($this->partial[$id])) { if ($this->isChunk == PhDReader::CLOSE_CHUNK) { unset($this->partial[$id]); --$seeked; $currently_reading = false; } else { $currently_reading = $id; ++$seeked; } return $ret; } elseif ($currently_reading && $this->partial[$currently_reading]) { return $ret; } else { $ignore = true; } } elseif (!$ignore && $seeked > 0) { return $ret; } } return $ret; } } /* * vim600: sw=4 ts=4 fdm=syntax syntax=php et * vim<600: sw=4 ts=4 */