| Plagger documentation | Contained in the Plagger distribution. |
Plagger::Plugin::Filter::HatenaFormat - Text formatting filter with Hatena Style
- module: Filter::HatenaFormat
config:
ilevel: 1
sectionanchor: '@'
This filter allows you to format the content with Hatena Style. You can get html string from simple text with syntax like Wiki.
Any configurations will be passed to the constructor of Text::Hatena. See Text::Hatena in detail.
Naoya Ito <naoya@bloghackers.net>
| Plagger documentation | Contained in the Plagger distribution. |
package Plagger::Plugin::Filter::HatenaFormat; use strict; use warnings; use base qw( Plagger::Plugin ); our $VERSION = 0.01; use Text::Hatena; sub register { my($self, $context) = @_; $context->register_hook( $self, 'update.entry.fixup' => \&filter, ); } sub filter { my($self, $context, $args) = @_; my $entry = $args->{entry}; my $parser = Text::Hatena->new(%{$self->conf}); $parser->parse($entry->body); $entry->body($parser->html); } 1; __END__