Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/songmu/p5-plack-app-directory-markdown
https://github.com/songmu/p5-plack-app-directory-markdown
Last synced: 2 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/songmu/p5-plack-app-directory-markdown
- Owner: Songmu
- License: other
- Created: 2012-08-17T14:56:28.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2017-03-28T10:08:17.000Z (over 7 years ago)
- Last Synced: 2024-10-11T21:09:34.207Z (27 days ago)
- Language: Perl
- Size: 327 KB
- Stars: 4
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
# NAME
Plack::App::Directory::Markdown - Serve translated HTML from markdown files from document root with directory index
# SYNOPSIS
# app.psgi
use Plack::App::Directory::Markdown;
my $app = Plack::App::Directory::Markdown->new->to_app;# app.psgi(with options)
use Plack::App::Directory::Markdown;
my $app = Plack::App::Directory::Markdown->new({
root => '/path/to/markdown_files',
title => 'page title',
tx_path => '/path/to/xslate_templates',
markdown_class => 'Text::Markdown',
})->to_app;# DESCRIPTION
This is a PSGI application for documentation with markdown.
# CONFIGURATION
- root
Document root directory. Defaults to the current directory.
- title
Page title. Defaults to 'Markdown'.
- tx\_path
Text::Xslate's template directory. You can override default template with 'index.tx' and 'md.tx'.
- markdown\_class
Specify Markdown module. 'Text::Markdown' as default.
The module should have 'markdown' sub routine exportable.- callback
Code reference for filtering HTML.
my $app = Plack::App::Directory::Markdown->new({
root => '/path/to/markdown_files',
callback => sub {
my ($content_ref, $env, $dir) = @_;${$content_ref} =~ s!foo!bar!g;
},
})->to_app;# AUTHOR
Masayuki Matsuki
# SEE ALSO
# LICENSE
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.