1 | #!/opt/perl/bin/perl |
1 | #!/opt/perl/bin/perl |
2 | |
2 | |
3 | use strict; |
3 | use common::sense; |
4 | use warnings; |
|
|
5 | use utf8; |
|
|
6 | |
4 | |
7 | use Pod::POM; |
5 | use Pod::POM; |
8 | use Template; |
6 | use Template; |
9 | use YAML; |
7 | use YAML; |
10 | |
8 | |
… | |
… | |
15 | $pom = $parser->parse ("src/news.pod") |
13 | $pom = $parser->parse ("src/news.pod") |
16 | or die $parser->error; |
14 | or die $parser->error; |
17 | $html = $pom->present ("PodHTML"); |
15 | $html = $pom->present ("PodHTML"); |
18 | $html =~ s/\[/</g; |
16 | $html =~ s/\[/</g; |
19 | $html =~ s/\]/>/g; |
17 | $html =~ s/\]/>/g; |
20 | open FH, ">", "src/news.html"; |
18 | open FH, ">", "src/news.html.inc" or die "src/news.html.inc: $!"; |
21 | print FH "News\n\n<h1>News</h1>"; |
|
|
22 | print FH $html; |
19 | print FH $html; |
23 | close FH; |
20 | close FH; |
24 | |
21 | |
25 | %PodRSS::metadata = %{ $pom->metadata }; |
22 | %PodRSS::metadata = %{ $pom->metadata }; |
26 | $html = $pom->present ("PodRSS"); |
23 | $html = $pom->present ("PodRSS"); |
27 | open FH, ">", "html/news.rss"; |
24 | open FH, ">", "html/news.rss" or die "html/news.rss: $!"; |
28 | print FH $html; |
25 | print FH $html; |
29 | close FH; |
26 | close FH; |
|
|
27 | |
|
|
28 | system "rsync -avP src/. html/. --del --delete-excluded --exclude CVS"; |
|
|
29 | |
|
|
30 | exit; |
30 | |
31 | |
31 | # Static variables |
32 | # Static variables |
32 | my $static = YAML::LoadFile "variables.yml"; |
33 | my $static = YAML::LoadFile "variables.yml"; |
33 | |
34 | |
34 | my @files = <src/*.html>; |
35 | my @files = <src/*.html>; |
… | |
… | |
115 | |
116 | |
116 | use strict; |
117 | use strict; |
117 | use warnings; |
118 | use warnings; |
118 | use utf8; |
119 | use utf8; |
119 | |
120 | |
120 | my $rcsid = '$Id: generate,v 1.23 2009/04/05 21:04:58 root Exp $'; |
121 | my $rcsid = '$Id: generate,v 1.24 2010/03/22 20:36:18 root Exp $'; |
121 | |
122 | |
122 | use base "Pod::POM::View"; |
123 | use base "Pod::POM::View"; |
123 | |
124 | |
124 | our $subdir; |
125 | our $subdir; |
125 | our $dir; |
126 | our $dir; |