7 use Pod::Simple::Search;
8 @ISA = qw(Pod::Simple::HTML);
11 my ($self, $token) = @_;
12 my $page = $token->attr('to');
13 my ($name, $section) = ($page =~ /^([^\(]+)\((\d+)\)$/);
15 my @url = ('..', $section, $name);
16 return join ('/', map { $self->pagepath_url_escape ($_) } @url)
17 . $Pod::Simple::HTML::HTML_EXTENSION;
20 sub VERSION () { '1.0' }
22 $Pod::Simple::HTML::Tagmap{'item-bullet'} = '<li><p>';
23 $Pod::Simple::HTML::Tagmap{'/item-bullet'} = '</p></li>';
24 $Pod::Simple::HTML::Tagmap{'item-number'} = '<li><p>';
25 $Pod::Simple::HTML::Tagmap{'/item-number'} = '</p></li>';
32 use Pod::Simple::HTMLBatch;
34 our $HEADER = <<'EOH';
37 <title>OpenAFS Reference Manual</title>
38 <link rel="stylesheet" title="style" type="text/css" href="style.css" media="all">
40 <body class='contentspage'>
41 <h1>OpenAFS Reference Manual</h1>
44 our %HEADINGS = (1 => 'User Commands',
45 5 => 'Configuration and Data Files',
46 8 => 'Administrator Commands');
48 # Scan all of the POD files and build a list of section, name, and short
49 # description, returning that as an array.
52 for my $dir (qw(pod1 pod5 pod8)) {
55 opendir (D, $dir) or die "Cannot open $dir: $!\n";
56 for my $file (sort grep { !/^\./ && !/CVS/ } readdir D) {
57 open (F, "$dir/$file") or die "Cannot open $dir/$file: $!\n";
61 last if /^=head1/ && !/^=head1\s+NAME\b/;
62 next unless /\s+-\s+/;
63 ($name, $desc) = split (/\s+-\s+/, $_, 2);
66 warn "$dir/$file: cannot find NAME section, skipping\n";
70 push (@index, [ $section, $name, $page, $desc ]);
78 mkdir ('html', 0755) or die "Cannot create html directory: $!\n";
80 for my $dir (qw(pod1 pod5 pod8)) {
83 mkdir ("html/$section", 0755) unless -d "html/$section";
85 my $conv = Pod::Simple::HTMLBatch->new;
88 $conv->contents_file (undef);
89 $conv->add_css ('../style.css', 1);
90 $conv->css_flurry (0);
91 $conv->javascript_flurry (0);
92 $conv->html_render_class ('OpenAFS::HTML');
93 $conv->batch_convert ($dir, "html/$section");
95 copy ('style.css', 'html/style.css') or die "Cannot copy style.css: $!\n";
97 open (INDEX, '> html/index.html')
98 or die "Cannot create html/index.html: $!\n";
100 print INDEX "<table>\n";
101 my @index = scan_names;
103 for my $entry (@index) {
104 my ($section, $name, $page, $desc) = @$entry;
110 if (!$current || $section != $current) {
111 print INDEX qq(<tr><td> </td></tr>\n);
112 print INDEX qq(<tr class="heading"><th colspan="2">);
113 print INDEX qq($HEADINGS{$section}</th></tr>\n);
116 print INDEX qq(<tr><td><a href="$section/$page.html">$name</a></td>);
117 print INDEX qq(<td>$desc</td></tr>\n);
119 print INDEX "</table>\n</body>\n</html>\n";