ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/lib/cf/pod.pm
(Generate patch)

Comparing deliantra/server/lib/cf/pod.pm (file contents):
Revision 1.15 by root, Sun Sep 7 23:02:40 2008 UTC vs.
Revision 1.20 by root, Wed Oct 21 00:44:39 2009 UTC

1package cf::pod; 1package cf::pod;
2
3use common::sense;
2 4
3use Pod::POM; 5use Pod::POM;
4 6
5our $indent; 7our $indent;
6our $level; 8our $level;
7our @result; 9our @result;
8 10
9package cf::pod::AsParagraphs; 11package cf::pod::AsParagraphs;
10 12
11use strict; 13use common::sense;
12 14
13use base "Pod::POM::View"; 15use base "Pod::POM::View";
14 16
15my %E = ( 17my %E = (
16 "<" => "E<lt>", 18 "<" => "E<lt>",
33 s/\s+/ /g; 35 s/\s+/ /g;
34 36
35 $_ 37 $_
36} 38}
37 39
38*view_seq_file = sub { "B<$_[1]>" }; 40*view_seq_file = sub { "C<$_[1]>" };
39*view_seq_code = sub { "B<$_[1]>" }; 41*view_seq_code = sub { "C<$_[1]>" };
40*view_seq_bold = sub { "B<$_[1]>" }; 42*view_seq_bold = sub { "B<$_[1]>" };
41*view_seq_italic = sub { "I<$_[1]>" }; 43*view_seq_italic = sub { "I<$_[1]>" };
44*view_seq_T = sub { "T<$_[1]>" };
45*view_seq_G = sub { "G<$_[1]>" };
42*view_seq_zero = sub { "Z<>" }; 46*view_seq_zero = sub { "Z<>" };
43*view_seq_space = sub { my $text = $_[1]; $text =~ s/ /\xa0/g; $text }; 47*view_seq_space = sub { my $text = $_[1]; $text =~ s/ /\xa0/g; $text };
44*view_seq_index = sub { push @{ $result[-1]{index} }, $_[1]; "" }; 48*view_seq_index = sub { push @{ $result[-1]{index} }, $_[1]; "" };
45 49
46sub view_seq_text { 50sub view_seq_text {
185 189
186sub load_pod($) { 190sub load_pod($) {
187 my ($path) = @_; 191 my ($path) = @_;
188 192
189 Coro::Storable::thaw cf::cache "cf::pod::as_paragraphs/$path" => [$path], 193 Coro::Storable::thaw cf::cache "cf::pod::as_paragraphs/$path" => [$path],
190 5 => sub { 194 7 => sub {
191 my ($src) = @_; 195 my ($src) = @_;
192 196
193 cf::fork_call { 197 cf::fork_call {
194 my $pod = $src->[0]; 198 my $pod = $src->[0];
195 utf8::decode $pod; 199 utf8::decode $pod;
206 210
207 for my $par (@$pars) { 211 for my $par (@$pars) {
208 if ($par->{type} =~ /^head\d+$/) { 212 if ($par->{type} =~ /^head\d+$/) {
209 $res .= "B<$par->{markup}>\n\n"; 213 $res .= "B<$par->{markup}>\n\n";
210 } elsif ($par->{type} eq "verbatim") { 214 } elsif ($par->{type} eq "verbatim") {
211 $res .= "\n$par->{markup}\n\n"; 215 $res .= "$par->{markup}\n\n";
212 } elsif ($par->{type} eq "item") { 216 } elsif ($par->{type} eq "item") {
213 $res .= "\n* I<$par->{markup}>\n\n"; 217 $res .= "* I<$par->{markup}>\n\n";
214 } else { 218 } else {
215 $res .= "$par->{markup}\n\n"; 219 $res .= "$par->{markup}\n\n";
216 } 220 }
217 } 221 }
218 222

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines