7 use File::Spec::Functions qw(rel2abs splitpath splitdir catpath catdir catfile canonpath);
9 my $input_path = 'C:/SDL_perl/lib/pods';
11 my ($volume, $dirs) = splitpath(rel2abs(__FILE__));
12 my @directories = splitdir(canonpath($dirs));
14 my $parent_dir = catpath($volume, catdir(@directories));
15 my $output_path = catdir($parent_dir, 'pages');
16 my $parser = Pod::Xhtml->new(FragmentOnly => 1);
17 my %module_names = ();
20 read_file($input_path);
23 open($fh, '>', File::Spec->catfile($output_path, 'documentation.html-inc'));
24 binmode($fh, ":utf8");
25 print($fh "<div class=\"pod\">\n<h1>Documentation (latest development branch)</h1>");
26 for my $module_name (sort keys %module_names)
28 print($fh '<a href="' . $module_names{$module_name} . '">',
33 print($fh "</div>\n");
39 my @files = <$path/*>;
43 read_file($_) if(-d $_);
48 $file_name =~ s/^$input_path\/*//;
49 my $module_name = $file_name;
50 $module_name =~ s/\//::/g;
51 $module_name =~ s/(\.pm|\.pod)$//i;
52 $file_name =~ s/\//-/g;
53 $file_name =~ s/(\.pm|\.pod)$/.html-inc/i;
54 my $file_path = $file_name;
55 $file_path =~ s/\-inc$//;
56 $module_names{$module_name} = $file_path;
57 $file_name = File::Spec->catfile($output_path, $file_name);
59 $parser->parse_from_file($_, $file_name);