NAME Text::Xatena - Text-to-HTML converter with Xatena syntax. SYNOPSIS use Text::Xatena; my $thx = Text::Xatena->new; $thx->format($string); # with some aggressive functions $thx->format($string, inline => Text::Xatena::Inline::Aggressive->new(cache => Cache::MemoryCache->new) ); Customizing inline formatting rule Text::Xatena->new->format($string, inline => MyInline->new ); package MyInline; use strict; use warnings; use Text::Xatena::Inline::Base -Base; match qr{\@([a-z0-9]+)} => sub { my ($self, $twitter_id) = @_; sprintf('@%s', $twitter_id, $twitter_id, ); }; 1; DESCRIPTION Text::Xatena is a text-to-html converter. Text::Xatena is comfortably to writing usual diary and blog, especially for programmers, writers treating long text. What is Xatena Xatena syntax is similar to Hatena syntax (implemented as Text::Hatena), but independent from Hatena services and more expandability. Most block level syntax notations are supported and more compatibility with Hatena::Diary than Text::Hatena 0.20. And don't support rare syntax or what isn't to be done of syntax formatter. SYNTAX Basically, Xatena convert single line breaks to "
and double line breaks to " element except "Stop P" syntax. fooo bar baz is convert to

fooo
bar

baz

Blockquote >> quoted text foobar << is convert to

quoted text

foobar

with cite >http://example.com/> foobar << is convert to

quote

http://example.com/
Pre >| pre formatted |< is convert to
      pre formatted
      
Super pre >|| super pre ||< is convert to
      super pre <a>
      
with lang >|perl| use Text::Xatena; ||< is convert to
      use Text::Xatena;
      
Stop P Stop insert p or br. >

hogehoge br

< is convert to

hogehoge br

< with custom block level element >< foobar >< is convert with auto inserting p to

foobar

Section Create structured sections by * following heading. * head1 foobar ** head2 *** head3 is convert to

head1

foobar

head2

head3
List unordered list - ul - ul -- ul -- ul --- ul - ul is convert to ordered list + ol + ol ++ ol ++ ol +++ ol + ol is convert to
  1. ol
  2. ol
    1. ol
    2. ol
      1. ol
  3. ol
mixed list - ul - ul -+ ol -+ ol -+ ol - ul definition list :definition:description :definition:description is convert to
definition
description
definition
description
multiline This is incompatible syntax with Hatena::Diary :definition: :: description :definition: :: description Table |*foo|*bar|*baz| |test|test|test| |test|test|test| is convert to
foo bar baz
test test test
test test test
Inline syntax Autolink http:// ftp:// mailto:// http://example.com/ ftp://example.com/ mailto:cho45@lowreal.net [http://example.com/] # using Xatena::Inline::Aggressive [http://example.com/] [http://example.com/:title] # auto retrieving from url [http://example.com/:title=Foobar] [http://example.com/:barcode] # show qrcode with google chart API Deter inline syntax []http://example.com/[] Compatibility with Hatena::Diary syntax Some default behaviors of Xatena syntax are different from Hatena::Diary syntax. Big differences: 1. Hatena::Diary syntax converts single break to " block but Xatena converts it to "
. 2. Hatena::Diary syntax converts * (heading notation) to simple " element but Xatena converts it to "
3. Xatena support multiline definition list But Xatena supports Hatena::Diary compatible mode, you can change the behavior with a option. my $thx = Text::Xatena->new(hatena_compatible => 1); AUTHOR cho45 SEE ALSO Text::Hatena > LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.