Palm-Progect

 view release on metacpan or  search on metacpan

lib/Palm/Progect/Converter/Text.pm  view on Meta::CPAN


        if ($record->category_name) {
            push @line, "{" . $record->category_name . "}";
        }

        my $desc = $record->description;
        my $para_indent = $record_indent.$indent;

        $desc =~ s/\n/ /g;

        push @line, $desc;

        if ($record->note) {
            my $note = $record->note;
            if ($self->columns) {
                $note = wrap('', $para_indent, $note);
            }
            $note = "<<\n$para_indent$note\n$para_indent>>";
            $note = _expand_tabs($note, $self->tabstop) if $self->fill_with_spaces;
            push @line, $note;
        }

        print FH "${record_indent}", join ' ', @line;

        print FH "\n";
    }
    print FH "\n";

    close FH;
}

sub load_prefs {
}

sub save_prefs {
}

sub _expand_tabs {
    my ($string, $tabstop) = @_;
    $string =~ s/\t/' ' x $tabstop/ge;
    return $string;
}

sub _trim_lines {
    my ($whitespace, $tabstop, @lines) = @_;

    $whitespace = _expand_tabs($whitespace, $tabstop);

    foreach my $line (@lines) {
        $line = _expand_tabs($line, $tabstop);
        $line =~ s/^$whitespace//;
    }
    return @lines;
}


# sub db_name_from_filename {
#     my $filename = shift;
#     $filename =~ tr{\\}{/};
#     $filename =~ tr{:}{/};
#     $filename = (split m{/}, $filename)[-1];
#     $filename =~ s/^lbPG-//;
#     $filename =~ s/\..*?$//;
#     return $filename;
# }
#
# sub expand_tabs {
#     my ($string, $tabstop) = @_;
#     $string =~ s/\t/' ' x $tabstop/ge;
#     return $string;
# }
#
# sub trim_lines {
#     my ($whitespace, $tabstop, @lines) = @_;
#
#     $whitespace = expand_tabs($whitespace, $tabstop);
#
#     foreach my $line (@lines) {
#         $line = expand_tabs($line, $tabstop);
#         $line =~ s/^$whitespace//;
#     }
#     return @lines;
# }
#
#
#
1;

__END__


Example:

@ setting_foo : 1
@ setting_bar : 2


    [ ] action type
    [x] completed action type
    < > action type with todo link
    <x> completed action type with todo link

    [80%] progress type
    [4/5] numeric type

    . info type

    [ ] [5] action type with priority
    [ ] (15/7/2001) action type with date

    [80%] [5] (15/7/2001) {category} progress type with priority and date and category

    [80%] [5] (15/7/2001) {category} progress type with priority and date and category <<
        Multi-Line note
        for this item
        >>


=head1 AUTHOR

Michael Graham E<lt>mag-perl@occamstoothbrush.comE<gt>



( run in 1.865 second using v1.01-cache-2.11-cpan-71847e10f99 )