| 1 |
use strict; |
| 2 |
sub plugin { |
| 3 |
my $global=shift; |
| 4 |
print "Generation namespace documentation\n"; |
| 5 |
print_namespaces($global); |
| 6 |
print "Done with namespaces\n"; |
| 7 |
} |
| 8 |
|
| 9 |
sub print_namespaces { |
| 10 |
my $space=shift; |
| 11 |
print_namespace($space); |
| 12 |
} |
| 13 |
|
| 14 |
sub print_namespace { |
| 15 |
$_=shift; |
| 16 |
|
| 17 |
print "Generating $$_{fullname} index\n"; |
| 18 |
open(FILE,">html/$$_{fullname}_index.html"); |
| 19 |
|
| 20 |
print FILE "<html>\n"; |
| 21 |
print FILE "<head><title>ClanLib Reference: $$_{fullname}</title></head>\n"; |
| 22 |
print FILE ' |
| 23 |
<body text=black link=blue vlink=#800080 bgcolor=white topmargin=0 leftmargin=0> |
| 24 |
<table border=0 cellspacing=0 cellpadding=0 width=100%><tr><td><img border=0 src="../images/eyeheader-main-green-a.png" alt="ClanSoft logo" width=525 height=96></td></tr> |
| 25 |
<tr bgcolor=#dadada><td align=left valign=top><img border=0 src="../images/eyeheader-main-green-b.png" alt="ClanSoft logo" width=190 height=14></td><td align=right valign=top><img border=0 src="../images/clanlib_light.png" width=42 height=14></td></tr></table> |
| 26 |
<table align=center border=0 cellspacing=10> <tr> |
| 27 |
<td><a href="entire_class_index.html">Entire Class Index</a></td> |
| 28 |
<td><a href="class_index.html">Main Class Index</a></td> |
| 29 |
<td><a href="cross_index.html">Cross Index</a></td> |
| 30 |
<td>Global Index</td> |
| 31 |
</table> |
| 32 |
'; |
| 33 |
|
| 34 |
print FILE "<h1 align=center>Namespace $$_{fullname}</h1><p>\n"; |
| 35 |
|
| 36 |
my $items = $_->{items}; |
| 37 |
my @array = sort byname @$items; |
| 38 |
my $child; |
| 39 |
my $type; |
| 40 |
my $col; |
| 41 |
|
| 42 |
$col = 0; |
| 43 |
|
| 44 |
print FILE "<hr noshade>\n"; |
| 45 |
print FILE "<h1>Index:</h1>\n"; |
| 46 |
foreach $type ( $Enum::CLASS, $Enum::TYPEDEF ) |
| 47 |
{ |
| 48 |
print FILE "<dt><h3>Members of type <em>$Enum::TYPE_NAMES[$type]</em></h3>\n"; |
| 49 |
print FILE "<table>\n"; |
| 50 |
foreach $child (@array) |
| 51 |
{ |
| 52 |
if ($child->{ntype} == $type) |
| 53 |
{ |
| 54 |
print FILE "<tr>" if $col == 0; |
| 55 |
$col++; |
| 56 |
print FILE "<td width=20%>"; |
| 57 |
print FILE $child->href(); |
| 58 |
print FILE "</td>"; |
| 59 |
if ($col == 5) |
| 60 |
{ |
| 61 |
$col = 0; |
| 62 |
print FILE "</tr>"; |
| 63 |
} |
| 64 |
print FILE "\n"; |
| 65 |
} |
| 66 |
} |
| 67 |
if ($col != 0) |
| 68 |
{ |
| 69 |
print FILE "</tr>"; |
| 70 |
} |
| 71 |
print FILE "</table>\n"; |
| 72 |
} |
| 73 |
|
| 74 |
|
| 75 |
print FILE "<hr noshade>\n"; |
| 76 |
print FILE "<h1>Member Descriptions:</h1>\n"; |
| 77 |
print FILE "<dl>\n"; |
| 78 |
foreach $type ( $Enum::TYPEDEF, $Enum::FUNCTION ) |
| 79 |
{ |
| 80 |
print FILE "<dt><h3>Members of type <em>$Enum::TYPE_NAMES[$type]</em></h3>\n"; |
| 81 |
foreach $child (@array) |
| 82 |
{ |
| 83 |
if ($child->{ntype} == $type) |
| 84 |
{ |
| 85 |
print FILE "<dd>"; |
| 86 |
print FILE $child->href($child->{fullname}); |
| 87 |
if ($child->{short}) |
| 88 |
{ |
| 89 |
print FILE " - $child->{short}"; |
| 90 |
} |
| 91 |
if ($child->{longcomment}) |
| 92 |
{ |
| 93 |
print FILE "<br>$child->{long}"; |
| 94 |
} |
| 95 |
print FILE "\n"; |
| 96 |
} |
| 97 |
} |
| 98 |
} |
| 99 |
print FILE "</dl>\n"; |
| 100 |
|
| 101 |
print FILE "</body>\n"; |
| 102 |
print FILE "</html>\n"; |
| 103 |
close(FILE); |
| 104 |
} |