NAME
Pod::POM::Web - HTML Perldoc server
DESCRIPTION
Pod::POM::Web is a Web application for browsing the documentation of Perl components installed on your local machine. Since pages are dynamically generated, they are always in sync with code actually installed.
The application offers
a tree view for browsing through installed modules (with dynamic expansion of branches as they are visited)
a tree view for navigating and opening / closing sections while visiting a documentation page
a source code view with hyperlinks between used modules and optionally with syntax coloring (see section "Optional features")
direct access to perlfunc entries (builtin Perl functions)
search through perlfaq headers
fulltext search, including names of Perl variables (this is an optional feature -- see section "Optional features").
parsing and display of version number
display if and when the displayed module entered Perl core.
parsing pod links and translating them into hypertext links
links to CPAN sites
The DHTML code for navigating through documentation trees requires a modern browser. So far it has been tested on Microsoft Internet Explorer 6.0 and Firefox 2.0
USAGE
Usage is described in a separate document Pod::POM::Web::Help.
INSTALLATION
Starting the Web application
Once the code is installed (most probably through CPAN or CPANPLUS), you have to configure the web server :
As a mod_perl service
The recommended way to run this application is within a mod_perl environment. If you have Apache2 with mod_perl 2.0, then edit your perl.conf as follows :
PerlModule Apache2::RequestRec
PerlModule Apache2::RequestIO
<Location /perldoc>
SetHandler modperl
PerlResponseHandler Pod::POM::Web->handler
</Location>
Then navigate to URL http://localhost/perldoc.
As a cgi-bin script
Alternatively, you can run this application as a cgi-script by writing a simple file in your cgi-bin
directory, like this :
#!/path/to/perl
use Pod::POM::Web;
Pod::POM::Web->handler;
The same can be done for running under mod_perl Registry (write the same script as above and put it in your Apache/perl directory). However, this does not make much sense, because if you have mod_perl Registry then you could as well run it as a basic mod_perl handler.
As a standalone server
A third way to use this application is to start a process invoking the builtin HTTP server :
perl -MPod::POM::Web -e "Pod::POM::Web->server"
This is useful if you have no other HTTP server, or if you want to run this module under the perl debugger.
Note about static files
The application needs some static DHTML resources (style sheets, javascript code, images). These are served dynamically by the module, under the lib URL; but of course is it more efficient to tell Apache to serve these files directly, by putting an alias to the perl/site/lib/Pod/POM/Web/lib directory.
Note about security
This application is intented as a power tool for Perl developers, not as an Internet application. It will display the documentation and source code of any module installed under your @INC
path or Apache lib/perl
directory, so it is probably a bad idea to put it on a public Internet server.
Optional features
Syntax coloring
Syntax coloring improves readability of code excerpts. If your Perl distribution is from ActiveState, then Pod::POM::Web
will take advantage of the ActiveState::Scineplex module which is already installed on your system. Otherwise, you need to install PPI::HTML, available from CPAN.
Fulltext indexing
Pod::POM::Web
can index the documentation and source code of all your installed modules, including Perl variable names, Names:::Of::Modules
, etc. To use this feature you need to
install Search::Indexer from CPAN
build the index as described in Pod::POM::Web::Indexer documentation.
AnnoCPAN comments
The website http://annocpan.org/ lets people add comments to the documentation of CPAN modules. The AnnoCPAN database is freely downloadable and can be easily integrated with locally installed modules via runtime filtering.
If you want AnnoCPAN comments to show up in Pod::POM::Web, do the following:
install AnnoCPAN::Perldoc from CPAN;
download the database from http://annocpan.org/annopod.db and save it as $HOME/.annocpan.db (see the documentation in the above module for more details). You may also like to try AnnoCPAN::Perldoc::SyncDB which is a crontab-friendly tool for periodically downloading the AnnoCPAN database.
ACKNOWLEDGEMENTS
This web application was deeply inspired by :
the structure of HTML Perl documentation released with ActivePerl (http://www.activeperl.com/ASPN/Perl).
the excellent tree navigation in Microsoft's former MSDN Library Web site -- since they rebuilt the site, keyboard navigation has gone !
the standalone HTTP server implemented in Pod::WebServer.
the wide possibilities of Andy Wardley's Pod::POM parser.
Thanks to BooK who mentioned a weakness in the API, to Chris Dolan who supplied many useful suggestions and patches, and to Rémi Pauchet who pointed out a regression bug with Firefox CSS.
RELEASE NOTES
Indexed information since version 1.04 is not compatible with previous versions.
So if you upgraded from a previous version and want to use the index, you need to rebuild it entirely, by running the command :
perl -MPod::POM::Web::Indexer -e "Pod::POM::Web::Indexer->new->index(-from_scratch => 1)"
BUGS
Please report any bugs or feature requests to bug-pod-pom-web at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Pod-POM-Web. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
AUTHOR
Laurent Dami, <laurent.d...@justice.ge.ch>
COPYRIGHT & LICENSE
Copyright 2007 Laurent Dami, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
TODO
- real tests !
- checks and fallback solution for systems without perlfunc and perlfaq
- bug on Unclassified - empty content
- GvaScript bug first click => scroll, 2nd click => serve
- factorization (esp. initial <head> in html pages)
- use Getopts to choose colouring package, toggle CPAN, etc.
- display bug in perlre (<a...)
- declare bugs
- SQL::Abstract, nonempty line #337
- LWP: item without '*'
- CPAN : C<CPAN::WAIT> in L<..>
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 1620:
Non-ASCII character seen before =encoding in 'Rémi'. Assuming CP1252