From b59ab2490b1bb82dc1d0b58d89584182b405d0a0 Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 19 Jun 2006 02:31:27 +0000 Subject: build script update. Fixed #82 and #165. --- .../PhpDocumentor/phpDocumentor/DescHTML.inc | 241 +++++++++++++++++++++ 1 file changed, 241 insertions(+) create mode 100644 buildscripts/PhpDocumentor/phpDocumentor/DescHTML.inc (limited to 'buildscripts/PhpDocumentor/phpDocumentor/DescHTML.inc') diff --git a/buildscripts/PhpDocumentor/phpDocumentor/DescHTML.inc b/buildscripts/PhpDocumentor/phpDocumentor/DescHTML.inc new file mode 100644 index 00000000..f4fa31d3 --- /dev/null +++ b/buildscripts/PhpDocumentor/phpDocumentor/DescHTML.inc @@ -0,0 +1,241 @@ +> in a description + * @package phpDocumentor + * @subpackage DescHTML + */ +class parserCode extends parserStringWithInlineTags +{ + /** + * @param Converter + * @uses Converter::ProgramExample() + */ + function Convert(&$c) + { + if (!isset($this->value[0])) return ''; + if (is_string($this->value[0]) && $this->value[0]{0} == "\n") + { + $this->value[0] = substr($this->value[0],1); + } + $linktags = array(); + foreach($this->value as $val) { + if (phpDocumentor_get_class($val) == 'parserlinkinlinetag' || + phpDocumentor_get_class($val) == 'parsertutorialinlinetag') { + $linktags[] = array($c->postProcess($val->Convert($c, false, false)), $val); + } + } + $a = $c->ProgramExample(rtrim(ltrim(parent::Convert($c, false, false), "\n\r"))); + foreach ($linktags as $tag) { + $a = str_replace($tag[0], $tag[1]->Convert($c, false, false), $a); + } + return $a; +// else return $c->PreserveWhiteSpace($this->getString(false)); + } +} + +/** + * Used for <
> in a description + * @package phpDocumentor + * @subpackage DescHTML + */ +class parserPre extends parserStringWithInlineTags +{ + /** + * @param Converter + * @uses Converter::PreserveWhiteSpace() + */ + function Convert(&$c) + { + return $c->PreserveWhiteSpace(rtrim(ltrim(parent::Convert($c, false, false), "\n\r"))); + } +} + +/** + * Used for <> in a description + * @package phpDocumentor + * @subpackage DescHTML + */ +class parserB extends parserStringWithInlineTags +{ + /** + * @param Converter + * @uses Converter::Bolden() + */ + function Convert(&$c) + { + return $c->Bolden(parent::Convert($c)); + } +} + +/** + * Used for <> in a description + * @package phpDocumentor + * @subpackage DescHTML + */ +class parserI extends parserStringWithInlineTags +{ + /** + * @param Converter + * @uses Converter::Italicize() + */ + function Convert(&$c) + { + return $c->Italicize(parent::Convert($c)); + } +} + +/** + * Used for <> in a description + * @package phpDocumentor + * @subpackage DescHTML + */ +class parserDescVar extends parserStringWithInlineTags +{ + /** + * @param Converter + * @uses Converter::Varize() + */ + function Convert(&$c) + { + return $c->Varize(parent::Convert($c)); + } +} + +/** + * Used for <> in a description + * @package phpDocumentor + * @subpackage DescHTML + */ +class parserSamp extends parserStringWithInlineTags +{ + /** + * @param Converter + * @uses Converter::Sampize() + */ + function Convert(&$c) + { + return $c->Sampize(parent::Convert($c)); + } +} + +/** + * Used for <> in a description + * @package phpDocumentor + * @subpackage DescHTML + */ +class parserKbd extends parserStringWithInlineTags +{ + /** + * @param Converter + * @uses Converter::Kbdize() + */ + function Convert(&$c) + { + return $c->Kbdize(parent::Convert($c)); + } +} + +/** + * Used for <
> in a description + * @package phpDocumentor + * @subpackage DescHTML + */ +class parserBr extends parserStringWithInlineTags +{ + /** + * @param Converter + * @uses Converter::Br() + */ + function Convert(&$c) + { + return $c->Br($this->getString()); + } +} + +/** + * Used for lists <> and <
> + * @package phpDocumentor + * @subpackage DescHTML + */ +class parserList extends parserStringWithInlineTags +{ + /** @var boolean */ + var $numbered; + /** @var integer */ + var $items = 0; + /** + * @param integer + */ + function parserList($numbered) + { + $this->numbered = $numbered; + } + + /** @param parserStringWithInlineTags */ + function addItem($item) + { + $this->value[$this->items++] = $item; + } + + /** @param parserList */ + function addList($list) + { + $this->value[$this->items++] = $list; + } + + /** + * @uses Converter::ListItem() enclose each item of the list + * @uses Converter::EncloseList() enclose the list + * @param Converter + */ + function Convert(&$c) + { + $list = ''; + foreach($this->value as $item) + { + $list .= $c->ListItem(trim($item->Convert($c))); + } + return $c->EncloseList($list,$this->numbered); + } +} + +?> -- cgit v1.2.3