1 package FS::Misc::Pod2Html;
6 use Pod::Simple::HTMLBatch;
7 use Pod::Simple::Search;
12 $include_system_perl_modules
16 our $include_system_perl_modules = 1;
25 Generate HTML from POD Documentation
31 use FS::Misc::Pod2Html 'fs_pod2html';
32 fs_pod2html( '/output/directory' );
34 =head2 fs_pod2html /output/directory/
36 Generates Freeside-themed HTML docuemtnation from installed perl modules
40 our $html_before_title = q{
41 <% include( '/elements/header.html', 'Developer Documentation' ) %>
42 <& /elements/menubar.html,
43 'Freeside Perl Modules' => $fsurl.'docs/library/FS.html',
44 'Complete Index' => $fsurl.'docs/library/index.html',
47 <div style="width: 90%; margin: 1em auto; font-size: .9em; border: solid 1px #666; background-color: #eee; padding: 1em;">
48 <h1 style="margin: .5em; border-bottom: solid 1px #999;">
51 our $html_after_title = q{</h1>};
53 our $html_footer = q{</div><% include ('/elements/footer.html' ) %>};
57 or croak 'Please specify an output directory';
59 croak "Directory $html_dir: No write access"
63 '/usr/local/share/perl/5.24.1',
65 $include_system_perl_modules ? (
67 '/usr/share/perl/5.24',
68 '/usr/share/perl/5.24.1',
72 my $parser = Pod::Simple::HTMLBatch->new;
77 $parser->search_class('Inline::Pod::Simple::Search');
78 $parser->html_render_class('Inline::Pod::Simple::HTML');
79 $parser->contents_page_start(
80 "$html_before_title Freeside Documentation Index $html_after_title"
82 $parser->contents_page_end( $html_footer );
84 $parser->batch_convert( \@search_dirs, $html_dir );
91 Inline::Pod::Simple::Search
95 Subclass of Pod::Simple::Search
97 Enable searching for POD in all files instead of just .pl and .pm
101 package Inline::Pod::Simple::Search;
102 use base 'Pod::Simple::Search';
106 my $self = Pod::Simple::Search->new( @_ );
114 Inline::Pod::Simple::HTML
118 Subclass of Pod::Simple::HTML
120 Customize parsed HTML output
124 # Subclass Pod::Simple::HTML to control HTML output
125 package Inline::Pod::Simple::HTML;
126 use base 'Pod::Simple::HTML';
128 sub html_header_before_title { $html_before_title }
129 sub html_header_after_title { $html_after_title }
130 sub html_footer { $html_footer }