1 | #!/opt/perl/bin/perl |
1 | #!/opt/perl/bin/perl |
2 | |
2 | |
3 | use common::sense; |
3 | use common::sense; |
4 | |
4 | |
5 | use Pod::POM; |
5 | use Pod::POM; |
6 | use Template; |
|
|
7 | use YAML; |
6 | use YAML; |
8 | |
7 | |
9 | my $parser = new Pod::POM meta => 1; |
8 | my $parser = new Pod::POM meta => 1; |
10 | |
9 | |
11 | my ($pom, $html); |
10 | my ($pom, $html); |
|
|
11 | |
|
|
12 | our $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; |
18 | open FH, ">", "src/news.html.inc" or die "src/news.html.inc: $!"; |
19 | open FH, ">", "src/news.html.inc" or die "src/news.html.inc: $!"; |
19 | print FH $html; |
20 | print FH $html; |
|
|
21 | close FH; |
|
|
22 | |
|
|
23 | open FH, ">", "src/news.top.html.inc" or die "src/news.top.html.inc: $!"; |
|
|
24 | print FH $top_news; |
20 | close FH; |
25 | close FH; |
21 | |
26 | |
22 | %PodRSS::metadata = %{ $pom->metadata }; |
27 | %PodRSS::metadata = %{ $pom->metadata }; |
23 | $html = $pom->present ("PodRSS"); |
28 | $html = $pom->present ("PodRSS"); |
24 | open FH, ">", "src/news.rss" or die "src/news.rss: $!"; |
29 | open FH, ">", "src/news.rss" or die "src/news.rss: $!"; |
… | |
… | |
45 | |
50 | |
46 | use strict; |
51 | use strict; |
47 | use warnings; |
52 | use warnings; |
48 | use utf8; |
53 | use utf8; |
49 | |
54 | |
50 | my $rcsid = '$Id: generate,v 1.27 2010/04/26 13:33:42 root Exp $'; |
55 | my $rcsid = '$Id: generate,v 1.28 2010/04/27 18:58:31 elmex Exp $'; |
51 | |
56 | |
52 | use base "Pod::POM::View"; |
57 | use base "Pod::POM::View"; |
53 | |
58 | |
54 | our $subdir; |
59 | our $subdir; |
55 | our $dir; |
60 | our $dir; |
… | |
… | |
65 | $item->content->present ($self) |
70 | $item->content->present ($self) |
66 | } |
71 | } |
67 | |
72 | |
68 | sub view_head2 { |
73 | sub 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 | |
73 | sub view_textblock { |
90 | sub view_textblock { |
74 | my ($self, $item) = @_; |
91 | my ($self, $item) = @_; |
75 | $item, "<br />" |
92 | $item, "<br />" |