Convert::Wiki::Node - Represents a node (headline, paragraph etc) in a text
use Convert::Wiki::Node; my $head = Convert::Wiki::Node->new( txt => 'About Foo', type => 'head1' ); my $text = Convert::Wiki::Node->new( txt => 'Foo is a foobar.', type => 'paragraph' ); print $head->as_wiki(), $text->as_wiki();
A Convert::Wiki::Node represents a node (headline, paragraph etc) in a text. All the nodes together represent the entire document.
Convert::Wiki::Node
$last_error = $cvt->error(); $cvt->error($error); # set new messags $cvt->error(''); # clear error
Returns the last error message, or '' for no error.
my $txt = $node->as_wiki($wiki);
Return the contents of the node as wiki code. The parameter $wiki is the Convert::Wiki object the node belongs to. It can be used to access parameters like interlink.
$wiki
interlink
my $type = $node->type();
Returns the type of the node as string.
my $prev = $node->prev();
Get the node's previous node.
my $prev = $node->prev_by_type( $type );
Find a previous node with a certain type, for instance 'head' or 'line'.
my $next = $node->next();
Get the node's next node.
$node->link( $other );
Set $node's next node to $other and set $others prev to $node .
$node
$other
$rc = $node->_remove_me();
Internally called by Convert::Wiki to fix up the nodes after the first pass. A true return value indicates that this node must be removed entirely.
None by default.
Convert::Wiki.
Tels http://bloodgate.com
Copyright (C) 2004 by Tels
This library is free software; you can redistribute it and/or modify it under the terms of the GPL. See the LICENSE file for more details.
To install Convert::Wiki, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Convert::Wiki
CPAN shell
perl -MCPAN -e shell install Convert::Wiki
For more information on module installation, please visit the detailed CPAN module installation guide.