App-sdview
view release on metacpan or search on metacpan
lib/App/sdview/Output/Formatted.pm view on Meta::CPAN
$typestyle{$_} and $text->apply_tag( 0, -1, $_ => $typestyle{$_} )
for qw( fg bg bold under italic monospace );
$_nextblank = !!$typestyle{blank_after};
my @lines = $text->split( qr/\n/ );
@lines or @lines = ( String::Tagged->new ) if defined $leader;
# If there's a background set, then space-pad every line to the same width
# so it looks neater on the terminal
# https://rt.cpan.org/Ticket/Display.html?id=140536
if( defined $typestyle{bg} ) {
my $width = max map { length $_ } @lines;
$_ .= " " x ( $width - length $_ ) for @lines;
}
$margin += ( $typestyle{margin} // 0 );
foreach my $line ( @lines ) {
length $line or defined $leader or
lib/App/sdview/Parser/Pod.pm view on Meta::CPAN
This parser module adds to L<App::sdview> the ability to parse input text in
Pod formatting.
It uses L<Pod::Simple> as its driving parser.
The C<SE<lt>...E<gt>> formatting code is handled by converting inner spaces to
non-breaking spaces (U+00A0) characters in the returned string.
By default, verbatim blocks are scanned for likely patterns that indicate perl
code, and emitted with the C<language> field set to C<perl> if it looks
plausible. This can be overridden by embedded C<=code> or C<=for highlighter>
directives; see below.
=head2 Extensions
Partly as an experiment into how to handle possible future features of the Pod
spec, the following extensions are recognised:
=over 4
( run in 0.484 second using v1.01-cache-2.11-cpan-64827b87656 )