HTML-FromText-2.07/000755 000766 000766 00000000000 12170515240 013727 5ustar00rjbsrjbs000000 000000 HTML-FromText-2.07/bin/000755 000766 000766 00000000000 12170515240 014477 5ustar00rjbsrjbs000000 000000 HTML-FromText-2.07/Changes000644 000766 000766 00000005071 12170515240 015225 0ustar00rjbsrjbs000000 000000 Revision history for HTML-FromText 2.07 2013-07-14 08:33:32 America/New_York - typo fix in documentation; thanks to Francesco Cecconi and Debian 2.06 2013-07-03 13:21:34 America/New_York - Repackage, update to pass with different escaping 2.05 - blockparas uses

as its inner tag, instead of

- blockparas and blockcode are consolidated when they are found in groups. blocklines are left out because they're so literal. 2.04 - Fixed bug when run under 5.8.1 and always-random hashes. - Emacs macros enhanced. 2.03 - Working toward standards compliance. - blockcode now uses pre tags. - blockparas and blockquotes use div tags. - Remove dependency on Regexp::Common. - XHTML 1.1 valid output. - CSS Class names for every option type. - Fixed a but in tables where duplicate breakpoints were being entered (reported by Dan Wright). - Fixed but in tables where breakpoints of two spaces were ignored. - text2html command line utility ensures output ends in newline. - Add example emacs macros for modifying regions with text2html. 2.02 - Added command line utility called 'text2html'. It will be installed when this version of HTML::FromText is built and installed. - Fixed but in blockcode, wasn't preserving spaces. 2.01 - Fixed URLS, they were broken because Regexp::Common::URI was much too restrictive (reported by Wim Kerkhoff). - Fixed bullets. Mixing '*' and '-' were previously allowed and caused problems. They can't be mixed within paragraphs that are bulleted lists any longer (reported by Wim Kerkhoff). - Fixed bold and underline, they were broken and matching, but not substituting, across line boundaries. They no longer match across line boundaries (reported by Wim Kerkhoff). - Fixed bold and underline, they were too greedy. Now they require some non-word character before and after them (or the beginning or ending of a line). (reported by Wim Kerkhoff). - Nasty bug in lists where a nested list can cause an infinite loop when bullets don't line up quite right vertically (reported by Wim Kerkhoff). 2.00 - Initial release as complete rewrite of version 1.005 by GDR. - Inadvertently created a new feature, nested bulleted and numbered lists. HTML-FromText-2.07/dist.ini000644 000766 000766 00000000353 12170515240 015374 0ustar00rjbsrjbs000000 000000 name = HTML-FromText author = Ricardo SIGNES author = Casey West author = Gareth Rees license = Perl_5 copyright_holder = Casey West copyright_year = 2003 [@RJBS] HTML-FromText-2.07/lib/000755 000766 000766 00000000000 12170515240 014475 5ustar00rjbsrjbs000000 000000 HTML-FromText-2.07/LICENSE000644 000766 000766 00000043645 12170515240 014750 0ustar00rjbsrjbs000000 000000 This software is copyright (c) 2003 by Casey West. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2003 by Casey West. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "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 PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. 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 PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (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 PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2003 by Casey West. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End HTML-FromText-2.07/Makefile.PL000644 000766 000766 00000003315 12170515240 015703 0ustar00rjbsrjbs000000 000000 use strict; use warnings; use ExtUtils::MakeMaker 6.30; my %WriteMakefileArgs = ( "ABSTRACT" => "converts plain text to HTML", "AUTHOR" => "Ricardo SIGNES , Casey West , Gareth Rees ", "BUILD_REQUIRES" => {}, "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "6.30" }, "DISTNAME" => "HTML-FromText", "EXE_FILES" => [ "bin/text2html" ], "LICENSE" => "perl", "NAME" => "HTML::FromText", "PREREQ_PM" => { "Carp" => 0, "Email::Find::addrspec" => "0.09", "Exporter" => "5.58", "HTML::Entities" => "1.26", "Scalar::Util" => "1.12", "Text::Tabs" => "98.1128", "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "File::Find" => 0, "File::Spec" => 0, "File::Temp" => 0, "Test::More" => "0.96" }, "VERSION" => "2.07", "test" => { "TESTS" => "t/*.t" } ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { my $tr = delete $WriteMakefileArgs{TEST_REQUIRES}; my $br = $WriteMakefileArgs{BUILD_REQUIRES}; for my $mod ( keys %$tr ) { if ( exists $br->{$mod} ) { $br->{$mod} = $tr->{$mod} if $tr->{$mod} > $br->{$mod}; } else { $br->{$mod} = $tr->{$mod}; } } } unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; my $pp = $WriteMakefileArgs{PREREQ_PM}; for my $mod ( keys %$br ) { if ( exists $pp->{$mod} ) { $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; } else { $pp->{$mod} = $br->{$mod}; } } } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); HTML-FromText-2.07/MANIFEST000644 000766 000766 00000000476 12170515240 015067 0ustar00rjbsrjbs000000 000000 Changes LICENSE MANIFEST META.json META.yml Makefile.PL README bin/text2html dist.ini lib/HTML/FromText.pm t/00-compile.t t/000-report-versions-tiny.t t/01_features.t t/02_v2.01.t t/03_v2.02.t t/04_v2.03.t t/05_v2.04.t t/06_v2.05.t t/99_pod.t t/files/paras.txt xt/release/changes_has_content.t xt/release/pod-syntax.t HTML-FromText-2.07/META.json000644 000766 000766 00000020030 12170515240 015343 0ustar00rjbsrjbs000000 000000 { "abstract" : "converts plain text to HTML", "author" : [ "Ricardo SIGNES ", "Casey West ", "Gareth Rees " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 4.300036, CPAN::Meta::Converter version 2.131560", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "HTML-FromText", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.30" } }, "develop" : { "requires" : { "Test::Pod" : "1.41", "version" : "0.9901" } }, "runtime" : { "requires" : { "Carp" : "0", "Email::Find::addrspec" : "0.09", "Exporter" : "5.58", "HTML::Entities" : "1.26", "Scalar::Util" : "1.12", "Text::Tabs" : "98.1128", "strict" : "0", "warnings" : "0" } }, "test" : { "requires" : { "File::Find" : "0", "File::Spec" : "0", "File::Temp" : "0", "Test::More" : "0.96" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/rjbs/HTML-FromText/issues" }, "homepage" : "https://github.com/rjbs/HTML-FromText", "repository" : { "type" : "git", "url" : "https://github.com/rjbs/HTML-FromText.git", "web" : "https://github.com/rjbs/HTML-FromText" } }, "version" : "2.07", "x_Dist_Zilla" : { "perl" : { "version" : "5.019001" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::Git::GatherDir", "name" : "@RJBS/Git::GatherDir", "version" : "2.014" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@RJBS/CheckPrereqsIndexed", "version" : "0.009" }, { "class" : "Dist::Zilla::Plugin::CheckExtraTests", "name" : "@RJBS/CheckExtraTests", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@RJBS/@Filter/PruneCruft", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@RJBS/@Filter/ManifestSkip", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@RJBS/@Filter/MetaYAML", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@RJBS/@Filter/License", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@RJBS/@Filter/Readme", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@RJBS/@Filter/ExecDir", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@RJBS/@Filter/ShareDir", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "name" : "@RJBS/@Filter/MakeMaker", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@RJBS/@Filter/Manifest", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@RJBS/@Filter/TestRelease", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@RJBS/@Filter/ConfirmRelease", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@RJBS/@Filter/UploadToCPAN", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@RJBS/AutoPrereqs", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "name" : "@RJBS/Git::NextVersion", "version" : "2.014" }, { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "@RJBS/PkgVersion", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@RJBS/MetaConfig", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@RJBS/MetaJSON", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@RJBS/NextRelease", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent", "name" : "@RJBS/Test::ChangesHasContent", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@RJBS/PodSyntaxTests", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "name" : "@RJBS/Test::Compile", "version" : "2.002" }, { "class" : "Dist::Zilla::Plugin::ReportVersions::Tiny", "name" : "@RJBS/ReportVersions::Tiny", "version" : "1.08" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "@RJBS/TestMoreWithSubtests", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "name" : "@RJBS/PodWeaver", "version" : "3.101641" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "@RJBS/GithubMeta", "version" : "0.28" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "name" : "@RJBS/@Git/Check", "version" : "2.014" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "name" : "@RJBS/@Git/Commit", "version" : "2.014" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "name" : "@RJBS/@Git/Tag", "version" : "2.014" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "name" : "@RJBS/@Git/Push", "version" : "2.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "4.300036" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "4.300036" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : "0" }, "version" : "4.300036" } } } HTML-FromText-2.07/META.yml000644 000766 000766 00000012241 12170515240 015200 0ustar00rjbsrjbs000000 000000 --- abstract: 'converts plain text to HTML' author: - 'Ricardo SIGNES ' - 'Casey West ' - 'Gareth Rees ' build_requires: File::Find: 0 File::Spec: 0 File::Temp: 0 Test::More: 0.96 configure_requires: ExtUtils::MakeMaker: 6.30 dynamic_config: 0 generated_by: 'Dist::Zilla version 4.300036, CPAN::Meta::Converter version 2.131560' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: HTML-FromText requires: Carp: 0 Email::Find::addrspec: 0.09 Exporter: 5.58 HTML::Entities: 1.26 Scalar::Util: 1.12 Text::Tabs: 98.1128 strict: 0 warnings: 0 resources: bugtracker: https://github.com/rjbs/HTML-FromText/issues homepage: https://github.com/rjbs/HTML-FromText repository: https://github.com/rjbs/HTML-FromText.git version: 2.07 x_Dist_Zilla: perl: version: 5.019001 plugins: - class: Dist::Zilla::Plugin::Git::GatherDir name: '@RJBS/Git::GatherDir' version: 2.014 - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@RJBS/CheckPrereqsIndexed' version: 0.009 - class: Dist::Zilla::Plugin::CheckExtraTests name: '@RJBS/CheckExtraTests' version: 0.011 - class: Dist::Zilla::Plugin::PruneCruft name: '@RJBS/@Filter/PruneCruft' version: 4.300036 - class: Dist::Zilla::Plugin::ManifestSkip name: '@RJBS/@Filter/ManifestSkip' version: 4.300036 - class: Dist::Zilla::Plugin::MetaYAML name: '@RJBS/@Filter/MetaYAML' version: 4.300036 - class: Dist::Zilla::Plugin::License name: '@RJBS/@Filter/License' version: 4.300036 - class: Dist::Zilla::Plugin::Readme name: '@RJBS/@Filter/Readme' version: 4.300036 - class: Dist::Zilla::Plugin::ExecDir name: '@RJBS/@Filter/ExecDir' version: 4.300036 - class: Dist::Zilla::Plugin::ShareDir name: '@RJBS/@Filter/ShareDir' version: 4.300036 - class: Dist::Zilla::Plugin::MakeMaker name: '@RJBS/@Filter/MakeMaker' version: 4.300036 - class: Dist::Zilla::Plugin::Manifest name: '@RJBS/@Filter/Manifest' version: 4.300036 - class: Dist::Zilla::Plugin::TestRelease name: '@RJBS/@Filter/TestRelease' version: 4.300036 - class: Dist::Zilla::Plugin::ConfirmRelease name: '@RJBS/@Filter/ConfirmRelease' version: 4.300036 - class: Dist::Zilla::Plugin::UploadToCPAN name: '@RJBS/@Filter/UploadToCPAN' version: 4.300036 - class: Dist::Zilla::Plugin::AutoPrereqs name: '@RJBS/AutoPrereqs' version: 4.300036 - class: Dist::Zilla::Plugin::Git::NextVersion name: '@RJBS/Git::NextVersion' version: 2.014 - class: Dist::Zilla::Plugin::PkgVersion name: '@RJBS/PkgVersion' version: 4.300036 - class: Dist::Zilla::Plugin::MetaConfig name: '@RJBS/MetaConfig' version: 4.300036 - class: Dist::Zilla::Plugin::MetaJSON name: '@RJBS/MetaJSON' version: 4.300036 - class: Dist::Zilla::Plugin::NextRelease name: '@RJBS/NextRelease' version: 4.300036 - class: Dist::Zilla::Plugin::Test::ChangesHasContent name: '@RJBS/Test::ChangesHasContent' version: 0.006 - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@RJBS/PodSyntaxTests' version: 4.300036 - class: Dist::Zilla::Plugin::Test::Compile name: '@RJBS/Test::Compile' version: 2.002 - class: Dist::Zilla::Plugin::ReportVersions::Tiny name: '@RJBS/ReportVersions::Tiny' version: 1.08 - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: '@RJBS/TestMoreWithSubtests' version: 4.300036 - class: Dist::Zilla::Plugin::PodWeaver name: '@RJBS/PodWeaver' version: 3.101641 - class: Dist::Zilla::Plugin::GithubMeta name: '@RJBS/GithubMeta' version: 0.28 - class: Dist::Zilla::Plugin::Git::Check name: '@RJBS/@Git/Check' version: 2.014 - class: Dist::Zilla::Plugin::Git::Commit name: '@RJBS/@Git/Commit' version: 2.014 - class: Dist::Zilla::Plugin::Git::Tag name: '@RJBS/@Git/Tag' version: 2.014 - class: Dist::Zilla::Plugin::Git::Push name: '@RJBS/@Git/Push' version: 2.014 - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: 4.300036 - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: 4.300036 - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: 4.300036 - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: 4.300036 - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: 4.300036 - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: 4.300036 zilla: class: Dist::Zilla::Dist::Builder config: is_trial: 0 version: 4.300036 HTML-FromText-2.07/README000644 000766 000766 00000000443 12170515240 014610 0ustar00rjbsrjbs000000 000000 This archive contains the distribution HTML-FromText, version 2.07: converts plain text to HTML This software is copyright (c) 2003 by Casey West. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. HTML-FromText-2.07/t/000755 000766 000766 00000000000 12170515240 014172 5ustar00rjbsrjbs000000 000000 HTML-FromText-2.07/xt/000755 000766 000766 00000000000 12170515240 014362 5ustar00rjbsrjbs000000 000000 HTML-FromText-2.07/xt/release/000755 000766 000766 00000000000 12170515240 016002 5ustar00rjbsrjbs000000 000000 HTML-FromText-2.07/xt/release/changes_has_content.t000644 000766 000766 00000002010 12170515240 022155 0ustar00rjbsrjbs000000 000000 #!perl use Test::More tests => 2; note 'Checking Changes'; my $changes_file = 'Changes'; my $newver = '2.07'; my $trial_token = '-TRIAL'; SKIP: { ok(-e $changes_file, "$changes_file file exists") or skip 'Changes is missing', 1; ok(_get_changes($newver), "$changes_file has content for $newver"); } done_testing; # _get_changes copied and adapted from Dist::Zilla::Plugin::Git::Commit # by Jerome Quelin sub _get_changes { my $newver = shift; # parse changelog to find commit message open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!"; my $changelog = join('', <$fh>); close $fh; my @content = grep { /^$newver(?:$trial_token)?(?:\s+|$)/ ... /^\S/ } # from newver to un-indented split /\n/, $changelog; shift @content; # drop the version line # drop unindented last line and trailing blank lines pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ ); # return number of non-blank lines return scalar @content; } HTML-FromText-2.07/xt/release/pod-syntax.t000644 000766 000766 00000000212 12170515240 020270 0ustar00rjbsrjbs000000 000000 #!perl use Test::More; eval "use Test::Pod 1.41"; plan skip_all => "Test::Pod 1.41 required for testing POD" if $@; all_pod_files_ok(); HTML-FromText-2.07/t/00-compile.t000644 000766 000766 00000003126 12170515240 016226 0ustar00rjbsrjbs000000 000000 #!perl use strict; use warnings; use Test::More; use File::Find; use File::Temp qw{ tempdir }; my @modules; find( sub { return if $File::Find::name !~ /\.pm\z/; my $found = $File::Find::name; $found =~ s{^lib/}{}; $found =~ s{[/\\]}{::}g; $found =~ s/\.pm$//; # nothing to skip push @modules, $found; }, 'lib', ); sub _find_scripts { my $dir = shift @_; my @found_scripts = (); find( sub { return unless -f; my $found = $File::Find::name; # nothing to skip open my $FH, '<', $_ or do { note( "Unable to open $found in ( $! ), skipping" ); return; }; my $shebang = <$FH>; return unless $shebang =~ /^#!.*?\bperl\b\s*$/; push @found_scripts, $found; }, $dir, ); return @found_scripts; } my @scripts; do { push @scripts, _find_scripts($_) if -d $_ } for qw{ bin script scripts }; my $plan = scalar(@modules) + scalar(@scripts); $plan ? (plan tests => $plan) : (plan skip_all => "no tests to run"); { # fake home for cpan-testers # no fake requested ## local $ENV{HOME} = tempdir( CLEANUP => 1 ); like( qx{ $^X -Ilib -e "require $_; print '$_ ok'" }, qr/^\s*$_ ok/s, "$_ loaded ok" ) for sort @modules; SKIP: { eval "use Test::Script 1.05; 1;"; skip "Test::Script needed to test script compilation", scalar(@scripts) if $@; foreach my $file ( @scripts ) { my $script = $file; $script =~ s!.*/!!; script_compiles( $file, "$script script compiles" ); } } } HTML-FromText-2.07/t/000-report-versions-tiny.t000644 000766 000766 00000005023 12170515240 021016 0ustar00rjbsrjbs000000 000000 use strict; use warnings; use Test::More 0.88; # This is a relatively nice way to avoid Test::NoWarnings breaking our # expectations by adding extra tests, without using no_plan. It also helps # avoid any other test module that feels introducing random tests, or even # test plans, is a nice idea. our $success = 0; END { $success && done_testing; } # List our own version used to generate this my $v = "\nGenerated by Dist::Zilla::Plugin::ReportVersions::Tiny v1.08\n"; eval { # no excuses! # report our Perl details my $want = "any version"; $v .= "perl: $] (wanted $want) on $^O from $^X\n\n"; }; defined($@) and diag("$@"); # Now, our module version dependencies: sub pmver { my ($module, $wanted) = @_; $wanted = " (want $wanted)"; my $pmver; eval "require $module;"; if ($@) { if ($@ =~ m/Can't locate .* in \@INC/) { $pmver = 'module not found.'; } else { diag("${module}: $@"); $pmver = 'died during require.'; } } else { my $version; eval { $version = $module->VERSION; }; if ($@) { diag("${module}: $@"); $pmver = 'died during VERSION check.'; } elsif (defined $version) { $pmver = "$version"; } else { $pmver = ''; } } # So, we should be good, right? return sprintf('%-45s => %-10s%-15s%s', $module, $pmver, $wanted, "\n"); } eval { $v .= pmver('Carp','any version') }; eval { $v .= pmver('Email::Find::addrspec','0.09') }; eval { $v .= pmver('Exporter','5.58') }; eval { $v .= pmver('ExtUtils::MakeMaker','6.30') }; eval { $v .= pmver('File::Find','any version') }; eval { $v .= pmver('File::Spec','any version') }; eval { $v .= pmver('File::Temp','any version') }; eval { $v .= pmver('HTML::Entities','1.26') }; eval { $v .= pmver('Scalar::Util','1.12') }; eval { $v .= pmver('Test::More','0.96') }; eval { $v .= pmver('Test::Pod','1.41') }; eval { $v .= pmver('Text::Tabs','98.1128') }; eval { $v .= pmver('strict','any version') }; eval { $v .= pmver('version','0.9901') }; eval { $v .= pmver('warnings','any version') }; # All done. $v .= <<'EOT'; Thanks for using my code. I hope it works for you. If not, please try and include this output in the bug report. That will help me reproduce the issue and solve your problem. EOT diag($v); ok(1, "we really didn't test anything, just reporting data"); $success = 1; # Work around another nasty module on CPAN. :/ no warnings 'once'; $Template::Test::NO_FLUSH = 1; exit 0; HTML-FromText-2.07/t/01_features.t000644 000766 000766 00000017041 12170515240 016500 0ustar00rjbsrjbs000000 000000 BEGIN { use Test::More qw[no_plan]; use_ok 'HTML::FromText'; } use strict; use warnings; my $t2h = HTML::FromText->new; isa_ok( $t2h, 'HTML::FromText', 'default' ); my $html = $t2h->parse( '<>' ); cmp_ok( $html, 'eq', '<>', 'metachars encoded <> correctly' ); $t2h = HTML::FromText->new({underline => 1}); $html = $t2h->parse( '_underline_' ); cmp_ok( $html, 'eq', 'underline', 'underline did' ); $t2h = HTML::FromText->new({underline => 1}); $html = $t2h->parse( "_should\nnot_" ); cmp_ok( $html, 'eq', "_should\nnot_", 'underline should not across lines' ); $t2h = HTML::FromText->new({bold => 1}); $html = $t2h->parse( '*bold*' ); cmp_ok( $html, 'eq', 'bold', 'bold did' ); $t2h = HTML::FromText->new({urls => 1}); $html = $t2h->parse( 'http://example.com' ); cmp_ok( $html, 'eq', 'http://example.com', 'urls did' ); $t2h = HTML::FromText->new({urls => 1}); $html = $t2h->parse( 'http://example.com/?foo=bar&baz=quux' ); cmp_ok( $html, 'eq', 'http://example.com/?foo=bar&baz=quux', 'urls and metachars did' ); $t2h = HTML::FromText->new({email => 1}); $html = $t2h->parse( 'casey@geeknest.com' ); cmp_ok( $html, 'eq', 'casey@geeknest.com', 'email did' ); $t2h = HTML::FromText->new({pre => 1}); $html = $t2h->parse( 'pre' ); cmp_ok( $html, 'eq', '
pre
', 'pre did' ); $t2h = HTML::FromText->new({lines => 1}); $html = $t2h->parse( "one\ntwo" ); cmp_ok( $html, 'eq', qq[
one
\ntwo
], 'lines did' ); $t2h = HTML::FromText->new({lines => 1,spaces => 1}); $html = $t2h->parse( "one\n two" ); cmp_ok( $html, 'eq', qq[
one
\n two
], 'lines and spaces did' ); $t2h = HTML::FromText->new({paras => 1}); $html = $t2h->parse( <<__TEXT__ ); One __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'one paragraph' );

One

__HTML__ $t2h = HTML::FromText->new({paras => 1}); $html = $t2h->parse( <<__TEXT__ ); One Two __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'two paragraphs' );

One

Two

__HTML__ $t2h = HTML::FromText->new({paras => 1, bullets => 1}); $html = $t2h->parse( <<__TEXT__ ); * One * Two __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'single bullet list' );
  • One
  • Two
__HTML__ $t2h = HTML::FromText->new({paras => 1, bullets => 1}); $html = $t2h->parse( <<__TEXT__ ); - One - Half - Two __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'nested bullet list' );
  • One
    • Half
  • Two
__HTML__ $t2h = HTML::FromText->new({paras => 1, bullets => 1, bold => 1}); $html = $t2h->parse( <<__TEXT__ ); * One * Half * Whole * Shabang Dude * Two *Normal* Text __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'nested bullets and normal paragraph' );
  • One
    • Half
    • Whole
      • Shabang Dude
  • Two

Normal Text

__HTML__ $t2h = HTML::FromText->new({paras => 1, numbers => 1}); $html = $t2h->parse( <<__TEXT__ ); 1 One 1 Half 2 Whole 1 Shabang Dude 2 Two Normal Text __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'nested numbers and normal paragraph' );
  1. One
    1. Half
    2. Whole
      1. Shabang Dude
  2. Two

Normal Text

__HTML__ $t2h = HTML::FromText->new({paras => 1, headings => 1}); $html = $t2h->parse( <<__TEXT__ ); 1. One Normal Text 1.1. Sub section 2. Second Top __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'headings' );

1. One

Normal Text

1.1. Sub section

2. Second Top

__HTML__ $t2h = HTML::FromText->new({paras => 1, title => 1}); $html = $t2h->parse( <<__TEXT__ ); Title Normal Text __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'title' );

Title

Normal Text

__HTML__ $t2h = HTML::FromText->new({paras => 1, blockparas => 1}); $html = $t2h->parse( <<__TEXT__ ); Test __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'blockparas' );

Test

__HTML__ $t2h = HTML::FromText->new({paras => 1, blockquotes => 1}); $html = $t2h->parse( <<__TEXT__ ); Test This __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'blockquotes' );
Test
This
__HTML__ $t2h = HTML::FromText->new({paras => 1, blockcode => 1}); $html = $t2h->parse( <<__TEXT__ ); Test This Please __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'blockcode' );
Test
This Please
__HTML__ $t2h = HTML::FromText->new({paras => 1, tables => 1}); $html = $t2h->parse( <<__TEXT__ ); Casey West Daddy Chastity West Mommy Evelina West Baby __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'tables' );
Casey WestDaddy
Chastity WestMommy
Evelina WestBaby
__HTML__ $t2h = HTML::FromText->new({paras => 1, tables => 1}); $html = $t2h->parse( <<__TEXT__ ); Chastity West Mommy Casey West Daddy __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'indented tables' );
Chastity WestMommy
Casey WestDaddy
__HTML__ $t2h = HTML::FromText->new({paras => 1, tables => 1}); $html = $t2h->parse( <<__TEXT__ ); Chastity West Mommy Casey West Daddy __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'should not be table' );

Chastity West Mommy Casey West Daddy

__HTML__ $t2h = HTML::FromText->new({paras => 1, tables => 1}); $html = $t2h->parse( <<__TEXT__ ); Casey West Daddy Tall Chastity West Mommy Short Normal Text. __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'indented tables with normal para' );
Casey WestDaddyTall
Chastity WestMommyShort

Normal Text.

__HTML__ $t2h = HTML::FromText->new({paras => 1, tables => 1}); $html = $t2h->parse( <<__TEXT__ ); http://www.pm.org Perl Mongers http://perl.com O'Reilly Perl Center http://lists.perl.org List of Mailing Lists http://use.perl.org Perl News and Community Journals http://perl.apache.org mod_perl http://theperlreview.com The Perl Review __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'indented tables with normal para' );
http://www.pm.orgPerl Mongers
http://perl.comO'Reilly Perl Center
http://lists.perl.orgList of Mailing Lists
http://use.perl.orgPerl News and Community Journals
http://perl.apache.orgmod_perl
http://theperlreview.comThe Perl Review
__HTML__ HTML-FromText-2.07/t/02_v2.01.t000644 000766 000766 00000012033 12170515240 015425 0ustar00rjbsrjbs000000 000000 use Test::More qw[no_plan]; use_ok( 'HTML::FromText' ); my $html = text2html( <<__TEXT__, paras => 1, bullets => 1, bold => 1 ); * An article on *how* to do test... --- *With C/C++* __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'mixing bullets should not work' );
  • An article on how to do test... ---

With C/C++

__HTML__ $html = text2html( <<__TEXT__, paras => 1, urls => 1 ); http://example.com/i-ndex.html#test __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'url with hash' );

http://example.com/i-ndex.html#test

__HTML__ $html = text2html( <<__TEXT__, paras => 1, underline => 1 ); mod_perl/mod_ssl _foo_ _foo_. __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'complex underlines' );

mod_perl/mod_ssl

foo

foo.

__HTML__ $html = text2html( <<__TEXT__, paras => 1, bold => 1 ); foo*foo*foo *foo* *foo*. __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'complex bolds' );

foo*foo*foo

foo

foo.

__HTML__ $html = text2html( <<__TEXT__, paras => 1, bullets => 1 ); * Fast, powerful and extensible template processing system. * Powerful presentation language supports all standard templating directives, e.g. variable substitution, includes, conditionals, loops. * Many additional features such as output filtering, exception handling, macro definition, support for plugin objects, definition of template metadata, embedded Perl code (only enabled by EVAL_PERL option), definition of template blocks, a 'switch' statement, and more. * Full support for complex Perl data types such as hashes, lists, objects and sub-routine references. * Clear separation of concerns between user interface (templates), application code (Perl objects/sub-routines) and data (Perl data). * Programmer-centric back end, allowing application logic and data structures to be built in Perl. * Designer-centric front end, hiding underlying complexity behind simple variable access. * Templates are compiled to Perl code for maximum runtime efficiency and performance. Compiled templates are cached and can be written to disk in "compiled form" (e.g. Perl code) to achieve cache persistance. * Well suited to online dynamic web content generation (e.g. Apache/mod_perl). * Also has excellent support for offline batch processing for generating static pages (e.g. HTML, POD, LaTeX, PostScript, plain text) from source templates. * Comprehensive documentation including tutorial and reference manuals. * Fully Open Source and Free __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'complex bullets' );
  • Fast, powerful and extensible template processing system.
    • Powerful presentation language supports all standard templating directives, e.g. variable substitution, includes, conditionals, loops.
      • Many additional features such as output filtering, exception handling, macro definition, support for plugin objects, definition of template metadata, embedded Perl code (only enabled by EVAL_PERL option), definition of template blocks, a 'switch' statement, and more.
      • Full support for complex Perl data types such as hashes, lists, objects and sub-routine references.
    • Clear separation of concerns between user interface (templates), application code (Perl objects/sub-routines) and data (Perl data).
      • Programmer-centric back end, allowing application logic and data structures to be built in Perl.
      • Designer-centric front end, hiding underlying complexity behind simple variable access.
      • Templates are compiled to Perl code for maximum runtime efficiency and performance. Compiled templates are cached and can be written to disk in "compiled form" (e.g. Perl code) to achieve cache persistance.
        • Well suited to online dynamic web content generation (e.g. Apache/mod_perl).
        • Also has excellent support for offline batch processing for generating static pages (e.g. HTML, POD, LaTeX, PostScript, plain text) from source templates.
          • Comprehensive documentation including tutorial and reference manuals.
          • Fully Open Source and Free
__HTML__ HTML-FromText-2.07/t/03_v2.02.t000644 000766 000766 00000001161 12170515240 015427 0ustar00rjbsrjbs000000 000000 use Test::More; my $script = 'blib/script/text2html'; $script = 'bin/text2html' unless -e $script; plan 'no_plan'; open T2H, "$^X -Iblib/lib $script --paras t/files/paras.txt |" or die $!; undef $/; my $html = ; close T2H; cmp_ok( $html, 'eq', <<__HTML__, 'output from text2html correct' );

Hello

Test

__HTML__ use_ok 'HTML::FromText'; $html = text2html( <<__TEXT__, paras => 1, blockcode => 1 ); Foo Bar __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'blockcode should preserve spaces' );
Foo Bar
__HTML__ HTML-FromText-2.07/t/04_v2.03.t000644 000766 000766 00000006323 12170515240 015436 0ustar00rjbsrjbs000000 000000 use Test::More 'no_plan'; use_ok 'HTML::FromText'; $html = text2html( <<__TEXT__, paras => 1, blockcode => 1 ); Foo Bar __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'blockcode should use pre' );
Foo Bar
__HTML__ $html = text2html( <<__TEXT__, paras => 1, blockparas => 1 ); Foo Bar __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'blockparas should use p' );

Foo Bar

__HTML__ $html = text2html( <<__TEXT__, paras => 1, blockquotes => 1 ); Foo Bar __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'blockquotes should use div' );
Foo Bar
__HTML__ $html = text2html( <<__TEXT__, paras => 1, tables => 1 ); Perl Command Line Casey West Introduction to CPAN Testing Adam J. Foxson Parsing JavaScript David Hand Test Better with Test::More Casey West Creating a Template Toolkit Plugin Chris Winters GD::SIRDS David Hand __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'table should work' );
Perl Command LineCasey West
Introduction to CPAN TestingAdam J. Foxson
Parsing JavaScriptDavid Hand
Test Better with Test::MoreCasey West
Creating a Template Toolkit PluginChris Winters
GD::SIRDSDavid Hand
__HTML__ $html = text2html( <<__TEXT__, paras => 1, tables => 1 ); *01.08.2003* 19:00 Robot Club http://pgh.pm.org/m/200301.html *02.12.2003* 19:00 Lightning Talks http://pgh.pm.org/m/200302.html *03.12.2003* 19:00 Social Gathering http://pgh.pm.org/m/200303.html *04.09.2003* 19:00 Technical Meeting http://pgh.pm.org/m/200304.html *05.14.2003* 19:00 Social Gathering http://pgh.pm.org/m/200305.html *06.14.2003* 11:00 /burgh?/ Meetup http://pgh.pm.org/m/200306.html *07.09.2003* 19:00 Social Meeting http://pgh.pm.org/m/200307.html *08.13.2003* 19:00 Technical Meeting http://pgh.pm.org/m/200308.html __TEXT__ cmp_ok( $html, 'eq', <<__HTML__, 'table should work' );
*01.08.2003*19:00Robot Clubhttp://pgh.pm.org/m/200301.html
*02.12.2003*19:00Lightning Talkshttp://pgh.pm.org/m/200302.html
*03.12.2003*19:00Social Gatheringhttp://pgh.pm.org/m/200303.html
*04.09.2003*19:00Technical Meetinghttp://pgh.pm.org/m/200304.html
*05.14.2003*19:00Social Gatheringhttp://pgh.pm.org/m/200305.html
*06.14.2003*11:00/burgh?/ Meetuphttp://pgh.pm.org/m/200306.html
*07.09.2003*19:00Social Meetinghttp://pgh.pm.org/m/200307.html
*08.13.2003*19:00Technical Meetinghttp://pgh.pm.org/m/200308.html
__HTML__ HTML-FromText-2.07/t/05_v2.04.t000644 000766 000766 00000000065 12170515240 015435 0ustar00rjbsrjbs000000 000000 use Test::More tests => 1; use_ok 'HTML::FromText'; HTML-FromText-2.07/t/06_v2.05.t000644 000766 000766 00000001143 12170515240 015435 0ustar00rjbsrjbs000000 000000 use Test::More qw[no_plan]; use_ok 'HTML::FromText'; my $html = text2html( <<'__TEXT__', paras => 1, blockcode => 1 ); my $who = "World"; print "Hello, $who!\n"; __TEXT__ cmp_ok( $html, 'eq', <<'__HTML__', 'blockcode consolidated' );
my $who = "World";

print "Hello, $who!\n";
__HTML__ $html = text2html( <<'__TEXT__', paras => 1, blockparas => 1 ); Hello World __TEXT__ cmp_ok( $html, 'eq', <<'__HTML__', 'blockparas consolidated' );

Hello

World

__HTML__ HTML-FromText-2.07/t/99_pod.t000644 000766 000766 00000001261 12170515240 015462 0ustar00rjbsrjbs000000 000000 # -*- cperl -*- #$Id: 99_pod.t,v 1.1.1.1 2003/09/10 18:29:36 cwest Exp $ =pod Testing that the POD in all the Perl code is formatted correctly. =cut use Test::More; use File::Spec; use File::Find; use strict; eval "use Test::Pod 0.95"; if ($@) { plan skip_all => "Test::Pod v0.95 required for testing POD"; } else { Test::Pod->import; my @files; my $blib = File::Spec->catfile(qw(blib lib)); find( sub { push @files, $File::Find::name if /\.(?:p(?:l|m|od)|t)$/; }, $blib, ( -e 't' && -d _ ? 't' : () ) ); plan tests => scalar @files; foreach my $file (@files) { pod_file_ok($file); } } HTML-FromText-2.07/t/files/000755 000766 000766 00000000000 12170515240 015274 5ustar00rjbsrjbs000000 000000 HTML-FromText-2.07/t/files/paras.txt000644 000766 000766 00000000014 12170515240 017136 0ustar00rjbsrjbs000000 000000 Hello Test HTML-FromText-2.07/lib/HTML/000755 000766 000766 00000000000 12170515240 015241 5ustar00rjbsrjbs000000 000000 HTML-FromText-2.07/lib/HTML/FromText.pm000644 000766 000766 00000050352 12170515240 017354 0ustar00rjbsrjbs000000 000000 use strict; use warnings; package HTML::FromText; { $HTML::FromText::VERSION = '2.07'; } # ABSTRACT: converts plain text to HTML use Email::Find::addrspec 0.09 qw[$Addr_spec_re]; use Exporter 5.58 qw[import]; use HTML::Entities 1.26 qw[encode_entities]; use Scalar::Util 1.12 qw[blessed]; use Text::Tabs 98.1128 qw[expand]; our @EXPORT = qw[text2html]; our @DECORATORS = qw[urls email bold underline]; our $PROTOCOLS = qr/ afs | cid | ftp | gopher | http | https | mid | news | nntp | prospero | telnet | wais /x; sub new { my ($class, $options) = @_; $options ||= {}; $class->_croak("Options must be a hash reference") if ref($options) ne 'HASH'; my %options = ( metachars => 1, urls => 0, email => 0, bold => 0, underline => 0, pre => 0, lines => 0, spaces => 0, paras => 0, bullets => 0, numbers => 0, headings => 0, title => 0, blockparas => 0, blockquotes => 0, blockcode => 0, tables => 0, %{ $options }, ); my %self = ( options => \%options, text => '', html => '', ); return bless \%self, blessed($class) || $class; } sub parse { my ($self, $text) = @_; $text = join "\n", expand( split /\n/, $text ); $self->{text} = $text; $self->{html} = $text; $self->{paras} = undef; my $options = $self->{options}; $self->metachars if $options->{metachars}; if ( $options->{pre} ) { $self->pre } elsif ( $options->{lines} ) { $self->lines } elsif ( $options->{paras} ) { $self->paras } $options->{$_} and $self->$_ foreach @DECORATORS; return $self->{html}; } sub text2html { my ($text, %options) = @_; HTML::FromText->new(\%options)->parse($text); } sub pre { my ($self) = @_; $self->{html} = join $self->{html}, '
', '
'; } sub lines { my ($self) = @_; $self->{html} =~ s[ ][ ]g if $self->{options}->{spaces}; $self->{html} =~ s[$][
]gm; $self->{html} =~ s[^][
]; $self->{html} =~ s[$][
]; } sub paras { my ($self) = @_; my $options = $self->{options}; my @paras = split /\n{2,}/, $self->{html}; my %paras = map { $_, { text => $paras[$_], html => undef } } 0 .. $#paras; $self->{paras} = \%paras; $self->{paras}->{0}->{html} = join( $self->{paras}->{0}->{text}, q[

], "

\n" ) if $options->{title}; $self->headings if $options->{headings}; $self->bullets if $options->{bullets}; $self->numbers if $options->{numbers}; $self->tables if $options->{tables}; if ( $options->{blockparas} ) { $self->blockparas } elsif ( $options->{blockquotes} ) { $self->blockquotes } elsif ( $options->{blockcode} ) { $self->blockcode } $self->_manipulate_paras(sub { qq[

$_[0]

\n] }); $self->{html} = join "\n", map $paras{$_}->{html}, sort { $a <=> $b } keys %paras; } sub headings { my ($self) = @_; my $heading = qr/\d+\./; $self->_manipulate_paras(sub{ my ($text) = @_; return unless $text =~ m[^((?:$heading)+)\s+]; my $depth; $depth++ for split /\./, $1; qq[$text\n]; }); } sub bullets { my ($self) = @_; $self->_format_list( qr/[*]/, 'ul', 'hft-bullets' ); $self->_format_list( qr/[-]/, 'ul', 'hft-bullets' ); } sub numbers { my ($self) = @_; $self->_format_list( qr/[0-9]/, 'ol', 'hft-numbers'); } sub tables { my ($self) = @_; $self->_manipulate_paras(sub{ my ($text) = $self->_remove_indent( $_[0] ); my @lines = split /\n/, $text; my $columns = $self->_table_find_columns( $self->_table_initial_spaces( split //, $lines[0] ), [ @lines[1 .. $#lines] ], ); return unless $columns; $self->_table_create( $columns, \@lines ); }); } sub blockparas { my ($self) = @_; my $paras = $self->{paras}; $self->_manipulate_paras(sub{ my ($text) = $self->_remove_indent( $_[0], 1 ); my ($pnum, $paras) = @_[1,2]; return unless $text; $self->_consolidate_blocks( ( exists $paras->{$pnum - 1} ? $paras->{$pnum -1} : undef ), 'blockparas', 1, qq[

$text

\n], ); }); } sub blockquotes { my ($self) = @_; my $paras = $self->{paras}; $self->_manipulate_paras(sub { my ($text) = $self->_remove_indent( $_[0], 1 ); return unless $text; $text =~ s[\n|$][
\n]g; qq[
$text
\n]; }); } sub blockcode { my ($self) = @_; my $paras = $self->{paras}; $self->_manipulate_paras(sub { my ($text) = $self->_remove_indent( $_[0], 1 ); my ($pnum, $paras) = @_[1,2]; return unless $text; $text =~ s[^][
];
        $text =~ s[$][
]; $self->_consolidate_blocks( ( exists $paras->{$pnum - 1} ? $paras->{$pnum -1} : undef ), 'blockcode', 0, qq[
$text
\n], ); }); } sub urls { my ($self) = @_; $self->{html} =~ s[\b((?:$PROTOCOLS):[^\s<]+[\w/])] [$1]og; } sub email { my ($self) = @_; $self->{html} =~ s[($Addr_spec_re)] [$1]og; } sub underline { my ($self) = @_; $self->{html} =~ s[(?:^|(?<=\W))((_)([^\\_\n]*(?:\\.[^\\_\n]*)*)(_))(?:(?=\W)|$)] [$3]g; } sub bold { my ($self) = @_; $self->{html} =~ s[(?:^|(?<=\W))((\*)([^\\\*\n]*(?:\\.[^\\\*\n]*)*)(\*))(?:(?=\W)|$)] [$3]g; } sub metachars { my ($self) = @_; $self->{html} = encode_entities( $self->{html} ); } # private sub _croak { my ($class, @error) = @_; require Carp; Carp::croak(@error); } sub _carp { my ($class, @error) = @_; require Carp; Carp::carp(@error); } sub _format_list { my ($self, $identifier, $parent, $class) = @_; $self->_manipulate_paras(sub { my ($text) = @_; return unless $text =~ m[^\s*($identifier)\s+]; my ($pos, $html, @open) = (-1, ''); foreach my $line ( split /\n(?=\s*$identifier)/, $text ) { $line =~ s[(\s*)$identifier][]; my $line_pos = length $1; if ($line_pos > $pos) { $html .= (' ' x $line_pos) . qq[<$parent class="$class">\n]; push @open, $line_pos; } elsif ($line_pos < $pos) { until ( $open[-1] <= $line_pos ) { $html .= (' ' x pop @open) . "\n"; } } $html .= (' ' x ($pos = $line_pos)) . "
  • $line
  • \n"; } $html .= "\n"x@open; }); } sub _manipulate_paras { my ($self, $action) = @_; my $paras = $self->{paras}; foreach my $pnum ( sort { $a <=> $b } keys %{$paras}) { my $para = $paras->{$pnum}; $para->{html} = $action->($para->{text}, $pnum, $paras) unless $para->{html}; } } sub _table_initial_spaces { my ($self, @chars) = @_; my %spaces; foreach ( 0 .. $#chars ) { my ($open_space) = grep { !defined( $_->{end} ) } values %spaces; if ( $chars[$_] eq ' ' ) { $spaces{$_} = {start => $_, end => undef} unless $open_space; } else { if ( $open_space && $_ - $open_space->{start} > 1 ) { $open_space->{end} = $_ - 1; } else { delete $spaces{$open_space->{start}} if $open_space; } } } return \%spaces; } sub _table_find_columns { my ($self, $spaces, $lines) = @_; return unless keys %{$spaces}; my %spots; foreach my $line ( @{$lines} ) { foreach my $pos ( sort { $a <=> $b } keys %{$spaces} ) { my $key; $key = $spaces->{$pos}->{start} if substr( $line, $spaces->{$pos}->{start}, 1 ) eq ' '; $key = $spaces->{$pos}->{end} if substr( $line, $spaces->{$pos}->{end}, 1 ) eq ' ' && ! $key; if ( $key ) { $spots{$key}++; $spots{$spaces->{$pos}->{start}}++ if $spots{$spaces->{$pos}->{start}} && $key ne $spaces->{$pos}->{start}; $spots{$spaces->{$pos}->{end}}++ if $key ne $spaces->{$pos}->{end}; } else { delete $spaces->{$pos}; } } foreach my $spot (sort {$b <=> $a} keys %spots) { if ( substr( $line, $spot, 1 ) ne ' ' ) { delete $spots{$spot}; } if ( exists $spaces->{$spot}) { my $space = $spaces->{$spot}; if ( exists $spots{$space->{start}} && $spots{$space->{end}}) { delete $spots{$spot}; } } } } my @spots = grep { $spots{$_} == @{$lines} } sort { $a <=> $b } keys %spots; return @spots ? join( '', ( map { my $ret = 'A' . ( $spots[$_] - ( $_ == 0 ? 0 : $spots[$_ - 1] ) ); $ret eq 'A0' ? () : $ret; } 0 .. $#spots ), 'A*' ) : undef; } sub _table_create { my ($self, $columns, $lines) = @_; my $table = qq[\n]; foreach my $line ( @{$lines} ) { $table .= join( '', ' \n", ); } $table .= "
    ', join( '', map { s/^\s+//; s/\s$//; $_ } unpack $columns, $line ), "
    \n"; } sub _remove_indent { my ($self, $text, $strict) = @_; return if $text !~ m[^(\s+).+(?:\n\1.+)*$] && $strict; $text =~ s[^$1][]mg if $1; return $text; } sub _consolidate_blocks { my ($self, $prev_para, $class, $keep_inner, $html) = @_; if ( $prev_para && $prev_para->{html} =~ m[
    <(\w+)>] ) { my $inner_tag = $keep_inner ? '' : qr[]; $prev_para->{html} =~ s[$inner_tag
    ][]; $html =~ s[
    $inner_tag][]; } return $html; } 1; __END__ =pod =head1 NAME HTML::FromText - converts plain text to HTML =head1 VERSION version 2.07 =head1 SYNOPSIS use HTML::FromText; text2html( $text, %options ); # or use HTML::FromText (); my $t2h = HTML::FromText->new( \%options ); my $html = $t2h->parse( $html ); =head1 DESCRIPTION C converts plain text to HTML. There are a handful of options that shape the conversion. There is a utility function, C, that's exported by default. This function is simply a short- cut to the Object Oriented interface described in detail below. =head1 METHODS =head2 new my $t2h = HTML::FromText->new({ paras => 1, blockcode => 1, tables => 1, bullets => 1, numbers => 1, urls => 1, email => 1, bold => 1, underline => 1, }); Constructs a new C object using the given configuration. The resulting object can parse lots of objects using the C method. Options to C are passed by name, with the value being either true or false. If true, the option will be turned on. If false, it will be turned off. The following outlines all the options. =head4 Decorators =over 5 =item metachars This option is on by default. All characters that are unsafe for HTML display will be encoded using C. =item urls This option is off by default. Replaces URLs with links. =item email This option is off by default. Replaces email addresses with C links. =item bold This option is off by default. Replaces text surrounded by asterisks (C<*>) with the same text surrounded by C tags. =item underline This option is off by default. Replaces text surrownded by underscores (C<_>) with the same text surrounded by C tags with an underline style. =back =head4 Output Modes The following are three output modes and the options associated with them. They are listed in order of precidence. If none of these modes are supplied, the basic decorators are applied to the text in whole. =over 5 =item B
    
    This option is off by default.
    
    Wraps the entire text in C
     tags.
    
    =item B
    
    This option is off by default.
    
    Preserves line breaks by inserting C
    tags at the end of each line. This mode has further options. =over 5 =item spaces This option is off by default. All spaces are HTML encoded. =back =item B This option is off by default. Preserves paragraphs by wrapping them in C

    tags. This mode has further options. =over 5 =item bullets This option is off by default. Convert bulleted lists into unordered lists (C

      ). Bullets can be either an asterisk (C<*>) or a hyphen (C<->). Lists can be nested. =item numbers This option is off by default. Convert numbered lists into ordered lists (C
        ). Numbered lists are identified by numerals. Lists may be nested. =item headings This option is off by default. Convert paragraphs identified as headings into HTML headings at the appropriate level. The heading C<1. Top> would be heading level one (C

        ). The heading C<2.5.1. Blah> would be heading level three (C

        ). =item title This option is off by default. Convert the first paragraph to a heading level one (C

        ). =item tables This option is off by default. Convert paragraphs identified as tables to HTML tables. Tables are two or more rows and two or more columns. Columns should be separated by two or more spaces. =back The following options apply specifically to indented paragraphs. They are listed in order of precidence. =over 5 =item blockparas This option is off by default. Convert indented paragraphs to block quotes using the C
        tag. =item blockquotes Convert indented paragraphs as C would, but also preserving line breaks. =item blockcode Convert indented paragraphs as C would, but also preserving spaces using C
         tags.
        
        =back
        
        =back
        
        =head2 parse
        
          my $html = $t2h->parse( $text );
        
        Parses text supplied as a single scalar string and returns the HTML as a
        single scalar string.  All the tabs in your text will be expanded using
        C.
        
        =head1 FUNCTIONS
        
        =head2 text2html
        
            my $html = text2html(
                                 $text,
                                 urls  => 1,
                                 email => 1,
                                );
        
        Functional interface that just wraps the OO interface. This function is
        exported by default. If you don't want it you can C the module
        or C it with an empty list.
        
            require HTML::FromText;
            # or ...
            use HTML::FromText ();
        
        =head2 Subclassing
        
        B At the time of this release, the internals of C
        are in a state of development and cannot be expected to stay the same
        from release to release. I expect that release version B<3.00> will be
        analogous to a C<1.00> release of other software. This is because the
        current maintainer has rewritten this distribution from the ground up
        for the C<2.x> series.  You have been warned.
        
        The following methods may be used for subclassing C
        to create your own text to HTML conversions. Each of these methods
        is passed just one argument, the object (C<$self>), unless
        otherwise stated.
        
        The structure of C<$self> is as follows for this release.
        
            {
             options => {
                         option_name => $value,
                         ...
                        },
             text    => $text, # as passed to parse(), with tabs expanded
             html    => $html, # the HTML that will be returned from parse()
            }
        
        =head3 pre
        
        Used when C
         mode is specified.
        
        Should set C<< $self->{html} >>.
        
        Return value is ignored.
        
        =head3 lines
        
        Used when C mode is specified.
        
        Implements the C option internally when the option is set to a
        true value.
        
        Should set C<< $self->{html} >>.
        
        Return value is ignored.
        
        =head3 paras
        
        Used when the C mode is specified.
        
        Splits C<< $self->{text} >> into paragraphs internally and sets up
        C<< $self->{paras} >> as follows.
        
            paras => {
                      0 => {
                            text => $text, # paragraph text
                            html => $html, # paragraph html
                           },
                      ... # and so on for all paragraphs
                     },
        
        Implements the C option internally when the option is turned on.
        
        Converts any normal paragraphs to HTML paragraphs (surrounded by C<p>
        tags) internally.
        
        Should set C<< $self->{html} >>.
        
        Return value is ignored.
        
        =head3 headings
        
        Used to format headings when the C<headings> option is turned on.
        
        Return value is ignored.
        
        =head3 bullets
        
        Format bulleted lists when the C<bullets> option is turned on.
        
        Return value is ignored.
        
        =head3 numbers
        
        Format numbered lists when the C<numbers> option is turned on.
        
        Return value is ignored.
        
        =head3 tables
        
        Format tables when the C<tables> option is turned on.
        
        Return value is ignored.
        
        =head3 blockparas
        
        Used when the C<blockparas> option is turned on.
        
        Return value is ignored.
        
        =head3 blockquotes
        
        Used when the C<blockquotes> option is turned on.
        
        Return value is ignored.
        
        =head3 blockcode
        
        Used when the C<blockcode> option is turned on.
        
        Return value is ignored.
        
        =head3 urls
        
        Turn urls into links when C<urls> option is turned on.
        
        Should operate on C<< $self->{html} >>.
        
        Return value is ignored.
        
        =head3 email
        
        Turn email addresses into C<mailto:> links when C<email> option is
        turned on.
        
        Should operate on C<< $self->{html} >>.
        
        Return value is ignored.
        
        =head3 underline
        
        Underline things between _underscores_ when C<underline> option is
        turned on.
        
        Should operate on C<< $self->{html} >>.
        
        Return value is ignored.
        
        =head3 bold
        
        Bold things between *asterisks* when C<bold> option is turned on.
        
        Should operate on C<< $self->{html} >>.
        
        Return value is ignored.
        
        =head3 metachars
        
        Encode meta characters when C<metachars> option is turned on.
        
        Should operate on C<< $self->{html} >>.
        
        Return value is ignored.
        
        =head2 Output
        
        The output from C<HTML::FromText> has been updated to pass XHTML 1.1
        validation. Every HTML tag that should have a CSS class name does. They
        are prefixed with C<hft-> and correspond to the names of the options to
        C<new()> (or C<text2html()>). For example C<hft-lines>, C<hft-paras>,
        and C<hft-urls>.
        
        One important note is the output for C<underline>. Because the <u> tag
        is deprecated in this specification a C<span> is used with a style
        attribute of C<text-decoration: underline>. The class is C<hft-
        underline>. If you want to override the C<text-decoration> style in the
        CSS class you'll need to do so like this.
        
            text-decoration: none !important;
        
        =head1 SEE ALSO
        
        L<text2html(1)>.
        
        =head1 AUTHORS
        
        =over 4
        
        =item *
        
        Ricardo SIGNES <rjbs@cpan.org>
        
        =item *
        
        Casey West <casey@geeknest.com>
        
        =item *
        
        Gareth Rees <garethr@cre.canon.co.uk>
        
        =back
        
        =head1 COPYRIGHT AND LICENSE
        
        This software is copyright (c) 2003 by Casey West.
        
        This is free software; you can redistribute it and/or modify it under
        the same terms as the Perl 5 programming language system itself.
        
        =cut
        ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������HTML-FromText-2.07/bin/text2html��������������������������������������������������������������������000755 �000766 �000766 �00000003763 12170515240 016371� 0����������������������������������������������������������������������������������������������������ustar�00rjbs����������������������������rjbs����������������������������000000 �000000 ������������������������������������������������������������������������������������������������������������������������������������������������������������������������#!/usr/bin/perl
        # -*- cperl -*-
        use HTML::FromText;
        # PODNAME:  text2html
        # ABSTRACT: convert plain text to HTML
        
        my %options, @files;
        
        my $options_done = 0;
        while ( $_ = shift @ARGV ) {
            if ( /^--\w/ && ! $options_done ) {
                s/^--//;
                my ($option, $val) = split /=/, $_, 2;
                $val = 1 unless defined $val;
                $options{$option} = $val;
            } elsif ( /^--$/ ) {
                $options_done = 1;
            } else {
                push @files, $_;
            }
        }
        
        @ARGV = @files;
        
        my $html = text2html
          do {undef $/; <>},
          %options;
        
        $html .= "\n" unless $html =~ /\n$/;
        
        print $html;
        
        exit 0;
        
        __END__
        
        =pod
        
        =head1 NAME
        
        text2html - convert plain text to HTML
        
        =head1 VERSION
        
        version 2.07
        
        =head1 SYNOPSIS
        
        B<text2html [options...]> [file ...]
        
        =head1 DESCRIPTION
        
        The C<text2html> utility converts text to HTML. Text can come from
        standard input or files listed on the command line.
        
        The available options are outlined in L<HTML::FromText>. The option
        syntax is slightly different. Options are prefixed with two dashes
        (C<-->) and may have an option value following an equals sign (C<=>).
        The default value is on (<1>).
        
        =head1 EXAMPLES
        
        Convert the C<README> file using C<paras> and C<blockcode>.
        
          text2html --paras --blockcode README
        
        Convert a file called C<--stupid-name>.
        
          text2html --paras -- --stupid-name
        
        Convert text on standard input.
        
          text2html --paras --urls --email --bold --underline
        
        Convert text on standard input but turn off C<metachars>.
        
          text2html --metachars=0 --lines
        
        =head1 DIAGNOSTICS
        
        The C<text2html> utility exits 0 on success, and >0 if an error occurs.
        
        =head1 SEE ALSO
        
        L<perl(1)>, L<HTML::FromText(3)>.
        
        =head1 AUTHORS
        
        =over 4
        
        =item *
        
        Ricardo SIGNES <rjbs@cpan.org>
        
        =item *
        
        Casey West <casey@geeknest.com>
        
        =item *
        
        Gareth Rees <garethr@cre.canon.co.uk>
        
        =back
        
        =head1 COPYRIGHT AND LICENSE
        
        This software is copyright (c) 2003 by Casey West.
        
        This is free software; you can redistribute it and/or modify it under
        the same terms as the Perl 5 programming language system itself.
        
        =cut
        �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������