| 1 | #! /bin/false | ||
| 2 | |||
| 3 | # Copyright (C) 2016-2018 Guido Flohr <guido.flohr@cantanea.com>, | ||
| 4 | # all rights reserved. | ||
| 5 | |||
| 6 | # This program is free software: you can redistribute it and/or modify | ||
| 7 | # it under the terms of the GNU General Public License as published by | ||
| 8 | # the Free Software Foundation; either version 3 of the License, or | ||
| 9 | # (at your option) any later version. | ||
| 10 | |||
| 11 | # This program is distributed in the hope that it will be useful, | ||
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | # GNU General Public License for more details. | ||
| 15 | |||
| 16 | # You should have received a copy of the GNU General Public License | ||
| 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 18 | |||
| 19 | package Qgoda::Processor::Hoedown; | ||
| 20 | $Qgoda::Processor::Hoedown::VERSION = 'v0.9.2'; | ||
| 21 | use strict; | ||
| 22 | |||
| 23 | use base qw(Qgoda::Processor); | ||
| 24 | |||
| 25 | use Text::Markdown::Hoedown qw(markdown); | ||
| 26 | |||
| 27 | sub new { | ||
| 28 | my ($class, %options) = @_; | ||
| 29 | |||
| 30 | my $self = $class->SUPER::new(%options); | ||
| 31 | $self->{__options} = \%options; | ||
| 32 | |||
| 33 | return $self; | ||
| 34 | } | ||
| 35 | |||
| 36 | sub process { | ||
| 37 | my ($self, $content, $asset, $filename) = @_; | ||
| 38 | |||
| 39 | my %options = ( | ||
| 40 | extensions => 0x7fff_ffff | ||
| 41 | ); | ||
| 42 | |||
| 43 | return markdown $content, %options; | ||
| 44 | } | ||
| 45 | |||
| 46 | 1; | ||
| 47 | |||
| 48 | =head1 NAME | ||
| 49 | |||
| 50 | Qgoda::Processor::Markdown - Qgoda Processor For Markdown |