I have a directory of scripts which I've written and would like to make available to the public through
my job's website. I've been meaning to come up with a system that will do the following:
1. Check each script out of the directory
2. Run a Pod2Html formatter to generate on-line documentation.
3. Bundle the script, a README and a license file into a tarfile.
After this thread, I saw an easy way to do Step #2. Here's my stab at a quick throwaway script that will take a list of files from the command line and make HTML documentation for them in a reasonable manner.
#!/usr/bin/perl -w
# Quick and dirty script for converting perl POD to HTML
# Tex Thompson, 2004 <tex@biosysadmin.com>
use strict;
use Pod::HtmlEasy;
my $podhtml = Pod::HtmlEasy->new() ;
foreach my $file (@ARGV) {
if ( ! -f $file ) {
print STDERR "Error: $file does not exist\n";
next;
}
my $html = $podhtml->pod2html( $file ) ;
my $outfile = $file . '.html';
open OUTFILE, ">$outfile" or die $!;
print OUTFILE "$html\n" ;
close OUTFILE or die $!;
}
Being in a funny mood, I actually timed my development/testing of this, and it took me 12 minutes and 27 seconds. :)
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.