]> git.donarmstrong.com Git - liborg-parser-perl.git/blob - lib/Org/Element/FixedWidthSection.pm
Import original source of Org-Parser 0.23
[liborg-parser-perl.git] / lib / Org / Element / FixedWidthSection.pm
1 package Org::Element::FixedWidthSection;
2
3 use 5.010;
4 use locale;
5 use Moo;
6 extends 'Org::Element';
7
8 our $VERSION = '0.23'; # VERSION
9
10 sub text {
11     my ($self) = @_;
12     my $res = $self->_str;
13     $res =~ s/^[ \t]*: ?//mg;
14     $res;
15 }
16
17 1;
18 # ABSTRACT: Represent Org fixed-width section
19
20
21 =pod
22
23 =head1 NAME
24
25 Org::Element::FixedWidthSection - Represent Org fixed-width section
26
27 =head1 VERSION
28
29 version 0.23
30
31 =head1 SYNOPSIS
32
33  use Org::Element::FixedWidthSection;
34  my $el = Org::Element::FixedWidthSection->new(_str => ": line1\n: line2\n");
35
36 =head1 DESCRIPTION
37
38 Fixed width section is a block of text where each line is prefixed by colon +
39 space (or just a colon + space or a colon). Example:
40
41  Here is an example:
42    : some example from a text file.
43    :   second line.
44    :
45    : fourth line, after the empty above.
46
47 which is functionally equivalent to:
48
49  Here is an example:
50    #+BEGIN_EXAMPLE
51    some example from a text file.
52      another example.
53
54    fourth line, after the empty above.
55    #+END_EXAMPLE
56
57 Derived from L<Org::Element>.
58
59 =head1 ATTRIBUTES
60
61 =head1 METHODS
62
63 =head2 $el->text => STR
64
65 The text (without colon prefix).
66
67 =for Pod::Coverage as_string BUILD
68
69 =head1 AUTHOR
70
71 Steven Haryanto <stevenharyanto@gmail.com>
72
73 =head1 COPYRIGHT AND LICENSE
74
75 This software is copyright (c) 2012 by Steven Haryanto.
76
77 This is free software; you can redistribute it and/or modify it under
78 the same terms as the Perl 5 programming language system itself.
79
80 =cut
81
82
83 __END__
84