… | |
… | |
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 | |
20 | our $VERSION = '1.01'; |
20 | our $VERSION = '1.03'; |
21 | |
21 | |
22 | use Storable; |
22 | use Storable; |
23 | |
23 | |
24 | my $LIBDIR = $ENV{CROSSFIRE_LIBDIR} |
24 | my $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 | |
37 | open my $fh, ">:utf8", "archetypes.html" |
37 | open my $fh, ">:utf8", "arc.xhtml" |
38 | or die "archetypes.html: $!"; |
38 | or die "arc.xhtml: $!"; |
39 | |
39 | |
40 | select $fh; |
40 | select $fh; |
41 | |
41 | |
42 | my $W = $meta->{width} * $T; |
42 | my $W = $meta->{width} * $T; |
43 | my $H = $meta->{height} * $T; |
43 | my $H = $meta->{height} * $T; |
44 | |
44 | |
45 | my (@path) = split /\//, $path; |
45 | my (@path) = split /\//, $path; |
46 | |
46 | |
|
|
47 | print "<?xml version='1.0' encoding='utf-8'?>", |
47 | print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">", |
48 | "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">", |
48 | "<html>", |
49 | "<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>", |
49 | "<head>", |
50 | "<head>", |
50 | "<title>Crossfire Archetypes</title>", |
51 | "<title>Crossfire Archetypes</title>", |
51 | "<style type='text/css'><!--\n", |
52 | "<link rel='stylesheet' type='text/css' media='all' href='/common.css'/>", |
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>", |
53 | "</head>", |
61 | "<body>", |
54 | "<body>", |
62 | "<h1>Crossfire Archetypes</h1>"; |
55 | "<h1>Crossfire Archetypes</h1>"; |
63 | |
56 | |
64 | print "<table>"; |
57 | print "<table>"; |
… | |
… | |
84 | print "</li>"; |
77 | print "</li>"; |
85 | } |
78 | } |
86 | print "</ul>"; |
79 | print "</ul>"; |
87 | } |
80 | } |
88 | for my $name (sort keys %$arch) { |
81 | for my $name (sort keys %$arch) { |
89 | print "<tr valign='top'><th align='left'><a name='", (lc $name), "'>$name</a></th><td>"; |
82 | print "<tr valign='top'><th align='left'><a id='", (lc $name), "'>$name</a></th><td>"; |
90 | print_arch $arch->{$name}; |
83 | print_arch $arch->{$name}; |
91 | print "</td></tr>"; |
84 | print "</td></tr>"; |
92 | } |
85 | } |
93 | |
86 | |
94 | print "</table><hr/><p style='font-size: 8pt'>created by <a href='http://software.schmorp.de/#crossfire'>cfarch2html</a> version $VERSION</p>", |
87 | print "</table><p class='footer'>created by <a href='http://software.schmorp.de/#crossfire'>cfarch2html</a> version $VERSION</p>", |
95 | "</body></html>"; |
88 | "</body></html>"; |
96 | |
89 | |
97 | close $fh; |
90 | close $fh; |
98 | |
91 | |
99 | system "gzip", "-7f", "archetypes.html"; |
92 | system "gzip", "-7f", "arc.xhtml"; |
|
|
93 | |