NAME

Text::Hatena - Perl extension for formatting text with Hatena Style.

SYNOPSIS

  use Text::Hatena;

  my $parser = Text::Hatena->new(
    permalink => 'http://www.example.com/entry/123',
  );
  $parser->parse($text);
  my $html = $parser->html;

DESCRIPTION

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.

METHODS

Here are common methods of Text::Hatena.

new
  $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.

ilevel is the base indent level.

invalidnode is an array reference of invalid nodes. The node in the array will be skipped.

sectionanchor is the string of H3 section anchor.

parse
  $parser->parse($text);

parses text and generates html.

html
  $html = $parser->html;

returns html string generated.

SEE ALSO

http://d.hatena.ne.jp/ (Japanese)

AUTHOR

Junya Kondo, <jkondo@hatena.ne.jp>

COPYRIGHT AND LICENSE

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.