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

In reply to Format POD as XHTML with embedded stylesheet by TGI

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.