Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

pod2html - How do I make mine look like CPAN?

by jcreasey (Acolyte)
on Apr 19, 2004 at 00:21 UTC ( #346174=perlquestion: print w/replies, xml ) Need Help??
jcreasey has asked for the wisdom of the Perl Monks concerning the following question:

I've been playing around with pod2html but my output never seems to look as cool as what they have on CPAN for modules. I tried using their style sheet but still it doesnt generate the tables the same way. Whats the trick?
  • Comment on pod2html - How do I make mine look like CPAN?

Replies are listed 'Best First'.
Re: pod2html - How do I make mine look like CPAN?
by gmpassos (Priest) on Apr 19, 2004 at 00:52 UTC
    See Pod::HtmlEasy. By dafault it converts in a look like CPAN.

    Graciliano M. P.
    "Creativity is the expression of the liberty".

      Thanks for this.

      Additionally I have this file somewhere It looks like this:

      #!/usr/bin/perl use strict; use warnings; use Pod::HtmlEasy; my $pod_file = shift or die "Specify POD file as argument"; my $podhtml = Pod::HtmlEasy->new(); my $html = $podhtml->pod2html( $pod_file); print $html;

      Then I can do this to generate CPAN like pod and proof read it:
      ./ > out.html

Re: pod2html - How do I make mine look like CPAN?
by PodMaster (Abbot) on Apr 19, 2004 at 07:29 UTC

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Re: pod2html - How do I make mine look like CPAN?
by cees (Curate) on Apr 19, 2004 at 12:02 UTC

    Install Pod::Tree and use the accompanying pods2html program to convert a whole hierarchy of pod files to HTML with CSS support all in one go. Then copy the styles from CPAN and your all set.

    - Cees

Re: pod2html - How do I make mine look like CPAN?
by William G. Davis (Friar) on Apr 19, 2004 at 17:31 UTC

    If you want more flexibility and you know how to use the Template Toolkit (tt2), then you can use the tt2 Pod::POM (Pod Object Model) plugin and tt2 views to parse a POD document and generate HTML for each POD section in it using some templates (e.g., a head2.html template for =head2 sections, a verbatim.html template for verbatim paragraphs, which could surround its contet with a big grey table like search.cpan does). I mention this trick because out of all of the alternatives, I've found it to be the easiest and most powerful.

    I'm not entirely sure how it works, but you see, that's OK, because all I had to do was create a few of templates in the vein of these, have one main template (which I copied from the tt2 documentation souce) with a view in it to call the others, and with a little work I had heavily customized HTML generated from POD. No mucking around with POD::Parser and handlers and state variables, I just wrote the HTML and CSS and let tt2 and Pod::POM do the rest.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://346174]
Approved by Old_Gray_Bear
Front-paged by bronto
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2018-08-18 06:43 GMT
Find Nodes?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:

    Results (185 votes). Check out past polls.