ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/bin/pod2wiki
(Generate patch)

Comparing deliantra/Deliantra-Client/bin/pod2wiki (file contents):
Revision 1.4 by root, Sun Aug 13 19:47:06 2006 UTC vs.
Revision 1.5 by root, Mon Aug 14 01:54:09 2006 UTC

1#! perl 1#! perl
2 2
3# convert given .pod files to wiki style
4
5# base path of arch tree, only used for new arch graphics
6my $ARCH = "/root/src/cf.schmorp.de/arch";
7
8use strict;
9
3use Storable; 10use Storable;
4
5# convert given .pod files to wiki style
6
7use strict;
8
9use Pod::POM; 11use Pod::POM;
10 12
11our @result; 13our @result;
12our $indent; 14our $indent;
13our $level; 15our $level;
62 64
63 my $text = $link =~ s/^(.*)\|// ? $1 : $link; 65 my $text = $link =~ s/^(.*)\|// ? $1 : $link;
64 66
65 if ($link =~ /http:/) { 67 if ($link =~ /http:/) {
66 "<u>" . (::asxml $link) . "</u>" 68 "<u>" . (::asxml $link) . "</u>"
69 } elsif ($link =~ /^\$ARCH\/(.+)$/) {
70 my $path = $1;
71 (my $base = $path) =~ s/.*\///;
72 -f "$ARCH/$path" && system "cp -p \Q$ARCH/$path\E \Qresources/arch/$base";
73 "${MA_BEG}image${MA_SEP}arch/$base$MA_END"
67 } else { 74 } else {
68 "${MA_BEG}link$MA_SEP$text$MA_SEP$link$MA_END" 75 "${MA_BEG}link$MA_SEP$text$MA_SEP$link$MA_END"
69 } 76 }
70} 77}
71 78
183 190
184sub add_node($) { 191sub add_node($) {
185 my ($node) = @_; 192 my ($node) = @_;
186 193
187 for (@{ $node->{kw} || {} }) { 194 for (@{ $node->{kw} || {} }) {
188 push @{$wiki{$_}}, $node; 195 push @{$wiki{lc $_}}, $node;
189 } 196 }
190} 197}
191 198
192my $root = { 199my $root = {
193 kw => ["pod"], 200 kw => ["pod"],

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines