NAME

Mojolicious::Plugin::DocRenderer - Doc Renderer Plugin

SYNOPSIS

# Mojolicious
$self->plugin('doc_renderer');
$self->plugin(doc_renderer => {module => 'MyApp'});
$self->plugin(doc_renderer => {name => 'foo'});
$self->plugin(doc_renderer => {url => '/mydoc'});
$self->plugin(doc_renderer => {preprocess => 'epl'});

# Mojolicious::Lite
plugin 'doc_renderer';
plugin doc_renderer => {module => 'MyApp'};
plugin doc_renderer => {name => 'foo'};
plugin doc_renderer => {url => '/mydoc'};
plugin doc_renderer => {preprocess => 'epl'};

# Example
package MyApp;
use Mojo::Base 'Mojolicious';

sub development_mode {
  # Enable browsing of "/doc" only in development mode
  shift->plugin( 'doc_renderer' );
}

__END__

=head1 NAME

MyApp - My Mojolicious Application

=head1 DESCRIPTION

This document will be available online, for example from L<http://localhost:3000/doc>.

=cut

DESCRIPTION

Mojolicious::Plugin::DocRenderer generates on-the-fly and browses online POD documentation directly from your Mojolicious application source codes and makes it available under /doc (customizable).

The plugin expects that you use POD to document your codes of course.

The plugin is simple modification of Mojolicious::Plugin::PodRenderer.

OPTIONS

module

# Mojolicious::Lite
plugin doc_renderer => {module => 'MyApp'};

Name of the module to initially display. Default is $ENV{MOJO_APP}.

name

# Mojolicious::Lite
plugin doc_renderer => {name => 'foo'};

Handler name.

no_doc

# Mojolicious::Lite
plugin doc_renderer => {no_doc => 1};

Disable doc browser. Note that this option is EXPERIMENTAL and might change without warning!

preprocess

# Mojolicious::Lite
plugin doc_renderer => {preprocess => 'epl'};

Handler name of preprocessor.

url

# Mojolicious::Lite
plugin doc_renderer => {url => '/mydoc'};

URL from which the documentation of your projects is available. Default is /doc.

METHODS

Mojolicious::Plugin::DocRenderer inherits all methods from Mojolicious::Plugin and implements the following new ones.

register

$plugin->register;

Register renderer in Mojolicious application.

SEE ALSO

Mojolicious::Plugin::PodRenderer, Mojolicious, Mojolicious::Guides, http://mojolicio.us.