From 9c76a0f6a00b3f74a2e24cf19d89928f6f233080 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 20 Nov 2024 16:42:46 +0000 Subject: [PATCH] Support enumsynopsis in the most minimal way (#179) --- phpdotnet/phd/Package/Generic/XHTML.php | 52 +++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/phpdotnet/phd/Package/Generic/XHTML.php b/phpdotnet/phd/Package/Generic/XHTML.php index 2268fecb..9040e21b 100644 --- a/phpdotnet/phd/Package/Generic/XHTML.php +++ b/phpdotnet/phd/Package/Generic/XHTML.php @@ -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( @@ -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 '
'; + return '
'; + } else { + return '}
'; + } + } + public function format_enumsynopsis_enumname($open, $name, $attrs, $props): string { + if ($open) { + /** Actual enum name in bold */ + return 'enum '; + //return 'enum '; + } + //return "
{
"; + return "

{
"; + } + public function format_enumitem($open, $name, $attrs, $props) { + if ($open) { + return '
'; + } + return '
'; + } + public function format_enumidentifier($open, $name, $attrs, $props) { + if ($open) { + return ' case '; + } + return ''; + } + public function format_enumvalue($open, $name, $attrs, $props) { + if ($open) { + return ' = '; + } + return ''; + } + public function format_enumitemdescription($open, $name, $attrs, $props) { + if ($open) { + return ';
/** '; + } + return ' */'; + } + public function format_emphasis($open, $name, $attrs) { $name = "em";