Pod 2 html formatter that will run online?

Discussion in 'Perl Misc' started by Lars Eighner, Jan 8, 2009.

  1. Lars Eighner

    Lars Eighner Guest

    Does anyone know of a Pod to HTML formatter that will run *online*?

    --
    Lars Eighner <http://larseighner.com/>
    Bush's third term begins Jan. 20th with an invocation by Rick Warren.
    Obama: No hope; No change; More of the Same.
     
    Lars Eighner, Jan 8, 2009
    #1
    1. Advertising

  2. On 2009-01-08, Lars Eighner <> wrote:
    > Does anyone know of a Pod to HTML formatter that will run *online*?


    You've meant this?

    pod2html precious.pod | elinks -force-html

    --
    Torvalds' goal for Linux is very simple: World Domination
    Stallman's goal for GNU is even simpler: Freedom
     
    Eric Pozharski, Jan 9, 2009
    #2
    1. Advertising

  3. Lars Eighner

    Lars Eighner Guest

    In our last episode, <-francisco.ca.us>, the
    lovely and talented Keith Keller broadcast on comp.lang.perl.misc:

    > On 2009-01-08, Lars Eighner <> wrote:
    >> Does anyone know of a Pod to HTML formatter that will run *online*?


    > How about pod2html? (minimally tested)


    > #!/usr/bin/perl
    > use strict;
    > use warnings;
    > use CGI;
    > my $cgi=CGI->new;
    > print $cgi->header;
    > # if your perl sets -T when run under a webserver
    > $ENV{PATH}='';


    > print `/usr/bin/pod2html /usr/lib/perl5/5.8.4/Pod/Text.pm`;


    In addition to the above, pod2html seems to require a scratch file,
    so you have to change to a world readable and writeable directory, as it
    runs as nobody.

    As I am working in PHP, this works where tmp is a world writeable, world
    readable directory below the current one.

    <?php

    $old = getenv('PATH');
    echo '<p>',$old,' oldpath</p>';
    putenv("PATH=''");
    $ocwd = getcwd();
    echo '<p>',$ocwd,' old current working directory</p>',
    chdir('tmp');
    $foo =
    `/usr/local/bin/pod2html /usr/local/lib/perl5/5.8.8/pod/perldoc.pod`;
    $foo = htmlspecialchars($foo);
    putenv('PATH='.$old);
    $foo = htmlspecialchars($foo);
    echo '<p>',$foo,'<p>';
    echo '<p>',getenv('PATH'),' restored path</p>';
    chdir($ocwd);
    echo '<p>',getcwd(),' restored current working directory</p>';

    ?>


    --
    Lars Eighner <http://larseighner.com/>
    Bush's third term begins Jan. 20th with an invocation by Rick Warren.
    Obama: No hope; No change; More of the Same.
     
    Lars Eighner, Jan 9, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ajax Chelsea

    Is array of POD still a POD type?

    Ajax Chelsea, Dec 1, 2003, in forum: C++
    Replies:
    1
    Views:
    367
    Ron Natalie
    Dec 1, 2003
  2. Morten W. Petersen

    Behaviour of htmllib's HTML parser and formatter

    Morten W. Petersen, Mar 11, 2005, in forum: Python
    Replies:
    0
    Views:
    347
    Morten W. Petersen
    Mar 11, 2005
  3. A.M-SG

    Switching from XML formatter to Binary Formatter

    A.M-SG, Nov 21, 2005, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    351
    Steven Cheng[MSFT]
    Nov 22, 2005
  4. Himanshu Garg
    Replies:
    1
    Views:
    181
    Himanshu Garg
    Sep 21, 2003
  5. Yoo

    online javascript formatter

    Yoo, Feb 12, 2007, in forum: Javascript
    Replies:
    0
    Views:
    259
Loading...

Share This Page