Skip to content

Commit

Permalink
Fix document
Browse files Browse the repository at this point in the history
  • Loading branch information
cho45 committed Nov 17, 2011
1 parent 53b1e9c commit f801602
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ SYNOPSIS
$thx->format($string);

# with some aggressive functions
$thx->format($string,
my $thx = Text::Xatena->new(
inline => Text::Xatena::Inline::Aggressive->new(cache => Cache::MemoryCache->new)
);
$thx->format($string);

Customizing inline formatting rule

Text::Xatena->new->format($string,
Text::Xatena->new(
inline => MyInline->new
);
)->format($string);

package MyInline;
use strict;
Expand Down Expand Up @@ -311,7 +312,8 @@ SYNTAX

my $thx = Text::Xatena->new;
my $inline = Text::Xatena::Inline->new;
my $formatted = $thx->format('aaa((foobar)) bbb((barbaz))', inline => $inline);
$thx->inline($inline);
my $formatted = $thx->format('aaa((foobar)) bbb((barbaz))');
my $out = '';
$out .= '<div class="body">';
$out .= $formatted;
Expand Down
10 changes: 6 additions & 4 deletions lib/Text/Xatena.pm
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,16 @@ Text::Xatena - Text-to-HTML converter with Xatena syntax.
$thx->format($string);
# with some aggressive functions
$thx->format($string,
my $thx = Text::Xatena->new(
inline => Text::Xatena::Inline::Aggressive->new(cache => Cache::MemoryCache->new)
);
$thx->format($string);
Customizing inline formatting rule
Text::Xatena->new->format($string,
Text::Xatena->new(
inline => MyInline->new
);
)->format($string);
package MyInline;
use strict;
Expand Down Expand Up @@ -469,7 +470,8 @@ and footnote object is available in inline object, so you will do expand it like
my $thx = Text::Xatena->new;
my $inline = Text::Xatena::Inline->new;
my $formatted = $thx->format('aaa((foobar)) bbb((barbaz))', inline => $inline);
$thx->inline($inline);
my $formatted = $thx->format('aaa((foobar)) bbb((barbaz))');
my $out = '';
$out .= '<div class="body">';
$out .= $formatted;
Expand Down

0 comments on commit f801602

Please sign in to comment.