Damian Conway > Perl6-Perldoc-v0.0.5 > Perl6::Perldoc::To::Text

Download:
Perl6-Perldoc-v0.0.5.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  11
View/Report Bugs
Source   Latest Release: Perl6-Perldoc-0.000011

NAME ^

Perl6::Perldoc::To::Text - Add a to_text() method to Perl6::Perldoc::Parser

VERSION ^

This document describes Perl6::Perldoc::To::Text version 0.0.1

SYNOPSIS ^

    use Perl6::Perldoc::Parser;
    use Perl6::Perldoc::To::Text;

    # All Perl6::Perldoc::Parser DOM classes now have a to_text() method

DESCRIPTION ^

This module adds a method named to_text() to each of the classes in the Perl6::Perldoc::Root hierarchy, enabling them all to produce a plaintext representation of themselves and their nested components.

The module also adds a to_text() method to the Perl6::Perldoc::ReturnVal object returned by Perl6::Perldoc::Parser::parse(), so that perldoc-to-text conversion can be performed in a single statement:

    use Perl6::Perldoc::Parser;
    use Perl6::Perldoc::To::Text;

    print Perl6::Perldoc::Parser->parse($file)
                                ->report_errors()
                                ->to_text();

INTERFACE ^

Loading the module automatically installs the necessary to_text() methods in every Perl6::Perldoc subclass.

Each to_text() method takes no arguments and returns a string containing a plaintext representation of the object to which the method was applied.

DIAGNOSTICS ^

Adds no new diagnostics to those of Perl6::Perldoc::Parser.

CONFIGURATION AND ENVIRONMENT ^

Perl6::Perldoc::To::Text requires no configuration files or environment variables.

DEPENDENCIES ^

Perl6::Perldoc::Parser

INCOMPATIBILITIES ^

None reported.

BUGS AND LIMITATIONS ^

The plaintext formatting that is produced is relatively primitive. It could certainly be more readable in places. Patches in that direction will be most especially welcome.

The translator does not expand P<> formatting codes (it represents them as external links, rather than pulling the contents of the link into the document). This approach is permitted under the Perldoc definition, but not the desired behaviour.

No bugs have been reported.

Please report any bugs or feature requests to bug-perldoctotext@rt.cpan.org, or through the web interface at http://rt.cpan.org.

AUTHOR ^

Damian Conway <DCONWAY@cpan.org>

LICENCE AND COPYRIGHT ^

Copyright (c) 2006, Damian Conway <DCONWAY@cpan.org>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

DISCLAIMER OF WARRANTY ^

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

syntax highlighting: