Skip to content

Commit

Permalink
pod fix more
Browse files Browse the repository at this point in the history
  • Loading branch information
tomill committed Feb 10, 2010
1 parent ec250fd commit 46eb33a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
8 changes: 4 additions & 4 deletions lib/Template/Semantic.pm
Expand Up @@ -20,7 +20,7 @@ sub new {
$parser->$_($opt{$_}) for keys %opt;
$parser;
};

for (@Template::Semantic::Filter::EXPORT_OK) {
$self->define_filter($_ => \&{'Template::Semantic::Filter::' . $_});
}
Expand Down Expand Up @@ -272,8 +272,8 @@ I<Scalar-ref:> Replace the inner content with this as fragment XML/HTML.
I<undef:> Delete the element/attirbute that the selector indicates.
$ts->process($template, {
'h1' => undef, # <div><h1></h1>foo</div> =>
# <div>foo</div>
'h1' => undef, # <div><h1>foo</h1>bar</div> =>
# <div>bar</div>
'div.foo@class' => undef, # <div class="foo">foo</div> =>
# <div>foo</div>
Expand Down Expand Up @@ -404,7 +404,7 @@ to delete, etc.).
I<Array-ref of Scalars:> Value and filters. Filters may be
A) Callback subroutine
A) Callback subroutine (code reference)
B) Defined filter name
Expand Down
11 changes: 11 additions & 0 deletions lib/Template/Semantic/Cookbook.pod
Expand Up @@ -124,6 +124,7 @@ If template contains dummy items to check design, you may delete them first.
{ '.' => 'BBB' },
{ '.' => 'CCC' },
{ '.' => 'DDD' },
{ '.' => 'EEE' },
],
});

Expand All @@ -135,6 +136,16 @@ If template contains dummy items to check design, you may delete them first.
<li class="dummy">sample</li>
</ul>

Output:

<ul>
<li>AAA</li>
<li>BBB</li>
<li>CCC</li>
<li>DDD</li>
<li>EEE</li>
</ul>


=head2 Indicator only for Temlate::Semantic

Expand Down
10 changes: 6 additions & 4 deletions lib/Template/Semantic/Document.pm
Expand Up @@ -39,7 +39,7 @@ sub as_string {
my ($self, %opt) = @_;

$opt{is_xhtml} = 1 unless defined $opt{is_xhtml};

if ($self->{source} =~ /^<\?xml/) {
return $self->{dom}->serialize(1);
}
Expand All @@ -55,7 +55,7 @@ sub as_string {
);
$self->{dom_hacked}++;
}

if (my $root = $self->{dom}->documentElement) {
$r .= $root->serialize;
$r =~ s/\n*$/\n/;
Expand Down Expand Up @@ -160,7 +160,7 @@ sub _assign_value {
my $joint;
for my $v (@$value) {
next if ref($v) ne 'HASH';

my $tmpl = $self->_to_node($node->serialize);
$self->_query($tmpl, $v);
$container->addChild($joint->cloneNode) if $joint;
Expand Down Expand Up @@ -316,7 +316,9 @@ Template::Semantic::Document - Template::Semantic Result object
=item $out = $out->process( \%vars )
Process again to the result and returns L<Template::Semantic::Document>
object again. So you can chain C<< ->process(...)->process(...) >>.
object again. So you can chain
Template::Semantic->process(...)->process(...)
=item "$out" (stringify)
Expand Down

0 comments on commit 46eb33a

Please sign in to comment.