
CGI::Application::Plugin::HelpMan - man lookup and help doc for your cgi app

I believe that your cgi application should not be an API, it should be a web interface to an API. Just like a script should be a command line interface to an API. Thus documentation in your cgi app should be for the user, not a programmer.
If you are of the sentiment your pod documentation in your cgi app should be the docs used for the end user, then this module is for you.

Pod::Html needs a temp dir that it can read/write to for tmp files. By default it is /tmp If you want otherwise:
my $app = new CGIAPPusingthis(
PARAMS => { abs_tmp => '/tmp' }
);

None are exported by default, you can import all with the export tag ':all'. You can do
use CGI::Application::Plugin::HelpMan ':all';
Pod::Html needs a temp dir to write to. See "TEMPORARY DIRECTORY"
returns body of the html that Pod::Html spat out.
returns title of the html that Pod::Html spat out. could be undef
returns boolean
force term
returns term string

None are exported by default, you can import all public and private methods with the export tag ':all'.
returns what Pod::Html spat out.
returns the absolute path the search resolved to for the code (pod) file

The following subs are not OO. They can be imported into your code explicitly or with the tag ':ALL'.
argument is abs path to file tries to get html doc with Pod::Html
argument is a string tries to resolve to disk via File::Which and Pod::Simple::Search
argument is string, returns boolean - if it looks like a unix command
argument is string, tries to see if it looks like a unix command, returns command string or undef
argument is string tries to clean up into a perl namespace

Imagine you have your cgi app.. "My::App1".
Inside App1.pm, make sure your pod doccumentation is present.
Then your app needs a help runmode..
sub rm_help {
my $self = shift;
my $return = sprintf "<h1>%s</h1> %s", $self->hm_help_title, $self->hm_help_body;
return $return;
}
That's it.
For a more interesting example, complete with lookup, etc.. see CGI::Application::HelpMan.
If that fails try
sub rm_help {
my $self = shift;
$self->hm_set_term('Your::Package');
my $return = sprintf "<h1>%s</h1> %s", $self->hm_help_title, $self->hm_help_body;
return $return;
}

Leo Charre leocharre at cpan dot org
