cvs: phd /formats xhtml.php
| From: | Hannes Magnusson | Date: | Sat, 06 Oct 2007 14:59:14 +0000 |
| Subject: | cvs: phd /formats xhtml.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-152@lists.php.net to get a copy of this message | ||
bjori Sat Oct 6 14:59:14 2007 UTC
Modified files:
/phd/formats xhtml.php
Log:
Fix info titles in tables
Improved support for fieldsynopsis modifiers
http://cvs.php.net/viewvc.cgi/phd/formats/xhtml.php?r1=1.37&r2=1.38&diff_format=u
Index: phd/formats/xhtml.php
diff -u phd/formats/xhtml.php:1.37 phd/formats/xhtml.php:1.38
--- phd/formats/xhtml.php:1.37 Sat Oct 6 10:35:20 2007
+++ phd/formats/xhtml.php Sat Oct 6 14:59:14 2007
@@ -1,5 +1,5 @@
<?php
-/* $Id: xhtml.php,v 1.37 2007/10/06 10:35:20 bjori Exp $ */
+/* $Id: xhtml.php,v 1.38 2007/10/06 14:59:14 bjori Exp $ */
class XHTMLPhDFormat extends PhDFormat {
protected $elementmap = array( /* {{{ */
@@ -200,6 +200,8 @@
/* DEFAULT */ 'h1',
'example' => 'format_bold_paragraph',
'note' => 'format_note_title',
+ 'table' => 'format_table_title',
+ 'informaltable' => 'format_table_title',
),
'indexdiv' => 'dt',
'legalnotice' => 'h4',
@@ -222,7 +224,7 @@
'varlistentry' => 'format_varlistentry',
'varname' => array(
/* DEFAULT */ 'var',
- 'fieldsynopsis' => 'format_varname',
+ 'fieldsynopsis' => 'format_fieldsynopsis_varname',
),
'void' => 'format_void',
'warning' => 'format_admonition',
@@ -239,6 +241,10 @@
'shortaffil' => 'format_suppressed_text',
'programlisting' => 'format_programlisting_text',
'alt' => 'format_alt_text',
+ 'modifier' => array(
+ /* DEFAULT */ false,
+ 'fieldsynopsis' => 'format_fieldsynopsis_modifier_text',
+ ),
);
@@ -375,11 +381,16 @@
return "</div>";
}
public function format_fieldsynopsis($open, $name, $attrs) {
+ $this->tmp["fieldsynopsis"] = array();
if ($open) {
return '<div class="'.$name.'">';
}
return ";</div>\n";
}
+ public function format_fieldsynopsis_modifier_text($value, $tag) {
+ $this->tmp["fieldsynopsis"]["modifier"] = trim($value);
+ return $value;
+ }
public function format_methodsynopsis($open, $name, $attrs) {
if ($open) {
$this->params = array("count" => 0, "opt" => 0,
"content" => "");
@@ -454,10 +465,19 @@
public function format_varname($open, $name, $attrs) {
if ($open) {
- return '<var>$';
+ return '<var class="'.$name.'">$';
}
return "</var>\n";
}
+ public function format_fieldsynopsis_varname($open, $name, $attrs) {
+ if ($open) {
+ if (isset($this->tmp["fieldsynopsis"]["modifier"]) &&
$this->tmp["fieldsynopsis"]["modifier"] == "const") {
+ return '<var class="fieldsynopsis_varname">';
+ }
+ return '<var class="'.$name.'">$';
+ }
+ return '</var>';
+ }
public function format_co($open, $name, $attrs, $props) {
if (($open || $props["empty"]) &&
isset($attrs[PhDReader::XMLNS_XML]["id"])) {