Call the script with a list of file names to process.
If a file named 'podder.css' is present in the current directory, it will be embedded in a style section of the the resulting html document. If no css file is present and you are using a perlapp executable with a podder file bound in, the bound file will be used instead.
Example:
podder ApplicationNotes.pod MyClass.pm
The above invocation will generate two html files: ApplicationNotes.xhtml and MyClass.xhtml.
Perl source:
use warnings;
use strict;
use Pod::Xhtml;
use File::Basename;
my $stylesheet = '';
if ( open( STYLE, '<', 'podder.css' ) ) {
$stylesheet = join '', <STYLE>;
} elsif ( defined $PerlApp::VERSION ) {
$stylesheet = PerlApp::get_bound_file('podder.css');
}
my $style = <<"END_XHTML";
<style type="text/css">
$stylesheet
</style>
END_XHTML
foreach my $file ( @ARGV ) {
my $base = basename( $file, '.pod', '.pm', '.pl');
my $p = Pod::Xhtml->new;
$p->addHeadText( $style );
$p->parse_from_file( $file, "$base.xhtml" );
}
Here's the perlapp prject file to generate an executable:
PAP-Version: 1.0
Packer: C:\Program Files\ActiveState Perl Dev Kit 6.0 Deployment\bin\p
+erlapp.exe
Bind: podder.css[file=podder.css,text,mode=666]
Clean:
Exe: podder.exe
Script: podder.pl
Shared: none
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.