… | |
… | |
7 | use Pod::POM; |
7 | use Pod::POM; |
8 | use Template; |
8 | use Template; |
9 | use YAML; |
9 | use YAML; |
10 | |
10 | |
11 | my $parser = new Pod::POM meta => 1; |
11 | my $parser = new Pod::POM meta => 1; |
|
|
12 | |
|
|
13 | my ($pom, $html); |
|
|
14 | |
|
|
15 | $pom = $parser->parse ("src/news-archive.pod") |
|
|
16 | or die $parser->error; |
|
|
17 | $html = $pom->present ("PodHTML"); |
|
|
18 | $html =~ s/\[/</g; |
|
|
19 | $html =~ s/\]/>/g; |
|
|
20 | open FH, ">", "src/news-archive.html"; |
|
|
21 | print FH "News Archive\n\n"; |
|
|
22 | print FH $html; |
|
|
23 | close FH; |
|
|
24 | |
|
|
25 | $pom = $parser->parse ("src/news.pod") |
|
|
26 | or die $parser->error; |
|
|
27 | $html = $pom->present ("PodHTML"); |
|
|
28 | $html =~ s/\[/</g; |
|
|
29 | $html =~ s/\]/>/g; |
|
|
30 | open FH, ">", "html/news.html"; |
|
|
31 | print FH $html; |
|
|
32 | close FH; |
|
|
33 | |
|
|
34 | %PodRSS::metadata = %{ $pom->metadata }; |
|
|
35 | $html = $pom->present ("PodRSS"); |
|
|
36 | $html =~ s/\[/</g; |
|
|
37 | $html =~ s/\]/>/g; |
|
|
38 | open FH, ">", "html/news.rss"; |
|
|
39 | print FH $html; |
|
|
40 | close FH; |
12 | |
41 | |
13 | # Static variables |
42 | # Static variables |
14 | my $static = YAML::LoadFile "variables.yml"; |
43 | my $static = YAML::LoadFile "variables.yml"; |
15 | |
44 | |
16 | my @files = <src/*.html>; |
45 | my @files = <src/*.html>; |
… | |
… | |
77 | } |
106 | } |
78 | |
107 | |
79 | generate "src", "html", @files; |
108 | generate "src", "html", @files; |
80 | generate "monsters", "html\/monsters", @monsters; |
109 | generate "monsters", "html\/monsters", @monsters; |
81 | |
110 | |
82 | my $pom = $parser->parse ("src/news.pod") |
|
|
83 | or die $parser->error; |
|
|
84 | my $html = $pom->present ("PodHTML"); |
|
|
85 | $html =~ s/\[/</g; |
|
|
86 | $html =~ s/\]/>/g; |
|
|
87 | open FH, ">", "html/news.html"; |
|
|
88 | print FH $html; |
|
|
89 | close FH; |
|
|
90 | |
|
|
91 | %PodRSS::metadata = %{ $pom->metadata }; |
|
|
92 | $html = $pom->present ("PodRSS"); |
|
|
93 | $html =~ s/\[/</g; |
|
|
94 | $html =~ s/\]/>/g; |
|
|
95 | open FH, ">", "html/news.rss"; |
|
|
96 | print FH $html; |
|
|
97 | close FH; |
|
|
98 | |
|
|
99 | |
|
|
100 | $pom = $parser->parse ("src/news-archive.pod") |
|
|
101 | or die $parser->error; |
|
|
102 | $html = $pom->present ("PodHTML"); |
|
|
103 | $html =~ s/\[/</g; |
|
|
104 | $html =~ s/\]/>/g; |
|
|
105 | open FH, ">", "html/news-archive.html"; |
|
|
106 | print FH $html; |
|
|
107 | close FH; |
|
|
108 | |
|
|
109 | |
111 | |
110 | package PodHTML; |
112 | package PodHTML; |
111 | |
113 | |
112 | use strict; |
114 | use strict; |
113 | use warnings; |
115 | use warnings; |
114 | use utf8; |
116 | use utf8; |
115 | |
117 | |
116 | my $rcsid = '$Id: generate,v 1.13 2007/09/16 12:13:23 pippijn Exp $'; |
118 | my $rcsid = '$Id: generate,v 1.14 2007/09/16 12:25:35 pippijn Exp $'; |
117 | |
119 | |
118 | use base "Pod::POM::View"; |
120 | use base "Pod::POM::View"; |
119 | |
121 | |
120 | our $subdir; |
122 | our $subdir; |
121 | our $dir; |
123 | our $dir; |