ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cfmaps/cfarch2html
(Generate patch)

Comparing cfmaps/cfarch2html (file contents):
Revision 1.6 by root, Sun Nov 20 01:05:34 2005 UTC vs.
Revision 1.13 by root, Mon Dec 26 12:15:11 2005 UTC

15# 15#
16# You should have received a copy of the GNU General Public License 16# You should have received a copy of the GNU General Public License
17# along with gvpe; if not, write to the Free Software 17# along with gvpe; if not, write to the Free Software
18# Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18# Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 19
20our $VERSION = '1.01'; 20our $VERSION = '1.051';
21 21
22use Storable; 22use Storable;
23 23
24my $LIBDIR = $ENV{CROSSFIRE_LIBDIR} 24my $LIBDIR = $ENV{CROSSFIRE_LIBDIR}
25 or die "\$CROSSFIRE_LIBDIR must be set\n"; 25 or die "\$CROSSFIRE_LIBDIR must be set\n";
32 $_ 32 $_
33} 33}
34 34
35$arch = Storable::retrieve "$LIBDIR/archetypes.pst"; 35$arch = Storable::retrieve "$LIBDIR/archetypes.pst";
36 36
37open my $fh, ">:utf8", "archetypes.html" 37system "rm", -rf => "a";
38 or die "archetypes.html: $!"; 38mkdir "a", 0777;
39
40select $fh;
41
42my $W = $meta->{width} * $T;
43my $H = $meta->{height} * $T;
44
45my (@path) = split /\//, $path;
46
47print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">",
48 "<html>",
49 "<head>",
50 "<title>Crossfire Archetypes</title>",
51 "<style type='text/css'><!--\n",
52 "body { background: white; text-color: black; }\n",
53 "a { text-color: blue; }\n",
54 "a:hover { text-color: red; }\n",
55 "a:visited { text-color: #008; }\n",
56
57 "li { white-space: pre; }\n",
58 "p.m { white-space: pre; margin-left: 2em; background: #ddd; padding: 2px; border: 1px solid black; }\n",
59 "-->\n</style>",
60 "</head>",
61 "<body>",
62 "<h1>Crossfire Archetypes</h1>";
63
64print "<table>";
65 39
66sub print_arch { 40sub print_arch {
67 my ($a) = @_; 41 my ($a) = @_;
68 print "<ul>"; 42 print "<ul>";
69 for (sort keys %$a) { 43 for (sort keys %$a) {
73 print "<li>"; 47 print "<li>";
74 if ($_ eq "more") { 48 if ($_ eq "more") {
75 print "more =>\n"; 49 print "more =>\n";
76 print_arch ($a->{more}); 50 print_arch ($a->{more});
77 } elsif ($_ eq "other_arch") { 51 } elsif ($_ eq "other_arch") {
78 print "$_ => <a href='#", (lc $a->{$_}), "'>$v</a>\n"; 52 print "$_ => <a href='#$a->{$_}'>$v</a>\n";
79 } elsif ($_ eq "msg" || $_ eq "lore") { 53 } elsif ($_ eq "msg" || $_ eq "lore") {
80 print "$_ =><p class='m'>$v</p>"; 54 print "$_ =><p class='m'>$v</p>";
81 } else { 55 } else {
82 print "$_ => $v\n"; 56 print "$_ => $v\n";
83 } 57 }
84 print "</li>"; 58 print "</li>";
85 } 59 }
86 print "</ul>"; 60 print "</ul>";
87} 61}
62
88for my $name (sort keys %$arch) { 63for my $name (sort keys %$arch) {
89 print "<tr valign='top'><th align='left'><a name='", (lc $name), "'>$name</a></th><td>"; 64 open my $fh, ">:utf8", "a/$name.xhtml"
65 or die "a/$name.xhtml: $!";
66
67 select $fh;
68
69 print "<?xml version='1.0' encoding='utf-8'?>",
70 '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
71 "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>",
72 "<head>",
73 "<title>Crossfire Archetype '$name'</title>",
74 "<link rel='stylesheet' type='text/css' media='all' href='/common.css'/>",
75 "</head>",
76 "<body>",
77 "<h1>Crossfire Archetype '$name'</h1>";
78
90 print_arch $arch->{$name}; 79 print_arch $arch->{$name};
91 print "</td></tr>"; 80
81 print "<p class='footer'>created by <a href='http://software.schmorp.de/pkg/crossfire'>cfarch2html</a> version $VERSION</p>",
82 "</body></html>";
83
84 close $fh;
85
86 #system "gzip", "-7f", "arc.xhtml";
92} 87}
93 88
94print "</table><hr/><p style='font-size: 8pt'>created by <a href='http://software.schmorp.de/#crossfire'>cfarch2html</a> version $VERSION</p>",
95 "</body></html>";
96 89
97close $fh;
98
99system "gzip", "-7f", "archetypes.html";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines