cajwine
cajwine

Reputation: 3160

Convert All PODs from the given namespace into one big HTML page

Several times need consult the docs. Some (bigger) systems consists from many packages and pods, and not always is clear where is the given method described, e.g. it is in Pgk::Req or in Pkg::Utils etc... It is really time consuming and terribly boring searching the right POD for the description of the given method. ;(

Therefore looking for some way how to convert all POD's from the given namespace, e.g. Some::Pkg:: into one big HTML-page.

I don't need any fancy cross-linking or such - just one big formatted html page where i quickly can find the description of the wanted method. I don't care of the page size - just want get one easy-to-read page.

I tried browse many POD-like modules in the Metacpan - but found no module what can do the above. In short, something like:

make_bigpod CHI::* >one_big.html
# and will get ALL docs for CHI.pm and CHI/*.{pm,pod} into one big page

Any suggestion how?

Upvotes: 4

Views: 118

Answers (3)

clt60
clt60

Reputation: 63932

If you want only one big html page without crosslinks and nice formatting just use the Pod::HTML core module. If comes with the pod2html command, so it is possible to do something like:

cat $(find ~/path/to/packages -type f -print | grep -E 'NameSpace.*\.(pm|pod)') | pod2html --quiet > all.html

In the all.html will be the documentation for all modules from the NameSpace. Dirty, but usable and quick.

Upvotes: 1

xxfelixxx
xxfelixxx

Reputation: 6602

The maintainer of the perldoc page is Jon Allen. He has a Perldoc Server you can use to create a webpage like the perldoc site, but using your code and pod. It includes a search area as well as syntax highlighting and indexes.

http://search.cpan.org/~jonallen/Perldoc-Server-0.10/lib/Perldoc/Server.pm

You could probably merge the generated html into one document if you really want to...

Another option (TIMTOWTDI) would be to write a short script to iterate over your .pm files, collecting the package names and pod sections (use the perldoc parser http://search.cpan.org/dist/Pod-Perldoc/), and just roll your own custom html from the results.

Upvotes: 1

jfroebe
jfroebe

Reputation: 13

Not to be flippant but why not just use perldoc from the command line or use search.cpan.org?

perldoc man page: http://perldoc.perl.org/perldoc.html

Upvotes: -1

Related Questions