9 Generate HTML from POD documentation
11 Search directories /usr/local/share/perl and /usr/local/bin
13 Output HTML to /var/www/html/freeside-doc
21 use Pod::Simple::Search;
22 use Pod::Simple::HTML;
23 use Pod::Simple::HTMLBatch;
25 # Disable this to only build docs for Freeside modules
26 # This will cause links to non-freeside packages to be broken,
27 # but save 30-60secs during build process
28 my $include_system_perl_modules = 1;
31 my $html_dir = shift @ARGV
32 or HELP_MESSAGE('Please specify an OUTPUT_DIRECTORY');
34 HELP_MESSAGE("Directory $html_dir: No write access!")
38 my $parser = Pod::Simple::HTMLBatch->new;
40 # Uncomment to suppress status output to STDIN
41 # $parser->verbose(0);
43 $parser->search_class('Inline::Pod::Simple::Search');
44 $parser->html_render_class('Inline::Pod::Simple::HTML');
46 # Customized HTML output
47 our $html_before_title = q{
48 <% include( '/elements/header.html', 'Developer Documentation' ) %>
49 <& /elements/menubar.html,
50 'Freeside Perl Modules' => $fsurl.'docs/library/FS.html',
51 'Complete Index' => $fsurl.'docs/library/index.html',
54 <div style="width: 90%; margin: 1em auto; font-size: .9em; border: solid 1px #666; background-color: #eee; padding: 1em;">
55 <h1 style="margin: .5em; border-bottom: solid 1px #999;">
57 our $html_after_title = q{</h1>};
58 our $html_footer = q{</div><% include ('/elements/footer.html' ) %>};
60 $parser->contents_page_start(
61 "$html_before_title Freeside Documentation Index $html_after_title"
63 $parser->contents_page_end( $html_footer );
66 '/usr/local/share/perl/5.24.1',
68 $include_system_perl_modules ? (
70 '/usr/share/perl/5.24',
71 '/usr/share/perl/5.24.1',
75 $parser->batch_convert( \@search_dirs, $html_dir );
79 print " ERROR: $error \n"
82 Tool to generate HTML from Freeside POD documentation
84 Usage: pod2html.pl OUTPUT_DIRECTORY
92 # Subclass Pod::Simple::Search to render POD from files without
93 # normal perl extensions like PL and PM
94 package Inline::Pod::Simple::Search;
95 use base 'Pod::Simple::Search';
99 my $self = Pod::Simple::Search->new( @_ );
106 # Subclass Pod::Simple::HTML to control HTML output
107 package Inline::Pod::Simple::HTML;
108 use base 'Pod::Simple::HTML';
110 sub html_header_before_title { $html_before_title }
111 sub html_header_after_title { $html_after_title }
112 sub html_footer { $html_footer }