Uncommited changes synced
authorAlan Knowles <alan@roojs.com>
Tue, 27 Nov 2018 04:17:07 +0000 (12:17 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 27 Nov 2018 04:17:07 +0000 (12:17 +0800)
CodeDoc/Data/Docbook.php
CodeDoc/Data/Method.php
CodeDoc/Data/PhpDoc.php
CodeDoc/Parser/Comment.php

index 84076f3..324f68c 100644 (file)
@@ -105,7 +105,7 @@ class PHP_CodeDoc_Data_Docbook  {
                     $buffer ="";
                     $this->addSection($section);
                     break;
-                case "@docbook_page_summary":
+                case "@docbook_page_summary":\r
                     $summary = preg_replace("/\s*\@docbook_page_summary\s*/i","",$line);
                     $this->addPara($buffer);
                     $buffer ="";
index 6419241..dc106c5 100644 (file)
@@ -153,6 +153,17 @@ class PHP_CodeDoc_Data_Method extends PHP_CodeDoc_Data {
         }
         
         
+        if ($this->name == '__construct') {
+            // list out 'Constants'
+            
+            // list out 'public variables..'
+            
+            
+            
+        }
+        
+        
+        
                         /* -- fixme - needs to read from an example file..
                         array(
                             'stype' => 'example',
index 33d6371..48b9da6 100644 (file)
@@ -25,6 +25,9 @@
 *   @author   Alan Knowles <alan@akbkhome.com>
 *
 */
+
+require_once 'Param.php';
+
 class PHP_CodeDoc_Data_PhpDoc {
     var $long = "";             // name of parameter
     var $short = "";            // default value
@@ -50,9 +53,8 @@ class PHP_CodeDoc_Data_PhpDoc {
     
     function __construct()
     {
-        $this->return = new stdClass();
-        $this->return->type = '';
-        $this->return->desc= '';
+        $this->return = new PHP_CodeDoc_Data_Param();
+       
     }
     
     function longToHTML()
@@ -60,6 +62,19 @@ class PHP_CodeDoc_Data_PhpDoc {
         $ret = '<p>'. $this->long .'</p>';
         $ret = preg_replace('/\n\s+\n/','</p><p>',$ret);
         
+        $bits = explode('```', $ret);
+        
+        if (count($bits) > 1) {
+            $otag = $tag ='<br/><code style="white-space: pre">';
+            $ret = '';
+            foreach($bits as $b) {
+                //if ($tag == '</code><br/>') {
+            //    $b = preg_replace('/\n/', "<br/>\n", $b);
+             //   }
+                $ret .= $b . $tag;
+                $tag = $tag == $otag ? '</code><br/>' : $otag;
+            }
+        }
         // code....
         
         return $ret;
index a52e495..34e394a 100644 (file)
@@ -160,7 +160,7 @@ class PHP_CodeDoc_Parser_Comment {
                         $flags['rawdata'] = TRUE;
                         break;
                     default:
-                        $desc->$key = $linedata[2];
+                        $desc->$key = $linedata[2];\r
                 }
                 continue;
             }