diff options
Diffstat (limited to 'lib/Pod/Text')
-rw-r--r-- | lib/Pod/Text/Color.pm | 15 | ||||
-rw-r--r-- | lib/Pod/Text/Overstrike.pm | 14 | ||||
-rw-r--r-- | lib/Pod/Text/Termcap.pm | 14 |
3 files changed, 32 insertions, 11 deletions
diff --git a/lib/Pod/Text/Color.pm b/lib/Pod/Text/Color.pm index f747a967ec..35f0b4b295 100644 --- a/lib/Pod/Text/Color.pm +++ b/lib/Pod/Text/Color.pm @@ -1,7 +1,7 @@ # Pod::Text::Color -- Convert POD data to formatted color ASCII text -# $Id: Color.pm,v 1.0 2001/07/10 11:03:43 eagle Exp $ +# $Id: Color.pm,v 1.1 2001/10/20 08:08:39 eagle Exp $ # -# Copyright 1999 by Russ Allbery <rra@stanford.edu> +# Copyright 1999, 2001 by Russ Allbery <rra@stanford.edu> # # This program is free software; you may redistribute it and/or modify it # under the same terms as Perl itself. @@ -29,7 +29,7 @@ use vars qw(@ISA $VERSION); # Don't use the CVS revision as the version, since this module is also in Perl # core and too many things could munge CVS magic revision strings. This # number should ideally be the same as the CVS revision in podlators, however. -$VERSION = 1.00; +$VERSION = 1.01; ############################################################################## @@ -57,6 +57,13 @@ sub seq_b { return colored ($_[1], 'bold') } sub seq_f { return colored ($_[1], 'cyan') } sub seq_i { return colored ($_[1], 'yellow') } +# Output any included code in green. +sub output_code { + my ($self, $code) = @_; + $code = colored ($code, 'green'); + $self->output ($code); +} + # We unfortunately have to override the wrapping code here, since the normal # wrapping code gets really confused by all the escape sequences. sub wrap { @@ -126,7 +133,7 @@ Russ Allbery <rra@stanford.edu>. =head1 COPYRIGHT AND LICENSE -Copyright 1999 by Russ Allbery <rra@stanford.edu>. +Copyright 1999, 2001 by Russ Allbery <rra@stanford.edu>. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. diff --git a/lib/Pod/Text/Overstrike.pm b/lib/Pod/Text/Overstrike.pm index be159f4080..c405235f3f 100644 --- a/lib/Pod/Text/Overstrike.pm +++ b/lib/Pod/Text/Overstrike.pm @@ -1,5 +1,5 @@ # Pod::Text::Overstrike -- Convert POD data to formatted overstrike text -# $Id: Overstrike.pm,v 1.2 2001/07/10 11:04:36 eagle Exp $ +# $Id: Overstrike.pm,v 1.3 2001/10/20 08:11:29 eagle Exp $ # # Created by Joe Smith <Joe.Smith@inwap.com> 30-Nov-2000 # (based on Pod::Text::Color by Russ Allbery <rra@stanford.edu>) @@ -36,7 +36,7 @@ use vars qw(@ISA $VERSION); # Don't use the CVS revision as the version, since this module is also in Perl # core and too many things could munge CVS magic revision strings. This # number should ideally be the same as the CVS revision in podlators, however. -$VERSION = 1.02; +$VERSION = 1.03; ############################################################################## @@ -81,6 +81,13 @@ sub seq_b { local $_ = $_[1]; s/(.)\cH\1//g; s/_\cH//g; s/(.)/$1\b$1/g; $_ } sub seq_f { local $_ = $_[1]; s/(.)\cH\1//g; s/_\cH//g; s/(.)/_\b$1/g; $_ } sub seq_i { local $_ = $_[1]; s/(.)\cH\1//g; s/_\cH//g; s/(.)/_\b$1/g; $_ } +# Output any included code in bold. +sub output_code { + my ($self, $code) = @_; + $code =~ s/(.)/$1\b$1/g; + $self->output ($code); +} + # We unfortunately have to override the wrapping code here, since the normal # wrapping code gets really confused by all the escape sequences. sub wrap { @@ -90,7 +97,7 @@ sub wrap { my $spaces = ' ' x $$self{MARGIN}; my $width = $$self{width} - $$self{MARGIN}; while (length > $width) { - if (s/^((?:(?:[^\n]\cH)?[^\n]){0,$width})\s+// + if (s/^((?:(?:[^\n]\cH)?[^\n]){0,$width})(\Z|\s+)// || s/^((?:(?:[^\n]\cH)?[^\n]){$width})//) { $output .= $spaces . $1 . "\n"; } else { @@ -159,6 +166,7 @@ Joe Smith <Joe.Smith@inwap.com>, using the framework created by Russ Allbery =head1 COPYRIGHT AND LICENSE Copyright 2000 by Joe Smith <Joe.Smith@inwap.com>. +Copyright 2001 by Russ Allbery <rra@stanford.edu>. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. diff --git a/lib/Pod/Text/Termcap.pm b/lib/Pod/Text/Termcap.pm index c49e2c3f96..9e11e01387 100644 --- a/lib/Pod/Text/Termcap.pm +++ b/lib/Pod/Text/Termcap.pm @@ -1,7 +1,7 @@ # Pod::Text::Termcap -- Convert POD data to ASCII text with format escapes. -# $Id: Termcap.pm,v 1.1 2001/07/10 11:04:36 eagle Exp $ +# $Id: Termcap.pm,v 1.2 2001/10/20 08:09:30 eagle Exp $ # -# Copyright 1999 by Russ Allbery <rra@stanford.edu> +# Copyright 1999, 2001 by Russ Allbery <rra@stanford.edu> # # This program is free software; you may redistribute it and/or modify it # under the same terms as Perl itself. @@ -30,7 +30,7 @@ use vars qw(@ISA $VERSION); # Don't use the CVS revision as the version, since this module is also in Perl # core and too many things could munge CVS magic revision strings. This # number should ideally be the same as the CVS revision in podlators, however. -$VERSION = 1.01; +$VERSION = 1.02; ############################################################################## @@ -82,6 +82,12 @@ sub cmd_head2 { sub seq_b { my $self = shift; return "$$self{BOLD}$_[0]$$self{NORM}" } sub seq_i { my $self = shift; return "$$self{UNDL}$_[0]$$self{NORM}" } +# Output any included code in bold. +sub output_code { + my ($self, $code) = @_; + $self->output ($$self{BOLD} . $code . $$self{NORM}); +} + # Override the wrapping code to igore the special sequences. sub wrap { my $self = shift; @@ -143,7 +149,7 @@ Russ Allbery <rra@stanford.edu>. =head1 COPYRIGHT AND LICENSE -Copyright 1999 by Russ Allbery <rra@stanford.edu>. +Copyright 1999, 2001 by Russ Allbery <rra@stanford.edu>. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. |