Convert::Wiki::Node - Represents a node (headline, paragraph etc) in a text


Convert-Wiki documentation  | view source Contained in the Convert-Wiki distribution.

Index


NAME

Top

Convert::Wiki::Node - Represents a node (headline, paragraph etc) in a text

SYNOPSIS

Top

	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();

DESCRIPTION

Top

A Convert::Wiki::Node represents a node (headline, paragraph etc) in a text. All the nodes together represent the entire document.

METHODS

Top

error()

	$last_error = $cvt->error();

	$cvt->error($error);			# set new messags
	$cvt->error('');			# clear error

Returns the last error message, or '' for no error.

as_wiki()

	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.

type()

	my $type = $node->type();

Returns the type of the node as string.

prev()

	my $prev = $node->prev();

Get the node's previous node.

prev_by_type

	my $prev = $node->prev_by_type( $type );

Find a previous node with a certain type, for instance 'head' or 'line'.

next()

	my $next = $node->next();

Get the node's next node.

_remove_me()

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

EXPORT

Top

None by default.

SEE ALSO

Top

Convert::Wiki.

AUTHOR

Top

Tels http://bloodgate.com

COPYRIGHT AND LICENSE

Top


Convert-Wiki documentation  | view source Contained in the Convert-Wiki distribution.