Text::Livedoor::Wiki::Plugin::Block - Block Plugin Base Class
you can use this class as base to create Base Plugin.
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;
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.
regexp for start tag
regexp for end tag
set 1 if your plugin escape Wiki parser in your block.
implement validation
implement Wiki to HTML.
if you did not use it , then $class->get() return.
use checking the other plugin status.
kill child block
get child block
push new child
get opts
polocky
To install Text::Livedoor::Wiki, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::Livedoor::Wiki
CPAN shell
perl -MCPAN -e shell install Text::Livedoor::Wiki
For more information on module installation, please visit the detailed CPAN module installation guide.