develooper Front page | perl.libwww | Postings from October 2001

Perl documentation

Thread Next
From:
Martin Haase-Thomas
Date:
October 24, 2001 01:22
Subject:
Perl documentation
Message ID:
01102410084000.06298@Legoland
Hi you,

although the concern of my mail not actually within the topic of this mailing list, I think it will
be of interest for you. 
After typing the following verses in a Linux shell you'll get the pod code within the pm's of your
perl library transformed into html. The resulting HTML-document is being moved to
/usr/local/doc/perl5, for instance. The directory tree there will parallel to that on
/usr/lib/perl5 (or where ever you keep it).

Requires: find, awk, tee, pod2html, a preinstalled destination directory.
Lacks: Not all pm's contain pod code. There will be html-files with 0 bytes length, however.

1.) cd /usr/lib/perl5
2.) find -name \*.pm | awk '{dir=$1; html=gensub("\.pm","\.html","",dir);
                         system("pod2html " $1 " | tee " html);
                         sub("\.","\/usr\/local\/doc\/perl5",dir);
                         sub("\/[[:alnum:]_-]*.pm","",dir);
                         system("mkdir " dir);
                         system("mv " html " " dir "/")}'

Never mind the linefeeds in here, this is a one-liner. Always type the spaces exactly, as awk uses
them for concatenation.

Happy Perl'ing
Martin

-- 
Please submit bug reports to thcsoft@snafu.de

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About