The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Egg::Plugin::Pod::HTML - pod2html for Egg Plugin.

SYNOPSIS

  use Egg qw/ Pod::HTML /;
  
  __PACKAGE__->egg_startup(
    ...
    .....
  
    plugin_pod2html => {
      pod_libs    => [qw{ /path/to/lib /path/to/perl-lib }],
      output_code => 'utf8',
      },
  
    );
  
  __PACKAGE__->run_modes(
    ...
    .....
  
  #
  # The request named/pod/[MODULE_NAME] is caught.
  # Refer to [MODULE_NAME] by $e->snip(1).
  #
    pod => sub {
      my($d, $e)= @_;
      my $pod_body= $e->pod2html( $e->snip(1) );
      
      # If $e->finished(NOT_FOUND) etc. are not done, body is set.
      $e->response->body($pod_body) unless $e->finished;
      },
  
    );

DESCRIPTION

It is a plugin to output the pod document as contents.

CONFIGURATION

The item name of the setting is 'plugin_pod2html'.

cmd_path => [COMAND_PATH],

PATH to pod2html command.

Acquisition is tried by File::Which when omitted. Default when failing in acquisition is '/usr/bin/pod2html'.

  cmd_path => '/usr/local/bin/pod2html',

pod_libs => [LIN_DIR_ARRAY],

PATH list of place in which it looks for Pod document.

  pod_libs => [qw{ /usr/lib/perl5/5.8.0 /home/perl-lib }],

extension => [FILE_EXTENSION],

Extension of Pod document file of object.

Default is 'pm'.

  extension => 'pod',

output_code => [ENCODE_CODE],

When Egg::Plugin::Encode is loaded, it is possible to set it.

It is invalid when there is no $e-> "[ENCODE_CODE]_conv" method.

  output_code => 'utf8',

* When this setting is undefined, Pod is output as it is.

METHODS

pod2html ( [MODULE_NAME], [OPTION_HASH] )

If MODULE_NAME is found in pod_libs, the HTML source is returned by the SCALAR reference.

If MODULE_NAME cannot be recognized as a module name, $e->finished(FORBIDDEN) is returned. Another and '-' of usual ':' are allowed in the delimiter of MODULE_NAME.

When MODULE_NAME is not found, $e->finished(NOT_FOUND) is returned.

Can it pass to the pod2html command in OPTION_HASH, and following option be specified.

  backlink, css, header, hiddendirs, index, quiet, recurse, verbose,

  pod => sub {
     my($d, $e)= @_;
     my $body= $e->pod2html('Egg::Plugin::Pod::HTML');
     $e->response->body($body) unless $e->finished;
   },

pod2html_body ( [MODULE_NAME], [OPTION_HASH] )

It deletes from HTML received from 'pod2html' method excluding <body> ... </body> part and it returns it.

When the Pod document is built into arbitrary contents, this is convenient.

  pod => sub {
     my $body= $e->pod2html_body('Egg::Plugin::Pod::HTML');
     $e->view->param( pod_body => sub { $$body || "" } ) unless $e->finished;
   },
  
  #
  # And, it builds it in the pod.tt template.
  #

OPTIONS METHODS

It is a method for the construction of the option of pod2html. This is not the one preparing it to call it from the outside by the one that this module uses.

  • new, set, set_flag, push_option, output,

SEE ALSO

File::Temp, File::Which, Egg::Plugin::Encode, Egg::Const, Egg::Release,

AUTHOR

Masatoshi Mizuno <lushe@cpan.org>

COPYRIGHT

Copyright (C) 2007 by Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.