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

Comparing cfmaps/cfarch2html (file contents):
Revision 1.10 by root, Tue Nov 22 17:54:41 2005 UTC vs.
Revision 1.11 by root, Wed Nov 23 09:07:21 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.03'; 20our $VERSION = '1.04';
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", "arc.xhtml" 37system "rm", -rf => "a";
38 or die "arc.xhtml: $!"; 38mkdir "a", 0777;
39
40select $fh;
41
42my $W = $meta->{width} * $T;
43my $H = $meta->{height} * $T;
44
45my (@path) = split /\//, $path;
46
47print "<?xml version='1.0' encoding='utf-8'?>",
48 '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
49 "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>",
50 "<head>",
51 "<title>Crossfire Archetypes</title>",
52 "<link rel='stylesheet' type='text/css' media='all' href='/common.css'/>",
53 "</head>",
54 "<body>",
55 "<h1>Crossfire Archetypes</h1>";
56
57print "<table>";
58 39
59sub print_arch { 40sub print_arch {
60 my ($a) = @_; 41 my ($a) = @_;
61 print "<ul>"; 42 print "<ul>";
62 for (sort keys %$a) { 43 for (sort keys %$a) {
76 } 57 }
77 print "</li>"; 58 print "</li>";
78 } 59 }
79 print "</ul>"; 60 print "</ul>";
80} 61}
62
81for my $name (sort keys %$arch) { 63for my $name (sort keys %$arch) {
82 print "<tr valign='top'><th align='left'><a id='", (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
83 print_arch $arch->{$name}; 79 print_arch $arch->{$name};
84 print "</td></tr>"; 80
81 print "<p class='footer'>created by <a href='http://software.schmorp.de/#crossfire'>cfarch2html</a> version $VERSION</p>",
82 "</body></html>";
83
84 close $fh;
85
86 #system "gzip", "-7f", "arc.xhtml";
85} 87}
86 88
87print "</table><p class='footer'>created by <a href='http://software.schmorp.de/#crossfire'>cfarch2html</a> version $VERSION</p>",
88 "</body></html>";
89 89
90close $fh;
91
92#system "gzip", "-7f", "arc.xhtml";
93

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines