App-VOJournal
view release on metacpan or search on metacpan
lib/App/VOJournal/VOTL.pm view on Meta::CPAN
return ($object->{value} =~ /^\[X\]/);
} # _checked_box()
sub _descend_objects {
my ($self,$indent) = @_;
my $objects = $self->{objects};
while (0 < $indent) {
if (0 > $#$objects) {
my $newobject = {
children => [],
};
push @$objects, $newobject;
$objects = $newobject->{children};
}
else {
$objects = $objects->[$#$objects]->{children};
}
$indent--;
}
return $objects;
} # _descend_objects()
sub _unchecked_box {
my ($object) = @_;
return ($object->{value} =~ /^\[_\]/);
} # _unchecked_box()
sub _write_object {
my ($object,$indent,$outfh, $filter) = @_;
if (defined $filter) {
return unless ($filter->($object,$indent));
}
print $outfh "\t" x $indent, $object->{value}, "\n";
foreach my $co (@{$object->{children}}) {
_write_object($co,$indent + 1,$outfh,$filter);
}
} # _write_object()
1;
# __END__
=head1 FORMAT OF VIMOUTLINER FILES
Vimoutliner files are text files with a hierarchical structure.
The hierarchical structure is characterized by the number of tabulator
signs (0x09) at the beginning of the line.
A line can be a simple-heading or an object, depending on the first
nontabulator sign of the line.
A simple heading starts with any non-whitespace character except
C<< : ; | < > >>.
A checkbox is a special form of a heading that starts with either
C<< [_] >> or C<< [X] >> after the leading tabulator signs.
A checkbox may contain a percent sign (C<%>) as a placeholder for
the percentage completed.
This percent sign must follow the initial C<< [_] >> after a separating
whitespace.
The following text objects are defined for vimoutliner files:
=over 4
=item C<:> - body text
The text following the C<:> will be wrapped automatically.
=item C<;> - preformatted body text
This text won't be wrapped automatically.
=item C<|> - table
The table headings can be marked with C<||>.
=item C<< > >> - user defined text.
This text will also be wrapped automatically.
=item C<< < >> - user defined preformatted text.
This text won't be wrapped automatically.
=back
=head1 AUTHOR
Mathias Weidner, C<< <mamawe at cpan.org> >>
=head1 BUGS
Please report any bugs or feature requests to C<bug-app-vojournal at rt.cpan.org>, or through
the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=App-VOJournal>. I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc App::VOJournal::VOTL
You can also look for information at:
=over 4
=item * RT: CPAN's request tracker (report bugs here)
L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=App-VOJournal>
=item * AnnoCPAN: Annotated CPAN documentation
L<http://annocpan.org/dist/App-VOJournal>
=item * CPAN Ratings
L<http://cpanratings.perl.org/d/App-VOJournal>
( run in 1.903 second using v1.01-cache-2.11-cpan-75ffa21a3d4 )