File Coverage

blib/lib/Org/Element/FixedWidthSection.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 17 17 100.0


line stmt bran cond sub pod time code
1             package Org::Element::FixedWidthSection;
2              
3 4     4   1088 use 5.010;
  4         17  
4 4     4   23 use locale;
  4         10  
  4         23  
5 4     4   122 use Moo;
  4         11  
  4         19  
6             extends 'Org::Element';
7             with 'Org::ElementRole';
8             with 'Org::ElementRole::Block';
9              
10             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
11             our $DATE = '2023-07-12'; # DATE
12             our $DIST = 'Org-Parser'; # DIST
13             our $VERSION = '0.559'; # VERSION
14              
15             sub text {
16 3     3 1 904 my ($self) = @_;
17 3         13 my $res = $self->_str;
18 3         25 $res =~ s/^[ \t]*: ?//mg;
19 3         15 $res;
20             }
21              
22             1;
23             # ABSTRACT: Represent Org fixed-width section
24              
25             __END__
26              
27             =pod
28              
29             =encoding UTF-8
30              
31             =head1 NAME
32              
33             Org::Element::FixedWidthSection - Represent Org fixed-width section
34              
35             =head1 VERSION
36              
37             This document describes version 0.559 of Org::Element::FixedWidthSection (from Perl distribution Org-Parser), released on 2023-07-12.
38              
39             =head1 SYNOPSIS
40              
41             use Org::Element::FixedWidthSection;
42             my $el = Org::Element::FixedWidthSection->new(_str => ": line1\n: line2\n");
43              
44             =head1 DESCRIPTION
45              
46             Fixed width section is a block of text where each line is prefixed by colon +
47             space (or just a colon + space or a colon). Example:
48              
49             Here is an example:
50             : some example from a text file.
51             : second line.
52             :
53             : fourth line, after the empty above.
54              
55             which is functionally equivalent to:
56              
57             Here is an example:
58             #+BEGIN_EXAMPLE
59             some example from a text file.
60             another example.
61              
62             fourth line, after the empty above.
63             #+END_EXAMPLE
64              
65             Derived from L<Org::Element>.
66              
67             =head1 ATTRIBUTES
68              
69             =head1 METHODS
70              
71             =head2 $el->text => STR
72              
73             The text (without colon prefix).
74              
75             =for Pod::Coverage as_string BUILD
76              
77             =head1 HOMEPAGE
78              
79             Please visit the project's homepage at L<https://metacpan.org/release/Org-Parser>.
80              
81             =head1 SOURCE
82              
83             Source repository is at L<https://github.com/perlancar/perl-Org-Parser>.
84              
85             =head1 AUTHOR
86              
87             perlancar <perlancar@cpan.org>
88              
89             =head1 CONTRIBUTING
90              
91              
92             To contribute, you can send patches by email/via RT, or send pull requests on
93             GitHub.
94              
95             Most of the time, you don't need to build the distribution yourself. You can
96             simply modify the code, then test via:
97              
98             % prove -l
99              
100             If you want to build the distribution (e.g. to try to install it locally on your
101             system), you can install L<Dist::Zilla>,
102             L<Dist::Zilla::PluginBundle::Author::PERLANCAR>,
103             L<Pod::Weaver::PluginBundle::Author::PERLANCAR>, and sometimes one or two other
104             Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required beyond
105             that are considered a bug and can be reported to me.
106              
107             =head1 COPYRIGHT AND LICENSE
108              
109             This software is copyright (c) 2023, 2022, 2021, 2020, 2019, 2017, 2016, 2015, 2014, 2013, 2012, 2011 by perlancar <perlancar@cpan.org>.
110              
111             This is free software; you can redistribute it and/or modify it under
112             the same terms as the Perl 5 programming language system itself.
113              
114             =head1 BUGS
115              
116             Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Org-Parser>
117              
118             When submitting a bug or request, please include a test-file or a
119             patch to an existing test-file that illustrates the bug or desired
120             feature.
121              
122             =cut