Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.3 KiB

  1. package Pod::Plainer;
  2. use strict;
  3. use Pod::Parser;
  4. our @ISA = qw(Pod::Parser);
  5. our $VERSION = '0.01';
  6. our %E = qw( < lt > gt );
  7. sub escape_ltgt {
  8. (undef, my $text) = @_;
  9. $text =~ s/([<>])/E<$E{$1}>/g;
  10. $text
  11. }
  12. sub simple_delimiters {
  13. (undef, my $seq) = @_;
  14. $seq -> left_delimiter( '<' );
  15. $seq -> right_delimiter( '>' );
  16. $seq;
  17. }
  18. sub textblock {
  19. my($parser,$text,$line) = @_;
  20. print {$parser->output_handle()}
  21. $parser->parse_text(
  22. { -expand_text => q(escape_ltgt),
  23. -expand_seq => q(simple_delimiters) },
  24. $text, $line ) -> raw_text();
  25. }
  26. 1;
  27. __END__
  28. =head1 NAME
  29. Pod::Plainer - Perl extension for converting Pod to old style Pod.
  30. =head1 SYNOPSIS
  31. use Pod::Plainer;
  32. my $parser = Pod::Plainer -> new ();
  33. $parser -> parse_from_filehandle(\*STDIN);
  34. =head1 DESCRIPTION
  35. Pod::Plainer uses Pod::Parser which takes Pod with the (new)
  36. 'CE<lt>E<lt> .. E<gt>E<gt>' constructs
  37. and returns the old(er) style with just 'CE<lt>E<gt>';
  38. '<' and '>' are replaced by 'EE<lt>ltE<gt>' and 'EE<lt>gtE<gt>'.
  39. This can be used to pre-process Pod before using tools which do not
  40. recognise the new style Pods.
  41. =head2 EXPORT
  42. None by default.
  43. =head1 AUTHOR
  44. Robin Barker, rmb1@cise.npl.co.uk
  45. =head1 SEE ALSO
  46. See L<Pod::Parser>.
  47. =cut