Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

pod2html --recurse

by KeighleHawk (Scribe)
on Jul 08, 2016 at 18:50 UTC ( #1167476=perlquestion: print w/replies, xml ) Need Help??

KeighleHawk has asked for the wisdom of the Perl Monks concerning the following question:

So I've got to ask, because I really cannot find anyone giving a clear explanation (I suspect weak google-foo and knuckle-headedness on my part). But what exactly does the 'recurse' option for pod2html really do? Because I cannot seem to coerce it into doing anything **I** think it should do. The command does create two tmp files (pod2htmd.tmp and pod2htmi.tmp) that appear as though they would be downright useful for what I want, I just don't seem to get it.

What I want of course, is for it to recursively search through directories creating *.html files out of anything with perlpod in it. For me, this happens to include *.pod, *.pm and *.pl files. As an added bonus, I have other files with different, or no extensions that have perlpod in them also I would like it to convert.

It is made easier perhaps in that every directory with files in it with perlpod, ALL of them in that directory have perlpod.

I've started looking at some of the other ones out there like Pod::Simple::HTMLBatch, but it really bothers me that pod2html has this option that seems like it actually wants to do what I want, but just doesn't do it.

Replies are listed 'Best First'.
Re: pod2html --recurse
by LanX (Archbishop) on Jul 08, 2016 at 19:11 UTC
    what exactly did you call? did you specify podroot and podpath?

    from pod2html

    recurse
     
          --recurse
     
    Recurse into subdirectories specified in podpath (default behaviour).
    

    and podpath says

    podpath
     
          --podpath=name:...:name
     
    Specify which subdirectories of the podroot contain pod files whose HTML converted forms can be linked-to in cross-references.
    

    I seem to remeber that the files you mentioned are meant for cross-references.

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

      pod2html --htmlroot=/var/www/html --podroot=. --recurse --verbose --po +dpath=bin:tests

      The above command just appears to hang for a really long time, presumably waiting for input.

      pod2html --htmlroot=/var/www/html --podroot=. --recurse --verbose --po +dpath=bin:tests --infile=index.pod --outfile=index.html

      creates just one html file (as expected) and does not chase links to create linked html files (as would be nice). It also creates the tmp files.

      bin and tests are subdirectories of '.' and have perl scripts, modules, pod files and other files (sample templates, etc) all with perlpod in them.

      P.S. New discovery for me; the first command IS waiting for input. You can type in random perlpod, then ^d breaks you out of it and outputs to stdout.

Re: pod2html --recurse (resolves links)
by Anonymous Monk on Jul 08, 2016 at 23:10 UTC

    --recurse resolves pod links

    so when you're converting one --infile into one --outfile, pod2html will use the directories from --recurse to resolve links found in --infile, otherwise it won't create html links, so if you're reading the file in a browser, there is nothing to click

    since normally pod2html, if its called at all, its during make phase of module installation, to generate static html files

    but if you're running a laptop and you have multiple versions of perl, this quickly eats your disk space , and scanning entire @INC every time you upgrade module starts slowing down module installs ,

    so you quickly learn to disable html generation and manpage generation and switch to something like

    plackup -l localhost:80 -e require(Pod::POM::Web::PSGI)

    It has been years since I've relied on static pod..html files

    Actually I'm mostly relying on metacpan these days for answering question around here

    See also pod2html/Pod::Html/Pod::Find, podtree2html/pods2html/perl2html, pod2cpanhtml

      Thank-you. The fact I mostly found pod2html as part of make files now makes (pun intended) far more sense.

      I was already starting to look at the list of alternatives you provided but many of them were not in my base install. So I wanted to do a little research before cluttering up my system. Besides, not knowing the answer was really getting on my nerves! :-)

      Thanks again!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1167476]
Approved by marto
Front-paged by kcott
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2019-11-14 16:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (80 votes). Check out past polls.

    Notices?