ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/www/generate
(Generate patch)

Comparing deliantra/www/generate (file contents):
Revision 1.27 by root, Mon Apr 26 13:33:42 2010 UTC vs.
Revision 1.28 by elmex, Tue Apr 27 18:58:31 2010 UTC

1#!/opt/perl/bin/perl 1#!/opt/perl/bin/perl
2 2
3use common::sense; 3use common::sense;
4 4
5use Pod::POM; 5use Pod::POM;
6use Template;
7use YAML; 6use YAML;
8 7
9my $parser = new Pod::POM meta => 1; 8my $parser = new Pod::POM meta => 1;
10 9
11my ($pom, $html); 10my ($pom, $html);
11
12our $top_news;
12 13
13$pom = $parser->parse ("src/news.pod") 14$pom = $parser->parse ("src/news.pod")
14 or die $parser->error; 15 or die $parser->error;
15$html = $pom->present ("PodHTML"); 16$html = $pom->present ("PodHTML");
16$html =~ s/\[/</g; 17$html =~ s/\[/</g;
17$html =~ s/\]/>/g; 18$html =~ s/\]/>/g;
18open FH, ">", "src/news.html.inc" or die "src/news.html.inc: $!"; 19open FH, ">", "src/news.html.inc" or die "src/news.html.inc: $!";
19print FH $html; 20print FH $html;
21close FH;
22
23open FH, ">", "src/news.top.html.inc" or die "src/news.top.html.inc: $!";
24print FH $top_news;
20close FH; 25close FH;
21 26
22%PodRSS::metadata = %{ $pom->metadata }; 27%PodRSS::metadata = %{ $pom->metadata };
23$html = $pom->present ("PodRSS"); 28$html = $pom->present ("PodRSS");
24open FH, ">", "src/news.rss" or die "src/news.rss: $!"; 29open FH, ">", "src/news.rss" or die "src/news.rss: $!";
45 50
46use strict; 51use strict;
47use warnings; 52use warnings;
48use utf8; 53use utf8;
49 54
50my $rcsid = '$Id: generate,v 1.27 2010/04/26 13:33:42 root Exp $'; 55my $rcsid = '$Id: generate,v 1.28 2010/04/27 18:58:31 elmex Exp $';
51 56
52use base "Pod::POM::View"; 57use base "Pod::POM::View";
53 58
54our $subdir; 59our $subdir;
55our $dir; 60our $dir;
65 $item->content->present ($self) 70 $item->content->present ($self)
66} 71}
67 72
68sub view_head2 { 73sub view_head2 {
69 my ($self, $item) = @_; 74 my ($self, $item) = @_;
70 "<p><em><span class=\"date\">", $item->title, "</span> ", $item->content->present ($self), "</em></p>" 75 my @str = (
76 "<p><em><span class=\"date\">",
77 $item->title,
78 "</span> ",
79 $item->content->present ($self),
80 "</em></p>"
81 );
82
83 unless (defined $top_news) {
84 $top_news = join '', @str;
85 }
86
87 @str
71} 88}
72 89
73sub view_textblock { 90sub view_textblock {
74 my ($self, $item) = @_; 91 my ($self, $item) = @_;
75 $item, "<br />" 92 $item, "<br />"

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines