Ado

 view release on metacpan or  search on metacpan

etc/plugins/markdown_renderer.conf  view on Meta::CPAN

#!/usr/bin/perl
use strict;
use warnings;
use utf8;

#$MOJO_HOME/etc/plugins/markdown_renderer.conf
#Default configuration for Ado::Plugin::MarkdownRenderer
{   md_renderer => 'Text::MultiMarkdown',

    #Can be a method name or CODEREF.
    #First paramether is the md_renderer instance and
    #the second is the markdown text
    md_method => 'markdown',

    #md_method => sub {shift->markdown(shift)},

    #These options will be passed to the md_renderer constructor
    md_options => {use_wikilinks => 0, disable_footnotes => 0},

    #Where the files reside?
    md_root         => app->home->rel_file('public/doc'),
    md_file_sufixes => ['.md'],

    #Do not convert markdown files on each request but reuse already produced html files.
    md_reuse_produced_html => 1,

    #Default helper name
    md_helper => 'md_to_html',

    #Default routes! Define additional routes in ado.conf/plugins/markdown_renderer[$i]/routes
    routes => [
        {   route => '/help/*md_file',
            via   => ['GET'],
            to    => {controller => 'Doc', action => 'show', md_file => 'bg/cover.md'},
        },
        {   route  => '/articles/*html_file',
            params => {html_file => qr/[\/\w-]+\.html/},
            via    => [qw(GET)],
            to     => {controller => 'Articles', action => 'show', html_file => 'hello.html'}

        },
    ],
};



( run in 0.713 second using v1.01-cache-2.11-cpan-39bf76dae61 )