POD modules

gnat on 2003-09-10T17:00:05

Rael asked today how to convert a POD file to HTML from his program. He couldn't believe that he had to write and read temporary files. I checked and that's still the case, even on 5.8. I was surprised at how bastard-redhaired-stepchild the POD support has been. I now take back every single eye roll and tolerant sigh I quietly gave when Brad Appleton, Matt Sergeant, and TorgoX submitted patches to P5P.

At the same time, of course, I did basically say to Rael that he should suck it up and stop being a wuss. Temporary files are nothing to be ashamed of. "Consider it a harkening back to the roots of Unix," I said. Judging from his tight-lipped silence, he's not feeling particularly nostalgic right now :-)

--Nat


POD - HTML

petdance on 2003-09-10T17:14:03

I talked to Rael about this last night in AIM, too. The best I could offer was "pod2html < foo.pod > foo.html".

pod2html is just a wrapper around Pod::Html, and it shows. The entire module is really a shell script. Look at the script and you'll see. Flag-parsing is part of the module. :-(

It may have been fine years ago, but now we want to do those sorts of translations on the fly, instead of converting great masses of docs. It's time for that change.

Speaking of changing Pod to HTML on the fly, see my update to Apache::Pod. I got a mighty swell patch to have it support stylesheets.

Pod::Simple::HTML

autarch on 2003-09-10T19:00:34


my $p = Pod::Simple::HTML->new;
my $html = $p->parse_file(...);
# or ...
my $html = $p->parse_string_document(...);

Pod::Simple::HTML

ask on 2003-09-11T07:01:23

As David pointed out, you gave a bad reply to him.

In Combust we use Pod::Simple to parse a POD document as provided by Template Toolkit and parse it into a Template Toolkit document. Certainly no tmp files and it works very well. :-)

  - ask

Re:Pod::Simple::HTML

gnat on 2003-09-11T15:14:52

In Rael's case, he's looking for something that ships with Perl as most of his audience are people who don't know how to (or don't want to know how to) install modules from CPAN. Pod::Simple::HTML is nice, but it's depressing that this has to be something in a CPAN module and that it's taken regular joes like me zillions of years to realize that duh if POD is part of the Perl parser, maybe decent modules to parse POD should be part of Perl?

He could ship blosxom with Pod::Simple and Pod::Simple::HTML but then he has to worry about how to install modules. Right now blosxom is a single CGI program, which makes installation a breeze. Modules vastly complicate that picture. He tries to keep functionality down to things that can be implemented with modules in the core since 5.004, but periodically he gets surprised (as with POD).

--Nat

Re:Pod::Simple::HTML

ask on 2003-09-12T02:37:47

PAR! :-)

    - ask

Re: POD Modules

davorg on 2003-09-11T10:12:38

I've had a lot of success with Pod::POM and TT.

/me realises that's something else we forgot to cover in the book :-/

Re: POD Modules

babbage on 2003-09-17T07:32:08

No no no, pass it off as part of the Grand Scheme: if you intentionally leave some of the good stuff out of the book, then you guarantee yourself an audience for the inevitable sequel. Planned obsolescence! Marketing! It is all as Forseen By Prophesy.

Coming into this late...

Matts on 2003-09-12T11:53:23

But this was one of the main goals of Pod::SAX - to use the standard SAX API for accepting basically anything you can pass to it - a filename, a filehandle or a scalar.

Unfortunately people didn't like Pod::SAX because it a) made people think of XML, and b) wasn't very well documented. So along came Pod::Simple which mostly fixes those two bugs.

Plus I think people didn't really understand the benefits of using something like SAX - the multitude of modules you could then use for generating different format content. Shame really.