3

I have a bunch of PODs spread over multiple Perl script files. I want to write a landing page for all these PODs using another .pod file.

Say, in the folder /my/root/sub_folder/ I have a script file FirstScript.pl with the following POD.

=head1 DESCRIPTION

This is the description

=cut

In the TOC.pod file, I'm trying to link to that section as follows.

=over 4

=item L<Link Text|FirstScript/"DESCRIPTION">

=cut

When I run:

pod2html --podroot=/my/root --podpath=sub_folder --infile=TOC.pod
    --outfile=TOC.html

I get get the error:

pod2html: TOC.pod: cannot resolve L<Link Text|FirstScript/"DESCRIPTION">
    in paragraph X.

Link is resolved if I add the file extension (.pl) to the name part of the L<> code, but then the resulting URL is of the form ".pl.html", which is not how I want the individual outfiles to be like.

What is wrong here? Am I using the podroot and podpath in a way that was not meant to be used?

Jonas
  • 121,568
  • 97
  • 310
  • 388
Ishan De Silva
  • 935
  • 2
  • 8
  • 22

2 Answers2

5

You want to use Pod::Simple::HTMLBatch, it will generate a TOC for you, and it will create and link FirstScript.html correctly

perl -MPod::Simple::HTMLBatch -e Pod::Simple::HTMLBatch::go perl_files_in_sub_folder html_out_folder
  • Pod::Simple::HTMLBatch - convert several Pod files to several HTML files
  • Pod::ProjectDocs / pod2projdocs - ganerates CPAN like project documents from pod.
  • Pod::POM::Web - HTML Perldoc server
  • Pod::HtmlTree - Create a hierarchy of HTML documents from your module's PMs.
  • and honorable mention unixonly http://perl.overmeer.net/oodoc/
obmib
  • 466
  • 2
  • 6
  • Thanks, but this isn't quite the answer I'm looking for. Rather than auto generating a TOC alone, I want to be able to create these links in a bigger document. I'm trying to use POD to write the user manual of a tool and in that, I need to link to various sections of POD spread over many files. – Ishan De Silva Mar 27 '12 at 08:26
  • 1
    Sure it is :) and its much simpler than pod2html, it does what you want out of the box, just try it – obmib Apr 16 '12 at 10:39
0

pod2html needs the parameter --htmldir=...
That's all. Here is my script:
https://www.perlmonks.org/?node_id=55079