]> git.decadent.org.uk Git - maypole.git/blob - doc/makedoc.pl
Win32 support
[maypole.git] / doc / makedoc.pl
1 my @templates = <../templates/factory/*>;
2
3 my %doc;
4
5 for my $template (@templates) {
6     open TEMP, $template or die $!;
7     $template =~ s/.*factory\///g;
8     while (<TEMP>) {
9         next unless /^#?=for doc/... /^#?=cut/
10                     and not /(%#?\]|\[%#?)$/
11                     and not /=cut|=for doc/; # Much magic.
12         s/^\s*#//g;
13         $doc{$template} .= $_;
14     }
15 }
16
17 while (<>) {
18     if (!/^=template (\w+)/) { print; next; }
19     die "Can't find doc for template $1" unless $doc{$1};
20     print $doc{$1};
21 }