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.3 by root, Sun Aug 13 18:48:57 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;
58} 60}
59 61
60sub view_seq_link { 62sub view_seq_link {
61 my (undef, $link) = @_; 63 my (undef, $link) = @_;
62 64
65 my $text = $link =~ s/^(.*)\|// ? $1 : $link;
66
63 if ($link =~ /http:/) { 67 if ($link =~ /http:/) {
64 "<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"
65 } else { 74 } else {
66 "${MA_BEG}link${MA_SEP}$link$MA_END" 75 "${MA_BEG}link$MA_SEP$text$MA_SEP$link$MA_END"
67 } 76 }
68} 77}
69 78
70sub view_item { 79sub view_item {
71 push @result, { 80 push @result, {
181 190
182sub add_node($) { 191sub add_node($) {
183 my ($node) = @_; 192 my ($node) = @_;
184 193
185 for (@{ $node->{kw} || {} }) { 194 for (@{ $node->{kw} || {} }) {
186 push @{$wiki{$_}}, $node; 195 push @{$wiki{lc $_}}, $node;
187 } 196 }
188} 197}
189 198
190my $root = { 199my $root = {
191 kw => ["pod"], 200 kw => ["pod"],

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines