1 | #!/opt/bin/perl |
1 | #!/opt/bin/perl |
2 | |
2 | |
3 | # cfarch2html - convert crossfire archetypes to html |
3 | # cfarch2html - convert deliantra archetypes to html |
4 | # Copyright (C) 2005,2007 Marc Lehmann <cfmaps@schmorp.de> |
4 | # Copyright (C) 2005,2007,2008 Marc Lehmann <cfmaps@schmorp.de> |
5 | # |
5 | # |
6 | # CFARCH2HTML is free software; you can redistribute it and/or modify |
6 | # CFARCH2HTML is free software; you can redistribute it and/or modify |
7 | # it under the terms of the GNU General Public License as published by |
7 | # it under the terms of the GNU General Public License as published by |
8 | # the Free Software Foundation; either version 2 of the License, or |
8 | # the Free Software Foundation; either version 2 of the License, or |
9 | # (at your option) any later version. |
9 | # (at your option) any later version. |
… | |
… | |
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 = '2.001'; |
20 | our $VERSION = '2.002'; |
21 | |
21 | |
22 | use Crossfire 1.0; |
22 | use Deliantra; |
23 | use Storable; |
23 | use Storable; |
24 | |
24 | |
25 | sub escape_html($) { |
25 | sub escape_html($) { |
26 | local $_ = shift; |
26 | local $_ = shift; |
27 | s/([<>&])/sprintf "&#%d;", ord $1/ge; |
27 | s/([<>&])/sprintf "&#%d;", ord $1/ge; |
… | |
… | |
53 | print "</li>"; |
53 | print "</li>"; |
54 | } |
54 | } |
55 | print "</ul>"; |
55 | print "</ul>"; |
56 | } |
56 | } |
57 | |
57 | |
58 | Crossfire::load_archetypes; |
58 | Deliantra::load_archetypes; |
59 | |
59 | |
60 | for my $name (sort keys %ARCH) { |
60 | for my $name (sort keys %ARCH) { |
61 | open my $fh, ">:utf8", "a/$name.xhtml" |
61 | open my $fh, ">:utf8", "a/$name.xhtml" |
62 | or die "a/$name.xhtml: $!"; |
62 | or die "a/$name.xhtml: $!"; |
63 | |
63 | |