To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > Tools > Misc Tools

Misc Tools Discussion regarding tools that don't have their own forum.

Reply
 
Thread Tools Rate Thread Display Modes
Old 03-02-2003, 03:36 PM   #1
KungdenKnege
Junior Member
 
Join Date: Mar 2003
Location: Malmö, Sweden
Posts: 10
Generate documentation...

...automatically. I need a script to do that for me. Someting like Javas JavaDoc.

I've tried PHPDoc and PHPDocumentor. PHPDoc was too buggy and ugly, probably because it's just a beta. PHPDocumentor seemd good, but I can't get it work the way I want?

It ignores my @see, @acces and and my descriptions. It just write them as a "-" in the HTML. Weird.

Anyway, do you guys know of any other solution? (Or maybe you know what I'm doing wrong with PHPDocumentor

Thx
/Kung den Knege
KungdenKnege is offline   Reply With Quote
Old 03-13-2003, 09:49 PM   #2
yewboon
Junior Member
 
Join Date: Mar 2003
Location: PG, Malaysia
Posts: 2
Lightbulb

I had the same problem as you last time, my solution is to create a simple script, as shown below, to generate the doc i want it to be. This idea is from JavaDoc.

Firstly, I created a script to format the doc layout i want it to be:
---------------------- mySysDoc.php -------------------------------
<?
function ShowFileInfo($FileName)
{
$timestamp = filemtime($FileName);
$LastMod = date("Y-m-d [H:i:s]", $timestamp);

print "<h2 style='font-family:arial;'>System Documentation</h2>";
print "<table border=0 cellspacing=0 cellpadding=0 width=600 style='font-size:12px; font-family:arial; background-color:#e9e9e9;'>";
print "<tr><td width=65><b>File Name</b>: </td>" .
" <td>$FileName</td>" .
" <td width=85><b>Last Modified</b>: </td>" .
" <td width=130>$LastMod</td></tr>" .
"</table><br>";
}


function ShowDoc($FileName)
{
ShowFileInfo($FileName);
$FilePointer = @file($FileName);
$Document = "<table border=0 cellspacing=0 cellpadding=0 width=600 style='font-size:12px; font-family:arial;'>";
for($a=0; $a<count($FilePointer); $a++)
{
if(trim($FilePointer[$a])=='/*@#')
{
$b = $a + 1;
while(trim($FilePointer[$b])!='#@*/')
{
$Line = trim($FilePointer[$b]);
if($Line=='@@@')
{ $Document .= "<tr valign='top'><td colspan=3><hr></td></tr>"; }
else if(substr($Line, 0, 1)=='@')
{
$Document .= "<tr valign='top'><td>" .
"<b><nobr>" . substr($Line, 1, strlen($Line)) . "</nobr></b>" .
"</td><td width=10>:</td><td>";
}
else if(substr($Line, 0, 1)!='@' && $Line!='')
{ $Document .= $Line; }
else if($Line=='')
{
$Document .= "</td></tr>" .
"<tr valign='top'><td colspan=3><br></td></tr>";
}
$b++;
}
$Document .= "<tr valign='top'><td colspan=3><br></td></tr>";
}
}
$Document .= "</table>";
print $Document;
}
?>
--------------------------------------------------------------------------

Next, I used this to comment my php code:
---------------------- search.php -------------------------------
<?
/*@#
@System
Online Shop Floor Control (OSFC)
@Module
Search / View
@Include
mynocache.inc, mylib.inc, myfunctions.inc
@Function
diff_date
@Developed by
Yew Boon

@Description
Display information about a particular S/Q No. in detail form and also process status.
#@*/


function diff_date($date1, $date2)
{
/*@#
@@@
@Function
diff_date($date1, $date2)
@Description
Compare two dates and return the different between them.
#@*/

... here your code ...
}
...
?>
___________________________________________

Finally, i added this to my system library list:
---------------------- SysLibrary.php ---------------------------
<?
include "mySysDoc.php3";
ShowDoc("search.phtml");
?>
---------------------------------------------------------------------

At the end, when i viewing my system library list i can get a well-formatted doc for the search.php script.

For your information; you can custom the mySysDoc.php to get the doc format you want as simple as 123.

Hope this will help you.
yewboon is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 05:35 PM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.