=head1 NAME Mojolicious::Plugin::DOCRenderer - Doc Renderer Plugin =head1 SYNOPSIS # Mojolicious::Lite plugin 'DOCRenderer'; plugin DOCRenderer => {module => 'MyApp'}; plugin DOCRenderer => {name => 'foo'}; plugin DOCRenderer => {url => '/mydoc'}; plugin DOCRenderer => {preprocess => 'epl'}; # Mojolicious $self->plugin('DOCRenderer'); $self->plugin(DOCRenderer => {module => 'MyApp'}); $self->plugin(DOCRenderer => {name => 'foo'}); $self->plugin(DOCRenderer => {url => '/mydoc'}); $self->plugin(DOCRenderer => {preprocess => 'epl'}); ############################# # Mojolicious::Lite example # ############################# use Mojolicious::Lite; use File::Basename; plugin 'DOCRenderer' => { # use this script base name as a default module to show for "/doc" module => fileparse( __FILE__, qr/\.pl/ ) }; app->start; __END__ =head1 NAME MyApp - My Mojolicious::Lite Application =head1 DESCRIPTION This documentation will be available online, for example from L. =cut ####################### # Mojolicious example # ####################### package MyApp; use Mojo::Base 'Mojolicious'; sub development_mode { # Enable browsing of "/doc" only in development mode shift->plugin( 'DOCRenderer' ); } sub startup { my $self = shift; # some code } __END__ =head1 NAME MyApp - My Mojolicious Application =head1 DESCRIPTION This documentation will be available online, for example from L. =cut =head1 DESCRIPTION L generates on-the-fly and browses online POD documentation directly from your Mojolicious application source codes and makes it available under I (customizable). The plugin expects that you use POD to document your codes of course. The plugin is simple modification of L. =head1 OPTIONS =head2 C # Mojolicious::Lite plugin DOCRenderer => {module => 'MyApp'}; Name of the module to initially display. Default is C<$ENV{MOJO_APP}>. Mojolicious::Lite application may have undefined C<$ENV{MOJO_APP}>; in such case you should set C, see Mojolicious::Lite example. =head2 C # Mojolicious::Lite plugin DOCRenderer => {name => 'foo'}; Handler name. =head2 C # Mojolicious::Lite plugin DOCRenderer => {no_doc => 1}; Disable doc browser. Note that this option is EXPERIMENTAL and might change without warning! =head2 C # Mojolicious::Lite plugin DOCRenderer => {preprocess => 'epl'}; Handler name of preprocessor. =head2 C # Mojolicious::Lite plugin DOCRenderer => {url => '/mydoc'}; URL from which the documentation of your project is available. Default is I. =head1 METHODS L inherits all methods from L and implements the following new ones. =head2 C $plugin->register; Register renderer in L application. =head1 SEE ALSO L, L, L, L. =cut