Text::Hatena - Perl extension for formatting text with Hatena Style.
use Text::Hatena; my $parser = Text::Hatena->new( permalink => 'http://www.example.com/entry/123', ); $parser->parse($text); my $html = $parser->html;
Text::Hatena parses text with Hatena Style and generates html string. Hatena Style is a set of text syntax which is originally used in Hatena Diary (http://d.hatena.ne.jp/).
You can get html string from simple text with syntax like Wiki.
Here are common methods of Text::Hatena.
$parser = Text::Hatena->new; $parser = Text::Hatena->new( permalink => 'http://www.example.com/entry/123', ilevel => 1, invalidnode => [qw(h4 h5)], sectionanchor => '@', );
creates an instance of Text::Hatena.
permalink is the uri of your document. It is used in H3 section anchor.
permalink
ilevel is the base indent level.
ilevel
invalidnode is an array reference of invalid nodes. The node in the array will be skipped.
invalidnode
sectionanchor is the string of H3 section anchor.
sectionanchor
$parser->parse($text);
parses text and generates html.
$html = $parser->html;
returns html string generated.
http://d.hatena.ne.jp/ (Japanese)
Junya Kondo, <jkondo@hatena.ne.jp>
Copyright (C) 2005 by Junya Kondo
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Text::Hatena, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::Hatena
CPAN shell
perl -MCPAN -e shell install Text::Hatena
For more information on module installation, please visit the detailed CPAN module installation guide.