NAME
Text::Livedoor::Wiki::Plugin::Block - Block Plugin Base Class
DESCRIPTION
you can use this class as base to create Base Plugin.
SYNOPSIS
package Text::Livedoor::Wiki::Plugin::Block::Pre;
use warnings;
use strict;
use base qw(Text::Livedoor::Wiki::Plugin::Block);
sub check {
my $self = shift;
my $line = shift;
my $args = shift;
my $on_next = $args->{on_next};
if( $line =~ /^\^/ ) {
$line =~ s/^\^// unless $on_next;;
return { line => $line . "\n" };
}
return;
}
sub get {
my $self = shift;
my $block = shift;
my $inline = shift;
my $items = shift;
my $html = '';
$html .= $inline->parse( $_->{line} ) . "\n" for @$items;
return "<pre>\n$html</pre>\n";
}
1;
FUNCTION
trigger
for $class->trigger_check. If your plugin has start tag and end tag then you should set it , otherwise the other plugin does not know your plugin so , they may be mess up your block.
- start
-
regexp for start tag
- end
-
regexp for end tag
- escape
-
set 1 if your plugin escape Wiki parser in your block.
check
implement validation
get
implement Wiki to HTML.
mobile
if you did not use it , then $class->get() return.
trigger_check
use checking the other plugin status.
kill_child
kill child block
get_child
get child block
push_children
push new child
opts
get opts
AUTHOR
polocky