Skip to content

Commit

Permalink
Support enumsynopsis in the most minimal way
Browse files Browse the repository at this point in the history
  • Loading branch information
Girgias committed Nov 17, 2024
1 parent 1528413 commit 0eccbaf
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions phpdotnet/phd/Package/Generic/XHTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,16 @@ abstract class Package_Generic_XHTML extends Format_Abstract_XHTML {
'classsynopsisinfo' => 'format_classsynopsisinfo_oointerface_interfacename',
),
),
/** Enum synopsis related */
'enumsynopsis' => 'format_enumsynopsis',
'enumname' => [
/* DEFAULT */ 'span',
'enumsynopsis' => 'format_enumsynopsis_enumname'
],
'enumitem' => 'format_enumitem',
'enumidentifier' => 'format_enumidentifier',
'enumvalue' => 'format_enumvalue',
'enumitemdescription' => 'format_enumitemdescription',
'option' => 'format_option',
'orderedlist' => 'format_orderedlist',
'para' => array(
Expand Down Expand Up @@ -1205,6 +1215,48 @@ public function format_classsynopsis_methodsynopsis_methodname_text($value, $tag
return $method;
}

public function format_enumsynopsis($open, $name, $attrs, $props) {
if ($open) {
//return '<div class="enumsynopsis">';
return '<div class="classsynopsis"><div class="classsynopsisinfo">';
} else {
return '}</div>';
}
}
public function format_enumsynopsis_enumname($open, $name, $attrs, $props): string {
if ($open) {
/** Actual enum name in bold */
return '<span class="modifier">enum</span> <strong class="classname">';
//return '<span class="modifier">enum</span> <strong class="enumname">';
}
//return "</strong><br/>{<br/>";
return "</strong><br/>{</div>";
}
public function format_enumitem($open, $name, $attrs, $props) {
if ($open) {
return '<div class="fieldsynopsis">';
}
return '</div>';
}
public function format_enumidentifier($open, $name, $attrs, $props) {
if ($open) {
return ' <span class="modifier">case</span> <span class="classname">';
}
return '</span>';
}
public function format_enumvalue($open, $name, $attrs, $props) {
if ($open) {
return ' = ';
}
return '';
}
public function format_enumitemdescription($open, $name, $attrs, $props) {
if ($open) {
return ';<br/>/** ';
}
return ' */';
}

public function format_emphasis($open, $name, $attrs)
{
$name = "em";
Expand Down

0 comments on commit 0eccbaf

Please sign in to comment.