literate.pl

«dependencies»

Usage

 literatepl --strict --warnings --css=path/to/css filename

This script takes a literate perl file (with an lpl extension for scripts or an lpm extension for modules) and produces two files from each:

The code file is stripped of all POD and is amended based on extension and on the command line switches. The html includes

my $parser = new Pod::Literate();

GetOptions(
    "strict"    sub { $parseruse_strict(1) },
    "warnings"  sub { $parseruse_warnings(1) },
    "css=s"     sub { $parseruse_css( $_[1] ) },
    "docpath"   sub { },
    "srcpath"   sub { },
);

Reading from STDIN

If @ARGV is empty the script assumes its input will be coming in on STDIN

$parserparse_from_filehandle( \*STDIN ) if ( @ARGV == 0 );

Reading from files

Any items in ARGV are expected to be filenames

for (@ARGV) { $parserparse_from_file($_); }

Dependencies

This script is a front end for Pod::Literate and uses Getopt::Long for parsing command line arguments.

use Pod::Literate;
use Getopt::Long;