pax_global_header00006660000000000000000000000064135722032400014510gustar00rootroot0000000000000052 comment=6921f6e9e78ba881967b034c310fa1475a894bf1 libpod-markdown-perl-3.200000/000077500000000000000000000000001357220324000157655ustar00rootroot00000000000000libpod-markdown-perl-3.200000/Changes000066400000000000000000000222771357220324000172720ustar00rootroot00000000000000Revision history for Perl extension Pod-Markdown 3.200 2019-10-09T16:36:15Z - Allow local_module_url_prefix to be '' [rt-129865]. - URI Escape the module name in external pod links (introduces dependency on URI::Escape). 3.101 2018-08-06T14:32:38Z - Ensure local_module_url_prefix defaults to current perldoc_url_prefix. 3.100 2018-08-06T02:07:18Z - Add "local_module_url_prefix" and "local_module_re" args to allow pointing links for local modules to another site [rt-120452]. 3.005 2016-03-06T02:51:24Z - Fix pod. 3.004 2016-03-06T02:22:21Z - Leave email addresses () in tact for Markdown to process. Thanks to Andreas Boesen for reporting [rt-112631]. 3.003 2015-09-28T00:29:45Z - Bump Pod::Simple prereq to fix bugs that were causing test failures. - Use Pod::Simple's nbsp_for_S(1) by default instead of handling S<> sequences internally. This means the feature can now also be disabled if desired. - Portability improvements for non-ascii platforms. 3.002 2015-08-21T03:24:24Z - Add attribution to changelog. 3.001 2015-08-21T03:17:57Z - Increase Pod::Simple requirement to 3.26 for detected_encoding(). Thanks to Lee J for reporting! (gh-15). 3.000 2015-08-16T21:55:14Z [Bug Fixes] - Literal ampersands and left angle brackets are encoded as html entities when necessary to avoid interpretation as html. http://stackoverflow.com/questions/28496298/escape-angle-brackets-using-podmarkdown [API Changes] - Make accessors read/write (instead of read-only) for consistency with Pod::Simple classes. - Passing unknown arguments to the constructor now produces a warning and in the future may throw an error. - For consistency with the other html-entity changes, NBSP characters (U+00A0) are now used literally for S<> sequences. This also fixes a bug with code spans nested inside of S<> sequences. [New Attributes] - Add `html_encode_chars` attribute to allow customizing what characters should be html entity encoded. - Add `match_encoding` attribute to use the same encoding as the input pod when writing to the output handle. - Add `output_encoding` attribute to specify the desired encoding to apply to the output handle. [pod2markdown script] - Add command line options corresponding to new module attributes. - The script now defaults to UTF-8 encoding if no encoding options are specified. Previous versions did not produce consistent output and would sometimes emit warnings. Closes gh-14 and rt-101536. [Documentation] - Remove documentation for deprecated API (parse_from_file(), parse_from_filehandle(), and as_markdown()) to further discourage use. [New Packages] - Added Pod::Perldoc::ToMarkdown to enable `perldoc -o Markdown ...` Pod::Markdown maintains a backward compatible interface that is incompatible with perldoc's `-o` so this module has been added to enable the functionality. Thanks to Alberto Simões for investigating (gh-12) and providing some code to fix it (gh-13). 2.002 2014-07-05T15:20:40Z - Docs: Add example of command line usage to Synopsis. Thanks, Cindy Wang! 2.001 2014-04-20T02:40:11Z - Use double-asterisk instead of double-underscore for bold Markdown. This allows bold and italic to be nested without confusing parsers. Thanks to Mike Covington for the great pull request (gh-9)! 2.000 2014-02-01T14:38:27Z - Releasing previous (1.99[01]) as stable (now uses Pod::Simple instead of Pod::Parser). See below for changes. 1.991-TRIAL 2014-01-03T04:07:49Z [Test Fixes] - Ignore worthless testing of empty links that fail with Pod::Simple 3.16. 1.990-TRIAL 2014-01-02T14:13:40Z [Enhancements] - Change backend from Pod::Parser to Pod::Simple. Previous documented API has been ported however the Pod::Simple API should be preferred for new code. - Improve escaping of markdown characters. - Accept for/begin 'markdown' and 'html' regions by default. - Represent over/back regions without items as blockquotes. [Backward Incompatible Changes] - E<> codes used to produce equivalent html entities (&foo;). These now simply insert the corresponding unicode character. If you desire alternate behavior please report a bug. - Tabs are now expanded. 1.500 2013-11-22T15:05:31Z - Format url fragments (in links to perldoc sections) according to the destination site (perldoc_url_prefix). This makes links to sections work where they probably never did before. They are also customizable. - Use multiple backticks to delimit code spans that contain literal backticks. 1.401 2013-11-06T05:30:55Z - Require Pod::Parser 1.51 for bug fixes. 1.400 2013-11-05T14:18:19Z [Output Changes] - Change perldoc urls to point to metacpan. [Bug Fixes] - Recognize numbered pod items that do not have a period. Thanks to Yasutaka ATARASHI for the pull request (gh-4). - Remove extraneous blank line between verbatim paragraphs. Thanks to Graham Ollis for the pull request (gh-5). - Do not escape markdown characters inside links (or file paths). Thanks to Taiki Kawakami for the pull request (gh-6). 1.322 2012-11-17T15:51:36Z - Fix incorrect escaping of characters that are inside inline code blocks in headers. Thanks to Peter Vereshagin for the pull req (gh-3). 1.321 2012-10-27T01:23:56Z - Improved list handling including support for ordered (numbered) and nested lists. Thanks to Yasutaka ATARASHI for the pull req (gh-2). 1.320 2012-04-30T23:30:11Z - End markdown output with a newline to be more consistent with... everything. If this causes a problem for you please report it. - Enable pod2markdown to accept file paths as arguments (for both input and output (defaulting to STDIN/STDOUT)). Thanks to Mike Doherty for the suggestion [rt-76726]. 1.301 2012-04-25T03:56:11Z - Fix double-interpolation of list headings which caused escaping of the markdown characters. Thanks to motemen for the pull request (gh-1). - Add TODO tests for improving list handling. 1.300000 2012-04-08T00:08:25Z - Document that characters in varbatim paragraphs and code sections are not escaped. - Bump release number to demonstrate major formatting difference of last change (backslash-escaped characters). (Forgot to do it last time.) 1.200001 2012-04-07T23:16:23Z - Escape characters that are special to Markdown (but normal in Pod) with backslashes. Thanks to Florian (fschlich at zedat dot fu-berlin dot de) for the initial patch (rt-75620). 1.200000 2011-11-28T17:57:01Z [Enhancements] - Handle POD formatting codes embedded in links - Render Z<> and X<> as blank strings - Handle numeric (hex, octal, and decimal) E<> escapes - Convert spaces in S<> to   [Format Changes] - S<> no longer produces backticks (code sections). This is consistent with perlpod and perlpodspec. Use something like S> if you intend it to be treated as code. - Author meta tag with no title meta tag does not produce a leading newline. This was considered a bug. [Tests] - More tests, increased coverage 1.120001 2011-11-27T04:07:30Z [Prereqs] - Require version 1.10 of Pod::ParseLink (core in perl 5.12) to handle alt text with schemes/absolute URLs. This can be changed from "requires" to "recommends" if it poses a problem. [Test Fix] - Skip tests (rather than fail) for alt text with absolute url if Pod::ParseLink < 1.10 1.120000 2011-11-19T05:44:51Z [Enhancements] - Use Pod::ParseLink to dramatically improve (and simplify) link parsing (including sections, alternate text, and man pages). [Format Change] - NOTE: L now becomes ["foo"](#foo) instead of [foo](#pod_foo). This is consistent with perldoc, perlpodspec, and Pod::Simple::(X)HTML which is used for metacpan.org and search.cpan.org. No '#pod_' id/name attributes were ever generated so the links probably weren't very useful (and probably still aren't). If this change presents a problem please report it. 1.110732 2011-11-18T04:06:06Z - Change /\h/ to /[ \t]/ for compatibility with older perls. Thanks to David Golden for reporting [rt-71961] 1.110731 2011-11-18T03:28:34Z - Ensure verbatim pod becomes verbatim markdown by increasing indentation if necessary [rt-72414] - Co-maintainership granted to RWSTAUNER 1.110730 2011-03-14 10:11:52 Europe/Vienna - make bulleted lists work at least minimally (thanks ap) 1.103491 2010-12-15 23:03:02 Europe/Vienna - added Ryan C. Thompson's email address 1.103490 2010-12-15 16:12:31 Europe/Vienna - improved L<> link handling - Enabled interpolation of I in headers 1.100860 2010-03-27 14:31:43 Europe/Vienna - converted the distribution to Dist::Zilla-style - bin/pod2markdown now uses '#!/usr/bin/env perl' 0.02 2009-10-04 16:30:06 CEST - E now outputs '&foo;' - only generate meta tags if asked to 0.01 2009-10-04T12:24:45Z (Marcel Gruenauer ) - original version libpod-markdown-perl-3.200000/LICENSE000066400000000000000000000436601357220324000170030ustar00rootroot00000000000000This software is copyright (c) 2011 by Randy Stauner. 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) 2011 by Randy Stauner. 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, Fifth Floor, Boston, MA 02110-1301 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) 2011 by Randy Stauner. 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 libpod-markdown-perl-3.200000/MANIFEST000066400000000000000000000017361357220324000171250ustar00rootroot00000000000000# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.012. Changes LICENSE MANIFEST MANIFEST.SKIP META.json META.yml Makefile.PL README bin/pod2markdown corpus/copy-enc.pod corpus/copy.pod corpus/lit-cp1252-enc.pod corpus/lit-cp1252.pod corpus/lit-utf8-enc.pod corpus/lit-utf8.pod corpus/tinypod.txt dist.ini lib/Pod/Markdown.pm lib/Pod/Perldoc/ToMarkdown.pm t/00-compile.t t/00-report-prereqs.dd t/00-report-prereqs.t t/back-compat.t t/basic.t t/codes.t t/encoding.t t/entities.t t/escape.t t/formats.t t/lib/MarkdownTests.pm t/links.t t/lists.t t/meta.t t/misc.t t/nested.t t/new.t t/perldoc.t t/pod2markdown.t t/verbatim.t xt/author/critic.t xt/author/eol.t xt/author/minimum-version.t xt/author/mojibake.t xt/author/no-tabs.t xt/author/pod-coverage.t xt/author/pod-syntax.t xt/author/portability.t xt/author/synopsis.t xt/author/test-version.t xt/release/cpan-changes.t xt/release/dist-manifest.t xt/release/distmeta.t xt/release/kwalitee.t xt/release/meta-json.t libpod-markdown-perl-3.200000/MANIFEST.SKIP000066400000000000000000000001451357220324000176630ustar00rootroot00000000000000 \B\.git\b \B\.gitignore$ ^[\._]build ^blib/ ^(Build|Makefile)$ \bpm_to_blib$ ^MYMETA\. ^cover_db/ libpod-markdown-perl-3.200000/META.json000066400000000000000000000762721357220324000174240ustar00rootroot00000000000000{ "abstract" : "Convert POD to Markdown", "author" : [ "Marcel Gruenauer ", "Victor Moral ", "Ryan C. Thompson ", "Aristotle Pagaltzis ", "Randy Stauner " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Pod-Markdown", "no_index" : { "directory" : [ "corpus", "examples", "fatlib", "inc", "local", "perl5", "share", "t", "xt" ], "namespace" : [ "Local", "t::lib" ], "package" : [ "DB" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0", "perl" : "5.008" } }, "develop" : { "recommends" : { "IO::Scalar" : "0" }, "requires" : { "Pod::Coverage::TrustPod" : "0", "Test::CPAN::Changes" : "0.19", "Test::CPAN::Meta" : "0", "Test::CPAN::Meta::JSON" : "0.16", "Test::EOL" : "0", "Test::Kwalitee" : "1.21", "Test::MinimumVersion" : "0", "Test::Mojibake" : "0", "Test::More" : "0.96", "Test::NoTabs" : "0", "Test::Perl::Critic" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "Test::Portability::Files" : "0", "Test::Synopsis" : "0", "Test::Version" : "1" } }, "runtime" : { "recommends" : { "HTML::Entities" : "0" }, "requires" : { "Encode" : "0", "Getopt::Long" : "0", "Pod::Simple" : "3.27", "Pod::Simple::Methody" : "0", "Pod::Usage" : "0", "URI::Escape" : "0", "parent" : "0", "perl" : "5.008", "strict" : "0", "warnings" : "0" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900" }, "requires" : { "Exporter" : "0", "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "File::Spec::Functions" : "0", "File::Temp" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Symbol" : "0", "Test::Differences" : "0", "Test::More" : "0.88", "lib" : "0", "perl" : "5.008", "utf8" : "0" } } }, "provides" : { "Pod::Markdown" : { "file" : "lib/Pod/Markdown.pm", "version" : "3.200" }, "Pod::Perldoc::ToMarkdown" : { "file" : "lib/Pod/Perldoc/ToMarkdown.pm", "version" : "3.200" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "mailto" : "bug-Pod-Markdown@rt.cpan.org", "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=Pod-Markdown" }, "homepage" : "https://github.com/rwstauner/Pod-Markdown", "repository" : { "type" : "git", "url" : "https://github.com/rwstauner/Pod-Markdown.git", "web" : "https://github.com/rwstauner/Pod-Markdown" } }, "version" : "3.200", "x_Dist_Zilla" : { "perl" : { "version" : "5.028002" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "config" : { "Dist::Zilla::Plugin::Git::NextVersion" : { "first_version" : "0.001", "version_by_branch" : 0, "version_regexp" : "(?^:^v(.+)$)" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.22.0", "repo_root" : "." } }, "name" : "@Author::RWSTAUNER/Git::NextVersion", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::GenerateFile", "name" : "@Author::RWSTAUNER/GenerateManifestSkip", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [ "LICENSE" ], "exclude_match" : [], "follow_symlinks" : 0, "include_dotfiles" : 0, "prefix" : "", "prune_directory" : [], "root" : "." } }, "name" : "@Author::RWSTAUNER/GatherDir", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@Author::RWSTAUNER/PruneCruft", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@Author::RWSTAUNER/ManifestSkip", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::PruneFiles", "name" : "@Author::RWSTAUNER/PruneDevelCoverDatabase", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::PruneFiles", "name" : "@Author::RWSTAUNER/PruneCodeStatCollection", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::PruneFiles", "name" : "@Author::RWSTAUNER/PruneTags", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "@Author::RWSTAUNER/PkgVersion", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Authority", "name" : "@Author::RWSTAUNER/Authority", "version" : "1.009" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@Author::RWSTAUNER/NextRelease", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Git::Describe", "name" : "@Author::RWSTAUNER/Git::Describe", "version" : "0.007" }, { "class" : "Dist::Zilla::Plugin::Prepender", "name" : "@Author::RWSTAUNER/Prepender", "version" : "2.004" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "config_plugins" : [ "@Author::RWSTAUNER" ], "finder" : [ ":InstallModules", ":ExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@Author::RWSTAUNER/SingleEncoding", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::WikiDoc", "name" : "@Author::RWSTAUNER/WikiDoc", "version" : "0.093004" }, { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@CorePrep/EnsurePod5", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@CorePrep/H1Nester", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@Author::RWSTAUNER/Name", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@Author::RWSTAUNER/Version", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::RWSTAUNER/Prelude", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::RWSTAUNER/test_synopsis", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@Author::RWSTAUNER/Synopsis", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@Author::RWSTAUNER/Description", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@Author::RWSTAUNER/Overview", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@Author::RWSTAUNER/Usage", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "@Author::RWSTAUNER/Class Methods", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "@Author::RWSTAUNER/Attributes", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "@Author::RWSTAUNER/Methods", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "@Author::RWSTAUNER/Functions", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@Author::RWSTAUNER/Leftovers", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::RWSTAUNER/Postlude", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Support", "name" : "@Author::RWSTAUNER/Support", "version" : "1.010" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@Author::RWSTAUNER/Acknowledgements", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@Author::RWSTAUNER/Authors", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Contributors", "name" : "@Author::RWSTAUNER/Contributors", "version" : "0.009" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@Author::RWSTAUNER/Legal", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "@Author::RWSTAUNER/List", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::StopWords", "name" : "@Author::RWSTAUNER/StopWords", "version" : "1.010" } ] } }, "name" : "@Author::RWSTAUNER/PodWeaver", "version" : "4.008" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@Author::RWSTAUNER/License", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@Author::RWSTAUNER/Readme", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod", "config" : { "Dist::Zilla::Role::FileWatcher" : { "version" : "0.006" } }, "name" : "@Author::RWSTAUNER/ReadmeAnyFromPod", "version" : "0.163250" }, { "class" : "Dist::Zilla::Plugin::GitHubREADME::Badge", "name" : "@Author::RWSTAUNER/GitHubREADME::Badge", "version" : "0.29" }, { "class" : "Dist::Zilla::Plugin::CopyFilesFromRelease", "config" : { "Dist::Zilla::Plugin::CopyFilesFromRelease" : { "filename" : [ "LICENSE" ], "match" : [] } }, "name" : "@Author::RWSTAUNER/CopyFilesFromRelease", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::AutoMetaResources", "name" : "@Author::RWSTAUNER/AutoMetaResources", "version" : "1.21" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "@Author::RWSTAUNER/GithubMeta", "version" : "0.58" }, { "class" : "Dist::Zilla::Plugin::Git::Contributors", "config" : { "Dist::Zilla::Plugin::Git::Contributors" : { "git_version" : "2.22.0", "include_authors" : 0, "include_releaser" : 1, "order_by" : "name", "paths" : [] } }, "name" : "@Author::RWSTAUNER/Git::Contributors", "version" : "0.035" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@Author::RWSTAUNER/AutoPrereqs", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::MetaNoIndex", "name" : "@Author::RWSTAUNER/MetaNoIndex", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Package", "config" : { "Dist::Zilla::Plugin::MetaProvides::Package" : { "finder_objects" : [ { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "@Author::RWSTAUNER/MetaProvides::Package/AUTOVIV/:InstallModulesPM", "version" : "6.012" } ], "include_underscores" : 0 }, "Dist::Zilla::Role::MetaProvider::Provider" : { "$Dist::Zilla::Role::MetaProvider::Provider::VERSION" : "2.002004", "inherit_missing" : 1, "inherit_version" : 1, "meta_noindex" : 1 }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000033", "version" : "0.006" } }, "name" : "@Author::RWSTAUNER/MetaProvides::Package", "version" : "2.004003" }, { "class" : "Dist::Zilla::Plugin::MinimumPerl", "name" : "@Author::RWSTAUNER/MinimumPerl", "version" : "1.006" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@Author::RWSTAUNER/MetaConfig", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@Author::RWSTAUNER/MetaYAML", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@Author::RWSTAUNER/MetaJSON", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@Author::RWSTAUNER/ExecDir", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@Author::RWSTAUNER/ShareDir", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 1 } }, "name" : "@Author::RWSTAUNER/MakeMaker", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", "name" : "@Author::RWSTAUNER/Test::ReportPrereqs", "version" : "0.027" }, { "class" : "Dist::Zilla::Plugin::Test::Synopsis", "name" : "@Author::RWSTAUNER/@TestingMania/Test::Synopsis", "version" : "2.000007" }, { "class" : "Dist::Zilla::Plugin::Test::CPAN::Changes", "config" : { "Dist::Zilla::Plugin::Test::CPAN::Changes" : { "changelog" : "Changes" } }, "name" : "@Author::RWSTAUNER/@TestingMania/Test::CPAN::Changes", "version" : "0.012" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "config" : { "Dist::Zilla::Plugin::Test::Compile" : { "bail_out_on_fail" : 0, "fail_on_warning" : "author", "fake_home" : 1, "filename" : "t/00-compile.t", "module_finder" : [ ":InstallModules" ], "needs_display" : 0, "phase" : "test", "script_finder" : [ ":PerlExecFiles" ], "skips" : [], "switch" : [] } }, "name" : "@Author::RWSTAUNER/@TestingMania/Test::Compile", "version" : "2.058" }, { "class" : "Dist::Zilla::Plugin::Test::Perl::Critic", "name" : "@Author::RWSTAUNER/@TestingMania/Test::Perl::Critic", "version" : "3.001" }, { "class" : "Dist::Zilla::Plugin::Test::Version", "name" : "@Author::RWSTAUNER/@TestingMania/Test::Version", "version" : "1.09" }, { "class" : "Dist::Zilla::Plugin::MojibakeTests", "name" : "@Author::RWSTAUNER/@TestingMania/MojibakeTests", "version" : "0.8" }, { "class" : "Dist::Zilla::Plugin::Test::MinimumVersion", "config" : { "Dist::Zilla::Plugin::Test::MinimumVersion" : { "max_target_perl" : "5.008" } }, "name" : "@Author::RWSTAUNER/@TestingMania/Test::MinimumVersion", "version" : "2.000010" }, { "class" : "Dist::Zilla::Plugin::MetaTests", "name" : "@Author::RWSTAUNER/@TestingMania/MetaTests", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Test::CPAN::Meta::JSON", "name" : "@Author::RWSTAUNER/@TestingMania/Test::CPAN::Meta::JSON", "version" : "0.004" }, { "class" : "Dist::Zilla::Plugin::Test::DistManifest", "name" : "@Author::RWSTAUNER/@TestingMania/Test::DistManifest", "version" : "2.000005" }, { "class" : "Dist::Zilla::Plugin::Test::Kwalitee", "config" : { "Dist::Zilla::Plugin::Test::Kwalitee" : { "filename" : "xt/release/kwalitee.t", "skiptest" : [] } }, "name" : "@Author::RWSTAUNER/@TestingMania/Test::Kwalitee", "version" : "2.12" }, { "class" : "Dist::Zilla::Plugin::Test::EOL", "config" : { "Dist::Zilla::Plugin::Test::EOL" : { "filename" : "xt/author/eol.t", "finder" : [ ":ExecFiles", ":InstallModules", ":TestFiles" ], "trailing_whitespace" : 0 } }, "name" : "@Author::RWSTAUNER/@TestingMania/Test::EOL", "version" : "0.19" }, { "class" : "Dist::Zilla::Plugin::Test::Portability", "config" : { "Dist::Zilla::Plugin::Test::Portability" : { "options" : "" } }, "name" : "@Author::RWSTAUNER/@TestingMania/Test::Portability", "version" : "2.001000" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@Author::RWSTAUNER/@TestingMania/PodSyntaxTests", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "@Author::RWSTAUNER/@TestingMania/PodCoverageTests", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Test::NoTabs", "config" : { "Dist::Zilla::Plugin::Test::NoTabs" : { "filename" : "xt/author/no-tabs.t", "finder" : [ ":InstallModules", ":ExecFiles", ":TestFiles" ] } }, "name" : "@Author::RWSTAUNER/@TestingMania/Test::NoTabs", "version" : "0.15" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@Author::RWSTAUNER/Manifest", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::CheckExtraTests", "name" : "@Author::RWSTAUNER/CheckExtraTests", "version" : "0.029" }, { "class" : "Dist::Zilla::Plugin::CheckChangesHasContent", "name" : "@Author::RWSTAUNER/CheckChangesHasContent", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::CheckMetaResources", "name" : "@Author::RWSTAUNER/CheckMetaResources", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@Author::RWSTAUNER/CheckPrereqsIndexed", "version" : "0.020" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@Author::RWSTAUNER/TestRelease", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "LICENSE", "README.mkdn", "README.pod" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.22.0", "repo_root" : "." } }, "name" : "@Author::RWSTAUNER/@Git/Check", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "v%v%t%n%n%c" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "LICENSE", "README.mkdn", "README.pod" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.22.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::RWSTAUNER/@Git/Commit", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 0, "tag" : "v3.200", "tag_format" : "v%V", "tag_message" : "v%V" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.22.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@Author::RWSTAUNER/@Git/Tag", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "config" : { "Dist::Zilla::Plugin::Git::Push" : { "push_to" : [ "origin" ], "remotes_must_exist" : 1 }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.22.0", "repo_root" : "." } }, "name" : "@Author::RWSTAUNER/@Git/Push", "version" : "2.046" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@Author::RWSTAUNER/ConfirmRelease", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@Author::RWSTAUNER/UploadToCPAN", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::InstallRelease", "name" : "@Author::RWSTAUNER/InstallRelease", "version" : "0.008" }, { "class" : "Dist::Zilla::Plugin::Encoding", "name" : "CP1252", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "runtime", "type" : "requires" } }, "name" : "RuntimeRequires", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "runtime", "type" : "recommends" } }, "name" : "RuntimeRecommends", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "develop", "type" : "recommends" } }, "name" : "DevelopRecommends", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Run::AfterRelease", "config" : { "Dist::Zilla::Plugin::Run::Role::Runner" : { "fatal_errors" : 1, "quiet" : 0, "run" : [ "perl -i -pe '$orig = q[2009-2011 by Marcel Gruenauer.]; /\\Q$orig\\E/ and $already=1; $already or s/^(#?)(\\s*This software is copyright \\(c\\))( \\d+ by Randy Stauner\\.)/$1$2 $orig\\n$1\\n$1$2$3/' %d/lib/Pod/Markdown.pm %d/bin/pod2markdown %d/README* %d/LICENSE README*" ], "version" : "0.048" } }, "name" : "Run::AfterRelease", "version" : "0.048" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "@Author::RWSTAUNER/MetaProvides::Package/AUTOVIV/:InstallModulesPM", "version" : "6.012" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : 0 }, "version" : "6.012" } }, "x_authority" : "cpan:RWSTAUNER", "x_contributors" : [ "Aristotle Pagaltzis ", "Cindy Wang (CindyLinz) ", "Graham Ollis ", "Mike Covington ", "motemen ", "moznion ", "Peter Vereshagin ", "Ryan C. Thompson ", "Yasutaka ATARASHI " ], "x_generated_by_perl" : "v5.28.2", "x_serialization_backend" : "Cpanel::JSON::XS version 4.12" } libpod-markdown-perl-3.200000/META.yml000066400000000000000000000505271357220324000172470ustar00rootroot00000000000000--- abstract: 'Convert POD to Markdown' author: - 'Marcel Gruenauer ' - 'Victor Moral ' - 'Ryan C. Thompson ' - 'Aristotle Pagaltzis ' - 'Randy Stauner ' build_requires: Exporter: '0' ExtUtils::MakeMaker: '0' File::Spec: '0' File::Spec::Functions: '0' File::Temp: '0' IO::Handle: '0' IPC::Open3: '0' Symbol: '0' Test::Differences: '0' Test::More: '0.88' lib: '0' perl: '5.008' utf8: '0' configure_requires: ExtUtils::MakeMaker: '0' perl: '5.008' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Pod-Markdown no_index: directory: - corpus - examples - fatlib - inc - local - perl5 - share - t - xt namespace: - Local - t::lib package: - DB provides: Pod::Markdown: file: lib/Pod/Markdown.pm version: '3.200' Pod::Perldoc::ToMarkdown: file: lib/Pod/Perldoc/ToMarkdown.pm version: '3.200' recommends: HTML::Entities: '0' requires: Encode: '0' Getopt::Long: '0' Pod::Simple: '3.27' Pod::Simple::Methody: '0' Pod::Usage: '0' URI::Escape: '0' parent: '0' perl: '5.008' strict: '0' warnings: '0' resources: bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Pod-Markdown homepage: https://github.com/rwstauner/Pod-Markdown repository: https://github.com/rwstauner/Pod-Markdown.git version: '3.200' x_Dist_Zilla: perl: version: '5.028002' plugins: - class: Dist::Zilla::Plugin::Git::NextVersion config: Dist::Zilla::Plugin::Git::NextVersion: first_version: '0.001' version_by_branch: 0 version_regexp: (?^:^v(.+)$) Dist::Zilla::Role::Git::Repo: git_version: 2.22.0 repo_root: . name: '@Author::RWSTAUNER/Git::NextVersion' version: '2.046' - class: Dist::Zilla::Plugin::GenerateFile name: '@Author::RWSTAUNER/GenerateManifestSkip' version: '6.012' - class: Dist::Zilla::Plugin::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: - LICENSE exclude_match: [] follow_symlinks: 0 include_dotfiles: 0 prefix: '' prune_directory: [] root: . name: '@Author::RWSTAUNER/GatherDir' version: '6.012' - class: Dist::Zilla::Plugin::PruneCruft name: '@Author::RWSTAUNER/PruneCruft' version: '6.012' - class: Dist::Zilla::Plugin::ManifestSkip name: '@Author::RWSTAUNER/ManifestSkip' version: '6.012' - class: Dist::Zilla::Plugin::PruneFiles name: '@Author::RWSTAUNER/PruneDevelCoverDatabase' version: '6.012' - class: Dist::Zilla::Plugin::PruneFiles name: '@Author::RWSTAUNER/PruneCodeStatCollection' version: '6.012' - class: Dist::Zilla::Plugin::PruneFiles name: '@Author::RWSTAUNER/PruneTags' version: '6.012' - class: Dist::Zilla::Plugin::PkgVersion name: '@Author::RWSTAUNER/PkgVersion' version: '6.012' - class: Dist::Zilla::Plugin::Authority name: '@Author::RWSTAUNER/Authority' version: '1.009' - class: Dist::Zilla::Plugin::NextRelease name: '@Author::RWSTAUNER/NextRelease' version: '6.012' - class: Dist::Zilla::Plugin::Git::Describe name: '@Author::RWSTAUNER/Git::Describe' version: '0.007' - class: Dist::Zilla::Plugin::Prepender name: '@Author::RWSTAUNER/Prepender' version: '2.004' - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: config_plugins: - '@Author::RWSTAUNER' finder: - ':InstallModules' - ':ExecFiles' plugins: - class: Pod::Weaver::Plugin::SingleEncoding name: '@Author::RWSTAUNER/SingleEncoding' version: '4.015' - class: Pod::Weaver::Plugin::WikiDoc name: '@Author::RWSTAUNER/WikiDoc' version: '0.093004' - class: Pod::Weaver::Plugin::EnsurePod5 name: '@CorePrep/EnsurePod5' version: '4.015' - class: Pod::Weaver::Plugin::H1Nester name: '@CorePrep/H1Nester' version: '4.015' - class: Pod::Weaver::Section::Name name: '@Author::RWSTAUNER/Name' version: '4.015' - class: Pod::Weaver::Section::Version name: '@Author::RWSTAUNER/Version' version: '4.015' - class: Pod::Weaver::Section::Region name: '@Author::RWSTAUNER/Prelude' version: '4.015' - class: Pod::Weaver::Section::Region name: '@Author::RWSTAUNER/test_synopsis' version: '4.015' - class: Pod::Weaver::Section::Generic name: '@Author::RWSTAUNER/Synopsis' version: '4.015' - class: Pod::Weaver::Section::Generic name: '@Author::RWSTAUNER/Description' version: '4.015' - class: Pod::Weaver::Section::Generic name: '@Author::RWSTAUNER/Overview' version: '4.015' - class: Pod::Weaver::Section::Generic name: '@Author::RWSTAUNER/Usage' version: '4.015' - class: Pod::Weaver::Section::Collect name: '@Author::RWSTAUNER/Class Methods' version: '4.015' - class: Pod::Weaver::Section::Collect name: '@Author::RWSTAUNER/Attributes' version: '4.015' - class: Pod::Weaver::Section::Collect name: '@Author::RWSTAUNER/Methods' version: '4.015' - class: Pod::Weaver::Section::Collect name: '@Author::RWSTAUNER/Functions' version: '4.015' - class: Pod::Weaver::Section::Leftovers name: '@Author::RWSTAUNER/Leftovers' version: '4.015' - class: Pod::Weaver::Section::Region name: '@Author::RWSTAUNER/Postlude' version: '4.015' - class: Pod::Weaver::Section::Support name: '@Author::RWSTAUNER/Support' version: '1.010' - class: Pod::Weaver::Section::Generic name: '@Author::RWSTAUNER/Acknowledgements' version: '4.015' - class: Pod::Weaver::Section::Authors name: '@Author::RWSTAUNER/Authors' version: '4.015' - class: Pod::Weaver::Section::Contributors name: '@Author::RWSTAUNER/Contributors' version: '0.009' - class: Pod::Weaver::Section::Legal name: '@Author::RWSTAUNER/Legal' version: '4.015' - class: Pod::Weaver::Plugin::Transformer name: '@Author::RWSTAUNER/List' version: '4.015' - class: Pod::Weaver::Plugin::StopWords name: '@Author::RWSTAUNER/StopWords' version: '1.010' name: '@Author::RWSTAUNER/PodWeaver' version: '4.008' - class: Dist::Zilla::Plugin::License name: '@Author::RWSTAUNER/License' version: '6.012' - class: Dist::Zilla::Plugin::Readme name: '@Author::RWSTAUNER/Readme' version: '6.012' - class: Dist::Zilla::Plugin::ReadmeAnyFromPod config: Dist::Zilla::Role::FileWatcher: version: '0.006' name: '@Author::RWSTAUNER/ReadmeAnyFromPod' version: '0.163250' - class: Dist::Zilla::Plugin::GitHubREADME::Badge name: '@Author::RWSTAUNER/GitHubREADME::Badge' version: '0.29' - class: Dist::Zilla::Plugin::CopyFilesFromRelease config: Dist::Zilla::Plugin::CopyFilesFromRelease: filename: - LICENSE match: [] name: '@Author::RWSTAUNER/CopyFilesFromRelease' version: '0.006' - class: Dist::Zilla::Plugin::AutoMetaResources name: '@Author::RWSTAUNER/AutoMetaResources' version: '1.21' - class: Dist::Zilla::Plugin::GithubMeta name: '@Author::RWSTAUNER/GithubMeta' version: '0.58' - class: Dist::Zilla::Plugin::Git::Contributors config: Dist::Zilla::Plugin::Git::Contributors: git_version: 2.22.0 include_authors: 0 include_releaser: 1 order_by: name paths: [] name: '@Author::RWSTAUNER/Git::Contributors' version: '0.035' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@Author::RWSTAUNER/AutoPrereqs' version: '6.012' - class: Dist::Zilla::Plugin::MetaNoIndex name: '@Author::RWSTAUNER/MetaNoIndex' version: '6.012' - class: Dist::Zilla::Plugin::MetaProvides::Package config: Dist::Zilla::Plugin::MetaProvides::Package: finder_objects: - class: Dist::Zilla::Plugin::FinderCode name: '@Author::RWSTAUNER/MetaProvides::Package/AUTOVIV/:InstallModulesPM' version: '6.012' include_underscores: 0 Dist::Zilla::Role::MetaProvider::Provider: $Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.002004' inherit_missing: '1' inherit_version: '1' meta_noindex: '1' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000033' version: '0.006' name: '@Author::RWSTAUNER/MetaProvides::Package' version: '2.004003' - class: Dist::Zilla::Plugin::MinimumPerl name: '@Author::RWSTAUNER/MinimumPerl' version: '1.006' - class: Dist::Zilla::Plugin::MetaConfig name: '@Author::RWSTAUNER/MetaConfig' version: '6.012' - class: Dist::Zilla::Plugin::MetaYAML name: '@Author::RWSTAUNER/MetaYAML' version: '6.012' - class: Dist::Zilla::Plugin::MetaJSON name: '@Author::RWSTAUNER/MetaJSON' version: '6.012' - class: Dist::Zilla::Plugin::ExecDir name: '@Author::RWSTAUNER/ExecDir' version: '6.012' - class: Dist::Zilla::Plugin::ShareDir name: '@Author::RWSTAUNER/ShareDir' version: '6.012' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 1 name: '@Author::RWSTAUNER/MakeMaker' version: '6.012' - class: Dist::Zilla::Plugin::Test::ReportPrereqs name: '@Author::RWSTAUNER/Test::ReportPrereqs' version: '0.027' - class: Dist::Zilla::Plugin::Test::Synopsis name: '@Author::RWSTAUNER/@TestingMania/Test::Synopsis' version: '2.000007' - class: Dist::Zilla::Plugin::Test::CPAN::Changes config: Dist::Zilla::Plugin::Test::CPAN::Changes: changelog: Changes name: '@Author::RWSTAUNER/@TestingMania/Test::CPAN::Changes' version: '0.012' - class: Dist::Zilla::Plugin::Test::Compile config: Dist::Zilla::Plugin::Test::Compile: bail_out_on_fail: '0' fail_on_warning: author fake_home: 1 filename: t/00-compile.t module_finder: - ':InstallModules' needs_display: 0 phase: test script_finder: - ':PerlExecFiles' skips: [] switch: [] name: '@Author::RWSTAUNER/@TestingMania/Test::Compile' version: '2.058' - class: Dist::Zilla::Plugin::Test::Perl::Critic name: '@Author::RWSTAUNER/@TestingMania/Test::Perl::Critic' version: '3.001' - class: Dist::Zilla::Plugin::Test::Version name: '@Author::RWSTAUNER/@TestingMania/Test::Version' version: '1.09' - class: Dist::Zilla::Plugin::MojibakeTests name: '@Author::RWSTAUNER/@TestingMania/MojibakeTests' version: '0.8' - class: Dist::Zilla::Plugin::Test::MinimumVersion config: Dist::Zilla::Plugin::Test::MinimumVersion: max_target_perl: '5.008' name: '@Author::RWSTAUNER/@TestingMania/Test::MinimumVersion' version: '2.000010' - class: Dist::Zilla::Plugin::MetaTests name: '@Author::RWSTAUNER/@TestingMania/MetaTests' version: '6.012' - class: Dist::Zilla::Plugin::Test::CPAN::Meta::JSON name: '@Author::RWSTAUNER/@TestingMania/Test::CPAN::Meta::JSON' version: '0.004' - class: Dist::Zilla::Plugin::Test::DistManifest name: '@Author::RWSTAUNER/@TestingMania/Test::DistManifest' version: '2.000005' - class: Dist::Zilla::Plugin::Test::Kwalitee config: Dist::Zilla::Plugin::Test::Kwalitee: filename: xt/release/kwalitee.t skiptest: [] name: '@Author::RWSTAUNER/@TestingMania/Test::Kwalitee' version: '2.12' - class: Dist::Zilla::Plugin::Test::EOL config: Dist::Zilla::Plugin::Test::EOL: filename: xt/author/eol.t finder: - ':ExecFiles' - ':InstallModules' - ':TestFiles' trailing_whitespace: 0 name: '@Author::RWSTAUNER/@TestingMania/Test::EOL' version: '0.19' - class: Dist::Zilla::Plugin::Test::Portability config: Dist::Zilla::Plugin::Test::Portability: options: '' name: '@Author::RWSTAUNER/@TestingMania/Test::Portability' version: '2.001000' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@Author::RWSTAUNER/@TestingMania/PodSyntaxTests' version: '6.012' - class: Dist::Zilla::Plugin::PodCoverageTests name: '@Author::RWSTAUNER/@TestingMania/PodCoverageTests' version: '6.012' - class: Dist::Zilla::Plugin::Test::NoTabs config: Dist::Zilla::Plugin::Test::NoTabs: filename: xt/author/no-tabs.t finder: - ':InstallModules' - ':ExecFiles' - ':TestFiles' name: '@Author::RWSTAUNER/@TestingMania/Test::NoTabs' version: '0.15' - class: Dist::Zilla::Plugin::Manifest name: '@Author::RWSTAUNER/Manifest' version: '6.012' - class: Dist::Zilla::Plugin::CheckExtraTests name: '@Author::RWSTAUNER/CheckExtraTests' version: '0.029' - class: Dist::Zilla::Plugin::CheckChangesHasContent name: '@Author::RWSTAUNER/CheckChangesHasContent' version: '0.011' - class: Dist::Zilla::Plugin::CheckMetaResources name: '@Author::RWSTAUNER/CheckMetaResources' version: '0.001' - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@Author::RWSTAUNER/CheckPrereqsIndexed' version: '0.020' - class: Dist::Zilla::Plugin::TestRelease name: '@Author::RWSTAUNER/TestRelease' version: '6.012' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - LICENSE - README.mkdn - README.pod allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.22.0 repo_root: . name: '@Author::RWSTAUNER/@Git/Check' version: '2.046' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: v%v%t%n%n%c Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - LICENSE - README.mkdn - README.pod allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.22.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::RWSTAUNER/@Git/Commit' version: '2.046' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: 0 tag: v3.200 tag_format: v%V tag_message: v%V Dist::Zilla::Role::Git::Repo: git_version: 2.22.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@Author::RWSTAUNER/@Git/Tag' version: '2.046' - class: Dist::Zilla::Plugin::Git::Push config: Dist::Zilla::Plugin::Git::Push: push_to: - origin remotes_must_exist: 1 Dist::Zilla::Role::Git::Repo: git_version: 2.22.0 repo_root: . name: '@Author::RWSTAUNER/@Git/Push' version: '2.046' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@Author::RWSTAUNER/ConfirmRelease' version: '6.012' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@Author::RWSTAUNER/UploadToCPAN' version: '6.012' - class: Dist::Zilla::Plugin::InstallRelease name: '@Author::RWSTAUNER/InstallRelease' version: '0.008' - class: Dist::Zilla::Plugin::Encoding name: CP1252 version: '6.012' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: runtime type: requires name: RuntimeRequires version: '6.012' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: runtime type: recommends name: RuntimeRecommends version: '6.012' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: develop type: recommends name: DevelopRecommends version: '6.012' - class: Dist::Zilla::Plugin::Run::AfterRelease config: Dist::Zilla::Plugin::Run::Role::Runner: fatal_errors: 1 quiet: 0 run: - "perl -i -pe '$orig = q[2009-2011 by Marcel Gruenauer.]; /\\Q$orig\\E/ and $already=1; $already or s/^(#?)(\\s*This software is copyright \\(c\\))( \\d+ by Randy Stauner\\.)/$1$2 $orig\\n$1\\n$1$2$3/' %d/lib/Pod/Markdown.pm %d/bin/pod2markdown %d/README* %d/LICENSE README*" version: '0.048' name: Run::AfterRelease version: '0.048' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: '@Author::RWSTAUNER/MetaProvides::Package/AUTOVIV/:InstallModulesPM' version: '6.012' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '6.012' x_authority: cpan:RWSTAUNER x_contributors: - 'Aristotle Pagaltzis ' - 'Cindy Wang (CindyLinz) ' - 'Graham Ollis ' - 'Mike Covington ' - 'motemen ' - 'moznion ' - 'Peter Vereshagin ' - 'Ryan C. Thompson ' - 'Yasutaka ATARASHI ' x_generated_by_perl: v5.28.2 x_serialization_backend: 'YAML::Tiny version 1.73' libpod-markdown-perl-3.200000/Makefile.PL000066400000000000000000000044551357220324000177470ustar00rootroot00000000000000# # This file is part of Pod-Markdown # # This software is copyright (c) 2011 by Randy Stauner. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.012. use strict; use warnings; use 5.008; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "Convert POD to Markdown", "AUTHOR" => "Marcel Gruenauer , Victor Moral , Ryan C. Thompson , Aristotle Pagaltzis , Randy Stauner ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "Pod-Markdown", "EXE_FILES" => [ "bin/pod2markdown" ], "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.008", "NAME" => "Pod::Markdown", "PREREQ_PM" => { "Encode" => 0, "Getopt::Long" => 0, "Pod::Simple" => "3.27", "Pod::Simple::Methody" => 0, "Pod::Usage" => 0, "URI::Escape" => 0, "parent" => 0, "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "Exporter" => 0, "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "File::Spec::Functions" => 0, "File::Temp" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Symbol" => 0, "Test::Differences" => 0, "Test::More" => "0.88", "lib" => 0, "utf8" => 0 }, "VERSION" => "3.200", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Encode" => 0, "Exporter" => 0, "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "File::Spec::Functions" => 0, "File::Temp" => 0, "Getopt::Long" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Pod::Simple" => "3.27", "Pod::Simple::Methody" => 0, "Pod::Usage" => 0, "Symbol" => 0, "Test::Differences" => 0, "Test::More" => "0.88", "URI::Escape" => 0, "lib" => 0, "parent" => 0, "strict" => 0, "utf8" => 0, "warnings" => 0 ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); libpod-markdown-perl-3.200000/README000066400000000000000000000005461357220324000166520ustar00rootroot00000000000000This archive contains the distribution Pod-Markdown, version 3.200: Convert POD to Markdown This software is copyright (c) 2011 by Randy Stauner. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. This README file was generated by Dist::Zilla::Plugin::Readme v6.012. libpod-markdown-perl-3.200000/bin/000077500000000000000000000000001357220324000165355ustar00rootroot00000000000000libpod-markdown-perl-3.200000/bin/pod2markdown000077500000000000000000000071051357220324000210750ustar00rootroot00000000000000#!/usr/local/bin/perl # # This file is part of Pod-Markdown # # This software is copyright (c) 2011 by Randy Stauner. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use 5.008; use strict; use warnings; # PODNAME: pod2markdown # ABSTRACT: Convert POD text to Markdown use Pod::Markdown; use Getopt::Long; use Pod::Usage; my %opts = ( # Since we're writing to a file the module needs to know that it has to do # some kind of encoding. Default to UTF-8. output_encoding => 'UTF-8', ); GetOptions(\%opts, qw( help|h html_encode_chars|html-encode-chars=s match_encoding|match-encoding|m output_encoding|output-encoding|e=s utf8|utf-8|u )) or pod2usage(2); pod2usage(1) if $opts{help}; # TODO: Test PERL_UNICODE and/or layers on the handle? # Expand alias (-u is an alias for -e UTF-8). $opts{output_encoding} = 'UTF-8' if delete $opts{utf8}; # TODO: Pod::Simple::parse_from_file(@ARGV[0,1]); my $in_fh = get_handle(shift(@ARGV), '<', \*STDIN); my $out_fh = get_handle(shift(@ARGV), '>', \*STDOUT); # Undo any PERL_UNICODE effects. # Pod::Simple expects to receive bytes, and we're going to return bytes. binmode($_, ':bytes') for ($in_fh, $out_fh); convert($in_fh, $out_fh); sub convert { my ($in_file, $out_file) = @_; my $parser = Pod::Markdown->new(%opts); $parser->output_fh($out_file); $parser->parse_file($in_file); } sub get_handle { my ($path, $op, $default) = @_; (!defined($path) || $path eq '-') ? $default : do { open(my $fh, $op, $path) or die "Failed to open '$path': $!\n"; $fh; }; } __END__ =pod =encoding UTF-8 =for :stopwords Marcel Gruenauer Victor Moral Ryan C. Thompson Aristotle Pagaltzis Randy Stauner ACKNOWLEDGEMENTS html =head1 NAME pod2markdown - Convert POD text to Markdown =head1 VERSION version 3.200 =head1 SYNOPSIS # parse STDIN, print to STDOUT $ pod2markdown < POD_File > Markdown_File # parse file, print to STDOUT $ pod2markdown input.pod # parse file, print to file $ pod2markdown input.pod output.mkdn # parse STDIN, print to file $ pod2markdown - output.mkdn =head1 DESCRIPTION This program uses L to convert POD into Markdown sources. UTF-8 is the default output encoding if no encoding options are specified (see L). It accepts two optional arguments: =over 4 =item * input pod file (defaults to C) =item * output markdown file (defaults to C) =back =head1 OPTIONS =over =item --html-encode-chars A list of characters to encode as HTML entities. Pass a regexp character class, or C<1> to mean control chars, high-bit chars, and C<< <&>"' >>. See L for more information. =item --match-encoding (-m) Use the same C<< =encoding >> as the input pod for the output file. =item --output-encoding (-e) Specify the encoding for the output file. =item --utf8 (-u) Alias for C<< -e UTF-8 >>. =back =head1 SEE ALSO This program is strongly based on C from L. =head1 AUTHORS =over 4 =item * Marcel Gruenauer =item * Victor Moral =item * Ryan C. Thompson =item * Aristotle Pagaltzis =item * Randy Stauner =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2011 by Randy Stauner. 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 libpod-markdown-perl-3.200000/corpus/000077500000000000000000000000001357220324000173005ustar00rootroot00000000000000libpod-markdown-perl-3.200000/corpus/copy-enc.pod000066400000000000000000000000521357220324000215160ustar00rootroot00000000000000=encoding utf-8 =head1 cr { `E` } libpod-markdown-perl-3.200000/corpus/copy.pod000066400000000000000000000000331357220324000207520ustar00rootroot00000000000000 =head1 cr { `E` } libpod-markdown-perl-3.200000/corpus/lit-cp1252-enc.pod000066400000000000000000000000451357220324000222500ustar00rootroot00000000000000=encoding cp1252 =head1 cr { `©` } libpod-markdown-perl-3.200000/corpus/lit-cp1252.pod000066400000000000000000000000231357220324000215010ustar00rootroot00000000000000=head1 cr { `©` } libpod-markdown-perl-3.200000/corpus/lit-utf8-enc.pod000066400000000000000000000000451357220324000222220ustar00rootroot00000000000000=encoding utf-8 =head1 cr { `©` } libpod-markdown-perl-3.200000/corpus/lit-utf8.pod000066400000000000000000000000261357220324000214560ustar00rootroot00000000000000 =head1 cr { `©` } libpod-markdown-perl-3.200000/corpus/tinypod.txt000066400000000000000000000000341357220324000215240ustar00rootroot00000000000000=pod This is I. =cut libpod-markdown-perl-3.200000/dist.ini000066400000000000000000000024421357220324000174330ustar00rootroot00000000000000name = Pod-Markdown author = Marcel Gruenauer author = Victor Moral author = Ryan C. Thompson author = Aristotle Pagaltzis author = Randy Stauner copyright_holder = Randy Stauner copyright_year = 2011 license = Perl_5 ; NOTE: To test this module on its own README: ; $ DZIL_README_PHASE=build dzil build [@Author::RWSTAUNER] ; This seems broken (https://rt.cpan.org/Public/Bug/Display.html?id=73280) -remove = Test::Pod::LinkCheck ; Test::Vars is broken on 5.22 https://github.com/gfx/p5-Test-Vars/issues/11 -remove = Test::UnusedVars ; Verbatim tests have trailing whitespace (in pod and and heredocs). Test::EOL.trailing_whitespace = 0 [Encoding / CP1252] match = corpus/lit-cp1252 encoding = cp1252 [Prereqs / RuntimeRequires] URI::Escape = 0 [Prereqs / RuntimeRecommends] HTML::Entities = 0 [Prereqs / DevelopRecommends] IO::Scalar = 0 [Run::AfterRelease] ; fix generated Copyright statements to include Marcel's work run = perl -i -pe '$orig = q[2009-2011 by Marcel Gruenauer.]; /\Q$orig\E/ and $already=1; $already or s/^(#?)(\s*This software is copyright \(c\))( \d+ by Randy Stauner\.)/$1$2 $orig\n$1\n$1$2$3/' %d/lib/Pod/Markdown.pm %d/bin/pod2markdown %d/README* %d/LICENSE README* libpod-markdown-perl-3.200000/lib/000077500000000000000000000000001357220324000165335ustar00rootroot00000000000000libpod-markdown-perl-3.200000/lib/Pod/000077500000000000000000000000001357220324000172555ustar00rootroot00000000000000libpod-markdown-perl-3.200000/lib/Pod/Markdown.pm000066400000000000000000001276661357220324000214170ustar00rootroot00000000000000# vim: set ts=2 sts=2 sw=2 expandtab smarttab: # # This file is part of Pod-Markdown # # This software is copyright (c) 2011 by Randy Stauner. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use 5.008; use strict; use warnings; package Pod::Markdown; # git description: v3.101-3-g70682ef our $AUTHORITY = 'cpan:RWSTAUNER'; # ABSTRACT: Convert POD to Markdown $Pod::Markdown::VERSION = '3.200'; use Pod::Simple 3.27 (); # detected_encoding and keep_encoding bug fix use parent qw(Pod::Simple::Methody); use Encode (); use URI::Escape (); our %URL_PREFIXES = ( sco => 'http://search.cpan.org/perldoc?', metacpan => 'https://metacpan.org/pod/', man => 'http://man.he.net/man', ); $URL_PREFIXES{perldoc} = $URL_PREFIXES{metacpan}; our $LOCAL_MODULE_RE = qr/^(Local::|\w*?_\w*)/; ## no critic #{ our $HAS_HTML_ENTITIES; # Stolen from Pod::Simple::XHTML 3.28. {{{ BEGIN { $HAS_HTML_ENTITIES = eval "require HTML::Entities; 1"; } my %entities = ( q{>} => 'gt', q{<} => 'lt', q{'} => '#39', q{"} => 'quot', q{&} => 'amp', ); sub encode_entities { my $self = shift; my $ents = $self->html_encode_chars; return HTML::Entities::encode_entities( $_[0], $ents ) if $HAS_HTML_ENTITIES; if (defined $ents) { $ents =~ s,(? 'nbsp', chr(utf8::unicode_to_native(0xA9)) => 'copy', %entities ); sub __entity_encode_ord_he { my $chr = chr $_[0]; # Skip the encode_entities() logic and go straight for the substitution # since we already have the char we know we want replaced. # Both the hash and the function are documented as exportable (so should be reliable). return $HTML::Entities::char2entity{ $chr } || HTML::Entities::num_entity( $chr ); } sub __entity_encode_ord_basic { return '&' . ($entities{chr $_[0]} || sprintf '#x%X', $_[0]) . ';'; } # From HTML::Entities 3.69 my $DEFAULT_ENTITY_CHARS = '^\n\r\t !\#\$%\(-;=?-~'; #} ## use critic # Use hash for simple "exists" check in `new` (much more accurate than `->can`). my %attributes = map { ($_ => 1) } qw( html_encode_chars match_encoding output_encoding local_module_re local_module_url_prefix man_url_prefix perldoc_url_prefix perldoc_fragment_format markdown_fragment_format include_meta_tags ); sub new { my $class = shift; my %args = @_; my $self = $class->SUPER::new(); $self->preserve_whitespace(1); $self->nbsp_for_S(1); $self->accept_targets(qw( markdown html )); # Default to the global, but allow it to be overwritten in args. $self->local_module_re($LOCAL_MODULE_RE); for my $type ( qw( perldoc man ) ){ my $attr = $type . '_url_prefix'; # Initialize to the alias. $self->$attr($type); } while( my ($attr, $val) = each %args ){ # NOTE: Checking exists on a private var means we don't allow Pod::Simple # attributes to be set this way. It's not very consistent, but I think # I'm ok with that for now since there probably aren't many Pod::Simple attributes # being changed besides `output_*` which feel like API rather than attributes. # We'll see. # This is currently backward-compatible as we previously just put the attribute # into the private stash so anything unknown was silently ignored. # We could open this up to `$self->can($attr)` in the future if that seems better # but it tricked me when I was testing a misspelled attribute name # which also happened to be a Pod::Simple method. exists $attributes{ $attr } or # Provide a more descriptive message than "Can't locate object method". warn("Unknown argument to ${class}->new(): '$attr'"), next; # Call setter. $self->$attr($val); } # TODO: call from the setters. $self->_prepare_fragment_formats; return $self; } for my $type ( qw( local_module perldoc man ) ){ my $attr = $type . '_url_prefix'; no strict 'refs'; ## no critic *$attr = sub { my $self = shift; if (@_) { $self->{$attr} = $URL_PREFIXES{ $_[0] } || $_[0]; } else { return $self->{$attr}; } } } ## Attribute accessors ## sub html_encode_chars { my $self = shift; my $stash = $self->_private; # Setter. if( @_ ){ # If false ('', 0, undef), disable. if( !$_[0] ){ delete $stash->{html_encode_chars}; $stash->{encode_amp} = 1; $stash->{encode_lt} = 1; } else { # Special case boolean '1' to mean "all". # If we have HTML::Entities, undef will use the default. # Without it, we need to specify so that we use the same list (for consistency). $stash->{html_encode_chars} = $_[0] eq '1' ? ($HAS_HTML_ENTITIES ? undef : $DEFAULT_ENTITY_CHARS) : $_[0]; # If [char] doesn't get encoded, we need to do it ourselves. $stash->{encode_amp} = ($self->encode_entities('&') eq '&'); $stash->{encode_lt} = ($self->encode_entities('<') eq '<'); } return; } # Getter. return $stash->{html_encode_chars}; } # I prefer ro-accessors (immutability!) but it can be confusing # to not support the same API as other Pod::Simple classes. # NOTE: Pod::Simple::_accessorize is not a documented public API. # Skip any that have already been defined. __PACKAGE__->_accessorize(grep { !__PACKAGE__->can($_) } keys %attributes); sub _prepare_fragment_formats { my ($self) = @_; foreach my $attr ( keys %attributes ){ next unless $attr =~ /^(\w+)_fragment_format/; my $type = $1; my $format = $self->$attr; # If one was provided. if( $format ){ # If the attribute is a coderef just use it. next if ref($format) eq 'CODE'; } # Else determine a default. else { if( $type eq 'perldoc' ){ # Choose a default that matches the destination url. my $target = $self->perldoc_url_prefix; foreach my $alias ( qw( metacpan sco ) ){ if( $target eq $URL_PREFIXES{ $alias } ){ $format = $alias; } } # This seems like a reasonable fallback. $format ||= 'pod_simple_xhtml'; } else { $format = $type; } } # The short name should become a method name with the prefix prepended. my $prefix = 'format_fragment_'; $format =~ s/^$prefix//; die "Unknown fragment format '$format'" unless $self->can($prefix . $format); # Save it. $self->$attr($format); } return; } ## Backward compatible API ## # For backward compatibility (previously based on Pod::Parser): # While Pod::Simple provides a parse_from_file() method # it's primarily for Pod::Parser compatibility. # When called without an output handle it will print to STDOUT # but the old Pod::Markdown never printed to a handle # so we don't want to start now. sub parse_from_file { my ($self, $file) = @_; # TODO: Check that all dependent cpan modules use the Pod::Simple API # then add a deprecation warning here to avoid confusion. $self->output_string(\($self->{_as_markdown_})); $self->parse_file($file); } # Likewise, though Pod::Simple doesn't define this method at all. sub parse_from_filehandle { shift->parse_from_file(@_) } ## Document state ## sub _private { my ($self) = @_; $self->{_Pod_Markdown_} ||= { indent => 0, stacks => [], states => [{}], link => [], encode_amp => 1, encode_lt => 1, }; } sub _increase_indent { ++$_[0]->_private->{indent} >= 1 or die 'Invalid state: indent < 0'; } sub _decrease_indent { --$_[0]->_private->{indent} >= 0 or die 'Invalid state: indent < 0'; } sub _new_stack { push @{ $_[0]->_private->{stacks} }, []; push @{ $_[0]->_private->{states} }, {}; } sub _last_string { $_[0]->_private->{stacks}->[-1][-1]; } sub _pop_stack_text { $_[0]->_private->{last_state} = pop @{ $_[0]->_private->{states} }; join '', @{ pop @{ $_[0]->_private->{stacks} } }; } sub _stack_state { $_[0]->_private->{states}->[-1]; } sub _save { my ($self, $text) = @_; push @{ $self->_private->{stacks}->[-1] }, $text; # return $text; # DEBUG } sub _save_line { my ($self, $text) = @_; $text = $self->_process_escapes($text); $self->_save($text . $/); } # For paragraphs, etc. sub _save_block { my ($self, $text) = @_; $self->_stack_state->{blocks}++; $self->_save_line($self->_indent($text) . $/); } ## Formatting ## sub _chomp_all { my ($self, $text) = @_; 1 while chomp $text; return $text; } sub _indent { my ($self, $text) = @_; my $level = $self->_private->{indent}; if( $level ){ my $indent = ' ' x ($level * 4); # Capture text on the line so that we don't indent blank lines (/^\x20{4}$/). $text =~ s/^(.+)/$indent$1/mg; } return $text; } # as_markdown() exists solely for backward compatibility # and requires having called parse_from_file() to be useful. sub as_markdown { my ($parser, %args) = @_; my @header; # Don't add meta tags again if we've already done it. if( $args{with_meta} && !$parser->include_meta_tags ){ @header = $parser->_build_markdown_head; } return join("\n" x 2, @header, $parser->{_as_markdown_}); } sub _build_markdown_head { my $parser = shift; my $data = $parser->_private; return join "\n", map { qq![[meta \l$_="$data->{$_}"]]! } grep { defined $data->{$_} } qw( Title Author ); } ## Escaping ## # http://daringfireball.net/projects/markdown/syntax#backslash # Markdown provides backslash escapes for the following characters: # # \ backslash # ` backtick # * asterisk # _ underscore # {} curly braces # [] square brackets # () parentheses # # hash mark # + plus sign # - minus sign (hyphen) # . dot # ! exclamation mark # However some of those only need to be escaped in certain places: # * Backslashes *do* need to be escaped or they may be swallowed by markdown. # * Word-surrounding characters (/[`*_]/) *do* need to be escaped mid-word # because the markdown spec explicitly allows mid-word em*pha*sis. # * I don't actually see anything that curly braces are used for. # * Escaping square brackets is enough to avoid accidentally # creating links and images (so we don't need to escape plain parentheses # or exclamation points as that would generate a lot of unnecesary noise). # Parentheses will be escaped in urls (&end_L) to avoid premature termination. # * We don't need a backslash for every hash mark or every hyphen found mid-word, # just the ones that start a line (likewise for plus and dot). # (Those will all be handled by _escape_paragraph_markdown). # Backslash escape markdown characters to avoid having them interpreted. sub _escape_inline_markdown { local $_ = $_[1]; # s/([\\`*_{}\[\]()#+-.!])/\\$1/g; # See comments above. s/([\\`*_\[\]])/\\$1/g; return $_; } # Escape markdown characters that would be interpreted # at the start of a line. sub _escape_paragraph_markdown { local $_ = $_[1]; # Escape headings, horizontal rules, (unordered) lists, and blockquotes. s/^([-+#>])/\\$1/mg; # Markdown doesn't support backslash escapes for equal signs # even though they can be used to underline a header. # So use html to escape them to avoid having them interpreted. s/^([=])/sprintf '&#x%x;', ord($1)/mge; # Escape the dots that would wrongfully create numbered lists. s/^( (?:>\s+)? \d+ ) (\.\x20)/$1\\$2/xgm; return $_; } # Additionally Markdown allows inline html so we need to escape things that look like it. # While _some_ Markdown processors handle backslash-escaped html, # [Daring Fireball](http://daringfireball.net/projects/markdown/syntax) states distinctly: # > In HTML, there are two characters that demand special treatment: < and &... # > If you want to use them as literal characters, you must escape them as entities, e.g. <, and &. # It goes on to say: # > Markdown allows you to use these characters naturally, # > taking care of all the necessary escaping for you. # > If you use an ampersand as part of an HTML entity, # > it remains unchanged; otherwise it will be translated into &. # > Similarly, because Markdown supports inline HTML, # > if you use angle brackets as delimiters for HTML tags, Markdown will treat them as such. # In order to only encode the occurrences that require it (something that # could be interpreted as an entity) we escape them all so that we can do the # suffix test later after the string is complete (since we don't know what # strings might come after this one). my %_escape = map { my ($k, $v) = split /:/; # Put the "code" marker before the char instead of after so that it doesn't # get confused as the $2 (which is what requires us to entity-encode it). # ( "XsX", "XcsX", "X(c?)sX" ) my ($s, $code, $re) = map { "\0$_$v\0" } '', map { ($_, '('.$_.'?)') } 'c'; ( $k => $s, $k.'_code' => $code, $k.'_re' => qr/$re/, ) } qw( amp:& lt:< ); # Make the values of this private var available to the tests. sub __escape_sequences { %_escape } # HTML-entity encode any characters configured by the user. # If that doesn't include [&<] then we escape those chars so we can decide # later if we will entity-encode them or put them back verbatim. sub _encode_or_escape_entities { my $self = $_[0]; my $stash = $self->_private; local $_ = $_[1]; if( $stash->{encode_amp} ){ if( exists($stash->{html_encode_chars}) ){ # Escape all amps for later processing. # Pass intermediate strings to entity encoder so that it doesn't # process any of the characters of our escape sequences. # Use -1 to get "as many fields as possible" so that we keep leading and # trailing (possibly empty) fields. $_ = join $_escape{amp}, map { $self->encode_entities($_) } split /&/, $_, -1; } else { s/&/$_escape{amp}/g; } } elsif( exists($stash->{html_encode_chars}) ){ $_ = $self->encode_entities($_); } s/{encode_lt}; return $_; } # From Markdown.pl version 1.0.1 line 1172 (_DoAutoLinks). my $EMAIL_MARKER = qr{ # < # Opening token is in parent regexp. (?:mailto:)? ( [-.\w]+ \@ [-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+ ) > }x; # Process any escapes we put in the text earlier, # now that the text is complete (end of a block). sub _process_escapes { my $self = $_[0]; my $stash = $self->_private; local $_ = $_[1]; # The patterns below are taken from Markdown.pl 1.0.1 _EncodeAmpsAndAngles(). # In this case we only want to encode the ones that Markdown won't. # This is overkill but produces nicer looking text (less escaped entities). # If it proves insufficent then we'll just encode them all. # $1: If the escape was in a code sequence, simply replace the original. # $2: If the unescaped value would be followed by characters # that could be interpreted as html, entity-encode it. # else: The character is safe to leave bare. # Neither currently allows $2 to contain '0' so bool tests are sufficient. if( $stash->{encode_amp} ){ # Encode & if succeeded by chars that look like an html entity. s,$_escape{amp_re}((?:#?[xX]?(?:[0-9a-fA-F]+|\w+);)?), $1 ? '&'.$2 : $2 ? '&'.$2 : '&',egos; } if( $stash->{encode_lt} ){ # Encode < if succeeded by chars that look like an html tag. # Leave email addresses () for Markdown to process. s,$_escape{lt_re}((?=$EMAIL_MARKER)|(?:[a-z/?\$!])?), $1 ? '<'.$2 : $2 ? '<'.$2 : '<',egos; } return $_; } ## Parsing ## sub handle_text { my $self = $_[0]; my $stash = $self->_private; local $_ = $_[1]; # Unless we're in a code span, verbatim block, or formatted region. unless( $stash->{no_escape} ){ # We could, in theory, alter what gets escaped according to context # (for example, escape square brackets (but not parens) inside link text). # The markdown produced might look slightly nicer but either way you're # at the whim of the markdown processor to interpret things correctly. # For now just escape everything. # Don't let literal characters be interpreted as markdown. $_ = $self->_escape_inline_markdown($_); # Entity-encode (or escape for later processing) necessary/desired chars. $_ = $self->_encode_or_escape_entities($_); } # If this _is_ a code section, do limited/specific handling. else { # Always escaping these chars ensures that we won't mangle the text # in the unlikely event that a sequence matching our escape occurred in the # input stream (since we're going to escape it and then unescape it). s/&/$_escape{amp_code}/gos if $stash->{encode_amp}; s/{encode_lt}; } $self->_save($_); } sub start_Document { my ($self) = @_; $self->_new_stack; } sub end_Document { my ($self) = @_; $self->_check_search_header; my $end = pop @{ $self->_private->{stacks} }; @{ $self->_private->{stacks} } == 0 or die 'Document ended with stacks remaining'; my @doc = $self->_chomp_all(join('', @$end)) . $/; if( $self->include_meta_tags ){ unshift @doc, $self->_build_markdown_head, ($/ x 2); } if( my $encoding = $self->_get_output_encoding ){ # Do the check outside the loop(s) for efficiency. my $ents = $HAS_HTML_ENTITIES ? \&__entity_encode_ord_he : \&__entity_encode_ord_basic; # Iterate indices to avoid copying large strings. for my $i ( 0 .. $#doc ){ print { $self->{output_fh} } Encode::encode($encoding, $doc[$i], $ents); } } else { print { $self->{output_fh} } @doc; } } sub _get_output_encoding { my ($self) = @_; # If 'match_encoding' is set we need to return an encoding. # If pod has no =encoding, Pod::Simple will guess if it sees a high-bit char. # If there are no high-bit chars, encoding is undef. # Use detected_encoding() rather than encoding() because if Pod::Simple # can't use whatever encoding was specified, we probably can't either. # Fallback to 'o_e' if no match is found. This gives the user the choice, # since otherwise there would be no reason to specify 'o_e' *and* 'm_e'. # Fallback to UTF-8 since it is a reasonable default these days. return $self->detected_encoding || $self->output_encoding || 'UTF-8' if $self->match_encoding; # If output encoding wasn't specified, return false. return $self->output_encoding; } ## Blocks ## sub start_Verbatim { my ($self) = @_; $self->_new_stack; $self->_private->{no_escape} = 1; } sub end_Verbatim { my ($self) = @_; my $text = $self->_pop_stack_text; $text = $self->_indent_verbatim($text); $self->_private->{no_escape} = 0; # Verbatim blocks do not generate a separate "Para" event. $self->_save_block($text); } sub _indent_verbatim { my ($self, $paragraph) = @_; # NOTE: Pod::Simple expands the tabs for us (as suggested by perlpodspec). # Pod::Simple also has a 'strip_verbatim_indent' attribute # but it doesn't sound like it gains us anything over this method. # POD verbatim can start with any number of spaces (or tabs) # markdown should be 4 spaces (or a tab) # so indent any paragraphs so that all lines start with at least 4 spaces my @lines = split /\n/, $paragraph; my $indent = ' ' x 4; foreach my $line ( @lines ){ next unless $line =~ m/^( +)/; # find the smallest indentation $indent = $1 if length($1) < length($indent); } if( (my $smallest = length($indent)) < 4 ){ # invert to get what needs to be prepended $indent = ' ' x (4 - $smallest); # Prepend indent to each line. # We could check /\S/ to only indent non-blank lines, # but it's backward compatible to respect the whitespace. # Additionally, both pod and markdown say they ignore blank lines # so it shouldn't hurt to leave them in. $paragraph = join "\n", map { length($_) ? $indent . $_ : '' } @lines; } return $paragraph; } sub start_Para { $_[0]->_new_stack; } sub end_Para { my ($self) = @_; my $text = $self->_pop_stack_text; $text = $self->_escape_paragraph_markdown($text); $self->_save_block($text); } ## Headings ## sub start_head1 { $_[0]->_start_head(1) } sub end_head1 { $_[0]->_end_head(1) } sub start_head2 { $_[0]->_start_head(2) } sub end_head2 { $_[0]->_end_head(2) } sub start_head3 { $_[0]->_start_head(3) } sub end_head3 { $_[0]->_end_head(3) } sub start_head4 { $_[0]->_start_head(4) } sub end_head4 { $_[0]->_end_head(4) } sub _check_search_header { my ($self) = @_; # Save the text since the last heading if we want it for metadata. if( my $last = $self->_private->{search_header} ){ for( $self->_private->{$last} = $self->_last_string ){ s/\A\s+//; s/\s+\z//; } } } sub _start_head { my ($self) = @_; $self->_check_search_header; $self->_new_stack; } sub _end_head { my ($self, $num) = @_; my $h = '#' x $num; my $text = $self->_pop_stack_text; $self->_private->{search_header} = $text =~ /NAME/ ? 'Title' : $text =~ /AUTHOR/ ? 'Author' : undef; # TODO: option for $h suffix # TODO: put a name="" if $self->{embed_anchor_tags}; ? # https://rt.cpan.org/Ticket/Display.html?id=57776 $self->_save_block(join(' ', $h, $text)); } ## Lists ## # With Pod::Simple->parse_empty_lists(1) there could be an over_empty event, # but what would you do with that? sub _start_list { my ($self) = @_; $self->_new_stack; # Nest again b/c start_item will pop this to look for preceding content. $self->_increase_indent; $self->_new_stack; } sub _end_list { my ($self) = @_; $self->_handle_between_item_content; # Finish the list. # All the child elements should be blocks, # but don't end with a double newline. my $text = $self->_chomp_all($self->_pop_stack_text); $_[0]->_save_line($text . $/); } sub _handle_between_item_content { my ($self) = @_; # This might be empty (if the list item had no additional content). if( my $text = $self->_pop_stack_text ){ # Else it's a sub-document. # If there are blocks we need to separate with blank lines. if( $self->_private->{last_state}->{blocks} ){ $text = $/ . $text; } # If not, we can condense the text. # In this module's history there was a patch contributed to specifically # produce "huddled" lists so we'll try to maintain that functionality. else { $text = $self->_chomp_all($text) . $/; } $self->_save($text) } $self->_decrease_indent; } sub _start_item { my ($self) = @_; $self->_handle_between_item_content; $self->_new_stack; } sub _end_item { my ($self, $marker) = @_; my $text = $self->_pop_stack_text; $self->_save_line($self->_indent($marker . # Add a space only if there is text after the marker. (defined($text) && length($text) ? ' ' . $text : '') )); # Store any possible contents in a new stack (like a sub-document). $self->_increase_indent; $self->_new_stack; } sub start_over_bullet { $_[0]->_start_list } sub end_over_bullet { $_[0]->_end_list } sub start_item_bullet { $_[0]->_start_item } sub end_item_bullet { $_[0]->_end_item('-') } sub start_over_number { $_[0]->_start_list } sub end_over_number { $_[0]->_end_list } sub start_item_number { $_[0]->_start_item; # It seems like this should be a stack, # but from testing it appears that the corresponding 'end' event # comes right after the text (it doesn't surround any embedded content). # See t/nested.t which shows start-item, text, end-item, para, start-item.... $_[0]->_private->{item_number} = $_[1]->{number}; } sub end_item_number { my ($self) = @_; $self->_end_item($self->_private->{item_number} . '.'); } # Markdown doesn't support definition lists # so do regular (unordered) lists with indented paragraphs. sub start_over_text { $_[0]->_start_list } sub end_over_text { $_[0]->_end_list } sub start_item_text { $_[0]->_start_item } sub end_item_text { $_[0]->_end_item('-')} # perlpodspec equates an over/back region with no items to a blockquote. sub start_over_block { # NOTE: We don't actually need to indent for a blockquote. $_[0]->_new_stack; } sub end_over_block { my ($self) = @_; # Chomp first to avoid prefixing a blank line with a `>`. my $text = $self->_chomp_all($self->_pop_stack_text); # NOTE: Paragraphs will already be escaped. # I don't really like either of these implementations # but the join/map/split seems a little better and benches a little faster. # You would lose the last newline but we've already chomped. #$text =~ s{^(.)?}{'>' . (defined($1) && length($1) ? (' ' . $1) : '')}mge; $text = join $/, map { length($_) ? '> ' . $_ : '>' } split qr-$/-, $text; $self->_save_block($text); } ## Custom Formats ## sub start_for { my ($self, $attr) = @_; $self->_new_stack; if( $attr->{target} eq 'html' ){ # Use another stack so we can indent # (not syntactily necessary but seems appropriate). $self->_new_stack; $self->_increase_indent; $self->_private->{no_escape} = 1; # Mark this so we know to undo it. $self->_stack_state->{for_html} = 1; } } sub end_for { my ($self) = @_; # Data gets saved as a block (which will handle indents), # but if there was html we'll alter this, so chomp and save a block again. my $text = $self->_chomp_all($self->_pop_stack_text); if( $self->_private->{last_state}->{for_html} ){ $self->_private->{no_escape} = 0; # Save it to the next stack up so we can pop it again (we made two stacks). $self->_save($text); $self->_decrease_indent; $text = join "\n", '
', $self->_chomp_all($self->_pop_stack_text), '
'; } $self->_save_block($text); } # Data events will be emitted for any formatted regions that have been enabled # (by default, `markdown` and `html`). sub start_Data { my ($self) = @_; # TODO: limit this to what's in attr? $self->_private->{no_escape}++; $self->_new_stack; } sub end_Data { my ($self) = @_; my $text = $self->_pop_stack_text; $self->_private->{no_escape}--; $self->_save_block($text); } ## Codes ## sub start_B { $_[0]->_save('**') } sub end_B { $_[0]->start_B() } sub start_I { $_[0]->_save('_') } sub end_I { $_[0]->start_I() } sub start_C { my ($self) = @_; $self->_new_stack; $self->_private->{no_escape}++; } sub end_C { my ($self) = @_; $self->_private->{no_escape}--; $self->_save( $self->_wrap_code_span($self->_pop_stack_text) ); } # Use code spans for F<>. sub start_F { shift->start_C(@_); } sub end_F { shift ->end_C(@_); } sub start_L { my ($self, $flags) = @_; $self->_new_stack; push @{ $self->_private->{link} }, $flags; } sub end_L { my ($self) = @_; my $flags = pop @{ $self->_private->{link} } or die 'Invalid state: link end with no link start'; my ($type, $to, $section) = @{$flags}{qw( type to section )}; my $url = ( $type eq 'url' ? $to : $type eq 'man' ? $self->format_man_url($to, $section) : $type eq 'pod' ? $self->format_perldoc_url($to, $section) : undef ); my $text = $self->_pop_stack_text; # NOTE: I don't think the perlpodspec says what to do with L<|blah> # but it seems like a blank link text just doesn't make sense if( !length($text) ){ $text = $section ? $to ? sprintf('"%s" in %s', $section, $to) : ('"' . $section . '"') : $to; } # FIXME: What does Pod::Simple::X?HTML do for this? # if we don't know how to handle the url just print the pod back out if (!$url) { $self->_save(sprintf 'L<%s>', $flags->{raw}); return; } # In the url we need to escape quotes and parentheses lest markdown # break the url (cut it short and/or wrongfully interpret a title). # Backslash escapes do not work for the space and quotes. # URL-encoding the space is not sufficient # (the quotes confuse some parsers and produce invalid html). # I've arbitratily chosen HTML encoding to hide them from markdown # while mangling the url as litle as possible. $url =~ s/([ '"])/sprintf '&#x%x;', ord($1)/ge; # We also need to double any backslashes that may be present # (lest they be swallowed up) and stop parens from breaking the url. $url =~ s/([\\()])/\\$1/g; # TODO: put section name in title if not the same as $text $self->_save('[' . $text . '](' . $url . ')'); } sub start_X { $_[0]->_new_stack; } sub end_X { my ($self) = @_; my $text = $self->_pop_stack_text; # TODO: mangle $text? # TODO: put if configured } # A code span can be delimited by multiple backticks (and a space) # similar to pod codes (C<< code >>), so ensure we use a big enough # delimiter to not have it broken by embedded backticks. sub _wrap_code_span { my ($self, $arg) = @_; my $longest = 0; while( $arg =~ /([`]+)/g ){ my $len = length($1); $longest = $len if $longest < $len; } my $delim = '`' x ($longest + 1); my $pad = $longest > 0 ? ' ' : ''; return $delim . $pad . $arg . $pad . $delim; } ## Link Formatting (TODO: Move this to another module) ## sub format_man_url { my ($self, $to) = @_; my ($page, $part) = ($to =~ /^ ([^(]+) (?: \( (\S+) \) )? /x); return $self->man_url_prefix . ($part || 1) . '/' . ($page || $to); } sub format_perldoc_url { my ($self, $name, $section) = @_; my $url_prefix = $self->perldoc_url_prefix; if ( defined($name) && $self->is_local_module($name) && defined($self->local_module_url_prefix) ) { $url_prefix = $self->local_module_url_prefix; } my $url = ''; # If the link is to another module (external link). if ($name) { $url = $url_prefix . URI::Escape::uri_escape($name); } # See https://rt.cpan.org/Ticket/Display.html?id=57776 # for a discussion on the need to mangle the section. if ($section){ my $method = $url # If we already have a prefix on the url it's external. ? $self->perldoc_fragment_format # Else an internal link points to this markdown doc. : $self->markdown_fragment_format; $method = 'format_fragment_' . $method unless ref($method); { # Set topic to enable code refs to be simple. local $_ = $section; $section = $self->$method($section); } $url .= '#' . $section; } return $url; } # TODO: simple, pandoc, etc? sub format_fragment_markdown { my ($self, $section) = @_; # If this is an internal link (to another section in this doc) # we can't be sure what the heading id's will look like # (it depends on what is rendering the markdown to html) # but we can try to follow popular conventions. # http://johnmacfarlane.net/pandoc/demo/example9/pandocs-markdown.html#header-identifiers-in-html-latex-and-context #$section =~ s/(?![-_.])[[:punct:]]//g; #$section =~ s/\s+/-/g; $section =~ s/\W+/-/g; $section =~ s/-+$//; $section =~ s/^-+//; $section = lc $section; #$section =~ s/^[^a-z]+//; $section ||= 'section'; return $section; } { # From Pod::Simple::XHTML 3.28. # The strings gets passed through encode_entities() before idify(). # If we don't do it here the substitutions below won't operate consistently. sub format_fragment_pod_simple_xhtml { my ($self, $t) = @_; # encode_entities { # We need to use the defaults in case html_encode_chars has been customized # (since the purpose is to match what external sources are doing). local $self->_private->{html_encode_chars}; $t = $self->encode_entities($t); # } # idify { for ($t) { s/<[^>]+>//g; # Strip HTML. s/&[^;]+;//g; # Strip entities. s/^\s+//; s/\s+$//; # Strip white space. s/^([^a-zA-Z]+)$/pod$1/; # Prepend "pod" if no valid chars. s/^[^a-zA-Z]+//; # First char must be a letter. s/[^-a-zA-Z0-9_:.]+/-/g; # All other chars must be valid. s/[-:.]+$//; # Strip trailing punctuation. } # } return $t; } } sub format_fragment_pod_simple_html { my ($self, $section) = @_; # From Pod::Simple::HTML 3.28. # section_name_tidy { $section =~ s/^\s+//; $section =~ s/\s+$//; $section =~ tr/ /_/; $section =~ tr/\x00-\x1F\x80-\x9F//d if 'A' eq chr(65); # drop crazy characters #$section = $self->unicode_escape_url($section); # unicode_escape_url { $section =~ s/([^\x00-\xFF])/'('.ord($1).')'/eg; # Turn char 1234 into "(1234)" # } $section = '_' unless length $section; return $section; # } } sub format_fragment_metacpan { shift->format_fragment_pod_simple_xhtml(@_); } sub format_fragment_sco { shift->format_fragment_pod_simple_html(@_); } sub is_local_module { my ($self, $name) = @_; return ($name =~ $self->local_module_re); } 1; __END__ =pod =encoding UTF-8 =for :stopwords Marcel Gruenauer Victor Moral Ryan C. Thompson Aristotle Pagaltzis Randy Stauner ACKNOWLEDGEMENTS html cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan =head1 NAME Pod::Markdown - Convert POD to Markdown =head1 VERSION version 3.200 =for test_synopsis my ($pod_string); =head1 SYNOPSIS # Pod::Simple API is supported. # Command line usage: Parse a pod file and print to STDOUT: # $ perl -MPod::Markdown -e 'Pod::Markdown->new->filter(@ARGV)' path/to/POD/file > README.md # Work with strings: my $markdown; my $parser = Pod::Markdown->new; $parser->output_string(\$markdown); $parser->parse_string_document($pod_string); # See Pod::Simple docs for more. =head1 DESCRIPTION This module uses L to convert POD to Markdown. Literal characters in Pod that are special in Markdown (like *asterisks*) are backslash-escaped when appropriate. By default C and C formatted regions are accepted. Regions of C will be passed through unchanged. Regions of C will be placed inside a C<< EdivE >> tag so that markdown characters won't be processed. Regions of C<:markdown> or C<:html> will be processed as POD and included. To change which regions are accepted use the L API: my $parser = Pod::Markdown->new; $parser->unaccept_targets(qw( markdown html )); =head2 A note on encoding and escaping The common L API returns a character string. If you want Pod::Markdown to return encoded octets, there are two attributes to assist: L and L. When an output encoding is requested any characters that are not valid for that encoding will be escaped as HTML entities. This is not 100% safe, however. Markdown escapes all ampersands inside of code spans, so escaping a character as an HTML entity inside of a code span will not be correct. However, with pod's C and C sequences it is possible to end up with high-bit characters inside of code spans. So, while C<< output_encoding => 'ascii' >> can work, it is not recommended. For these reasons (and more), C is the default, fallback encoding (when one is required). If you prefer HTML entities over literal characters you can use L which will only operate outside of code spans (where it is safe). =head1 METHODS =head2 new Pod::Markdown->new(%options); The constructor accepts the following named arguments: =over 4 =item * C Alters the perldoc urls that are created from C<< LEE >> codes when the module is a "local" module (C<"Local::*"> or C<"Foo_Corp::*"> (see L)). The default is to use C. =item * C Alternate regular expression for determining "local" modules. Default is C<< our $LOCAL_MODULE_RE = qr/^(Local::|\w*?_\w*)/ >>. =item * C Alters the man page urls that are created from C<< LEE >> codes. The default is C. =item * C Alters the perldoc urls that are created from C<< LEE >> codes. Can be: =over 4 =item * C (shortcut for C) =item * C (shortcut for C) =item * any url =back The default is C. Pod::Markdown->new(perldoc_url_prefix => 'http://localhost/perl/pod'); =item * C Alters the format of the url fragment for any C<< LEE >> links that point to a section of an external document (C<< L >>). The default will be chosen according to the destination L. Alternatively you can specify one of the following: =over 4 =item * C =item * C =item * C =item * C =item * A code ref =back The code ref can expect to receive two arguments: the parser object (C<$self>) and the section text. For convenience the topic variable (C<$_>) is also set to the section text: perldoc_fragment_format => sub { s/\W+/-/g; } =item * C Alters the format of the url fragment for any C<< LEE >> links that point to an internal section of this document (C<< L >>). Unfortunately the format of the id attributes produced by whatever system translates the markdown into html is unknown at the time the markdown is generated so we do some simple clean up. B C and C accept the same values: a (shortcut to a) method name or a code ref. =item * C Specifies whether or not to print author/title meta tags at the top of the document. Default is false. =back =head2 html_encode_chars A string of characters to encode as html entities (using L if available, falling back to numeric entities if not). Possible values: =over 4 =item * A value of C<1> will use the default set of characters from L (control chars, high-bit chars, and C<< <&>"' >>). =item * A false value will disable. =item * Any other value is used as a string of characters (like a regular expression character class). =back By default this is disabled and literal characters will be in the output stream. If you specify a desired L any characters not valid for that encoding will be HTML entity encoded. B that Markdown requires ampersands (C<< & >>) and left angle brackets (C<< < >>) to be entity-encoded if they could otherwise be interpreted as html entities. If this attribute is configured to encode those characters, they will always be encoded. If not, the module will make an effort to only encode the ones required, so there will be less html noise in the output. =head2 match_encoding Boolean: If true, use the C<< =encoding >> of the input pod as the encoding for the output. If no encoding is specified, L will guess the encoding if it sees a high-bit character. If no encoding is guessed (or the specified encoding is unusable), L will be used if it was specified. Otherwise C will be used. This attribute is not recommended but is provided for consistency with other pod converters. Defaults to false. =head2 output_encoding The encoding to use when writing to the output file handle. If neither this nor L are specified, a character string will be returned in whatever L output method you specified. =head2 local_module_re Returns the regular expression used to determine local modules. =head2 local_module_url_prefix Returns the url prefix in use for local modules. =head2 man_url_prefix Returns the url prefix in use for man pages. =head2 perldoc_url_prefix Returns the url prefix in use (after resolving shortcuts to urls). =head2 perldoc_fragment_format Returns the coderef or format name used to format a url fragment to a section in an external document. =head2 markdown_fragment_format Returns the coderef or format name used to format a url fragment to an internal section in this document. =head2 include_meta_tags Returns the boolean value indicating whether or not meta tags will be printed. =head2 format_man_url Used internally to create a url (using L) from a string like C. =head2 format_perldoc_url # With $name and section being the two parts of L. my $url = $parser->format_perldoc_url($name, $section); Used internally to create a url from the name (of a module or script) and a possible section (heading). The format of the url fragment (when pointing to a section in a document) varies depending on the destination url so L is used (which can be customized). If the module name portion of the link is blank then the section is treated as an internal fragment link (to a section of the generated markdown document) and L is used (which can be customized). =head2 format_fragment_markdown Format url fragment for an internal link by replacing non-word characters with dashes. =head2 format_fragment_pod_simple_xhtml Format url fragment like L. =head2 format_fragment_pod_simple_html Format url fragment like L. =head2 format_fragment_metacpan Format fragment for L (uses L). =head2 format_fragment_sco Format fragment for L (uses L). =head2 is_local_module Uses C to determine if passed module is a "local" module. =for Pod::Coverage parse_from_file parse_from_filehandle =for Pod::Coverage as_markdown =for Pod::Coverage handle_text end_.+ start_.+ encode_entities =head1 SEE ALSO =over 4 =item * L - script included for command line usage =item * L - Super class that handles Pod parsing =item * L - For writing POD =item * L - For parsing POD =item * L - Markdown spec =back =head1 SUPPORT =head2 Perldoc You can find documentation for this module with the perldoc command. perldoc Pod::Markdown =head2 Websites The following websites have more information about this module, and may be of help to you. As always, in addition to those websites please use your favorite search engine to discover more resources. =over 4 =item * MetaCPAN A modern, open-source CPAN search engine, useful to view POD in HTML format. L =back =head2 Bugs / Feature Requests Please report any bugs or feature requests by email to C, or through the web interface at L. You will be automatically notified of any progress on the request by the system. =head2 Source Code L git clone https://github.com/rwstauner/Pod-Markdown.git =head1 AUTHORS =over 4 =item * Marcel Gruenauer =item * Victor Moral =item * Ryan C. Thompson =item * Aristotle Pagaltzis =item * Randy Stauner =back =head1 CONTRIBUTORS =for stopwords Aristotle Pagaltzis Cindy Wang (CindyLinz) Graham Ollis Mike Covington motemen moznion Peter Vereshagin Ryan C. Thompson Yasutaka ATARASHI =over 4 =item * Aristotle Pagaltzis =item * Cindy Wang (CindyLinz) =item * Graham Ollis =item * Mike Covington =item * motemen =item * moznion =item * Peter Vereshagin =item * Ryan C. Thompson =item * Yasutaka ATARASHI =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2011 by Randy Stauner. 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 libpod-markdown-perl-3.200000/lib/Pod/Perldoc/000077500000000000000000000000001357220324000206455ustar00rootroot00000000000000libpod-markdown-perl-3.200000/lib/Pod/Perldoc/ToMarkdown.pm000066400000000000000000000043011357220324000232660ustar00rootroot00000000000000# # This file is part of Pod-Markdown # # This software is copyright (c) 2011 by Randy Stauner. # # This is free software; you can redistribute it and/or modify it under # the same terms as the Perl 5 programming language system itself. # use strict; use warnings; package Pod::Perldoc::ToMarkdown; our $AUTHORITY = 'cpan:RWSTAUNER'; $Pod::Perldoc::ToMarkdown::VERSION = '3.200'; # ABSTRACT: Enable `perldoc -o Markdown` use parent qw(Pod::Markdown); sub new { my $class = shift; my $self = $class->SUPER::new( # Pod::Perldoc does not pass any options by default # but will call setters if attributes are passed on command line. # I don't know what encoding it expects, but it needs one, so default to UTF-8. output_encoding => 'UTF-8', @_, ); return $self; } sub parse_from_file { my $self = shift; # Instantiate if called as a class method. $self = $self->new if !ref $self; # Skip over SUPER's override and go up to grandpa's method. $self->Pod::Simple::parse_from_file(@_); } # There are several other methods that we could implement that Pod::Perldoc # finds interesting: # * output_is_binary # * name # * output_extension 1; __END__ =pod =encoding UTF-8 =for :stopwords Marcel Gruenauer Victor Moral Ryan C. Thompson Aristotle Pagaltzis Randy Stauner ACKNOWLEDGEMENTS =head1 NAME Pod::Perldoc::ToMarkdown - Enable `perldoc -o Markdown` =head1 VERSION version 3.200 =for test_synopsis 1; __END__ =head1 SYNOPSIS perldoc -o Markdown Some::Module =head1 DESCRIPTION Pod::Perldoc expects a Pod::Parser compatible module, however Pod::Markdown did not historically provide an entirely Pod::Parser compatible interface. This module bridges the gap. =head1 AUTHORS =over 4 =item * Marcel Gruenauer =item * Victor Moral =item * Ryan C. Thompson =item * Aristotle Pagaltzis =item * Randy Stauner =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2011 by Randy Stauner. 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 libpod-markdown-perl-3.200000/t/000077500000000000000000000000001357220324000162305ustar00rootroot00000000000000libpod-markdown-perl-3.200000/t/00-compile.t000066400000000000000000000054671357220324000202760ustar00rootroot00000000000000use 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.058 use Test::More; plan tests => 3 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'Pod/Markdown.pm', 'Pod/Perldoc/ToMarkdown.pm' ); my @scripts = ( 'bin/pod2markdown' ); # fake home for cpan-testers use File::Temp; local $ENV{HOME} = File::Temp::tempdir( CLEANUP => 1 ); my @switches = ( -d 'blib' ? '-Mblib' : '-Ilib', ); use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } $^X, @switches, '-e', "require q[$lib]")) if $ENV{PERL_COMPILE_TEST_DEBUG}; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { +require blib; blib->VERSION('1.01') }; if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } foreach my $file (@scripts) { SKIP: { open my $fh, '<', $file or warn("Unable to open $file: $!"), next; my $line = <$fh>; close $fh and skip("$file isn't perl", 1) unless $line =~ /^#!\s*(?:\S*perl\S*)((?:\s+-\w*)*)(?:\s*#.*)?$/; @switches = (@switches, split(' ', $1)) if $1; close $fh and skip("$file uses -T; not testable with PERL5LIB", 1) if grep { $_ eq '-T' } @switches and $ENV{PERL5LIB}; my $stderr = IO::Handle->new; diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } $^X, @switches, '-c', $file)) if $ENV{PERL_COMPILE_TEST_DEBUG}; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-c', $file); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$file compiled ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { +require blib; blib->VERSION('1.01') }; # in older perls, -c output is simply the file portion of the path being tested if (@_warnings = grep { !/\bsyntax OK$/ } grep { chomp; $_ ne (File::Spec->splitpath($file))[2] } @_warnings) { warn @_warnings; push @warnings, @_warnings; } } } is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING}; libpod-markdown-perl-3.200000/t/00-report-prereqs.dd000066400000000000000000000065661357220324000217650ustar00rootroot00000000000000do { my $x = { 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '0', 'perl' => '5.008' } }, 'develop' => { 'recommends' => { 'IO::Scalar' => '0' }, 'requires' => { 'Pod::Coverage::TrustPod' => '0', 'Test::CPAN::Changes' => '0.19', 'Test::CPAN::Meta' => '0', 'Test::CPAN::Meta::JSON' => '0.16', 'Test::EOL' => '0', 'Test::Kwalitee' => '1.21', 'Test::MinimumVersion' => '0', 'Test::Mojibake' => '0', 'Test::More' => '0.96', 'Test::NoTabs' => '0', 'Test::Perl::Critic' => '0', 'Test::Pod' => '1.41', 'Test::Pod::Coverage' => '1.08', 'Test::Portability::Files' => '0', 'Test::Synopsis' => '0', 'Test::Version' => '1' } }, 'runtime' => { 'recommends' => { 'HTML::Entities' => '0' }, 'requires' => { 'Encode' => '0', 'Getopt::Long' => '0', 'Pod::Simple' => '3.27', 'Pod::Simple::Methody' => '0', 'Pod::Usage' => '0', 'URI::Escape' => '0', 'parent' => '0', 'perl' => '5.008', 'strict' => '0', 'warnings' => '0' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900' }, 'requires' => { 'Exporter' => '0', 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', 'File::Spec::Functions' => '0', 'File::Temp' => '0', 'IO::Handle' => '0', 'IPC::Open3' => '0', 'Symbol' => '0', 'Test::Differences' => '0', 'Test::More' => '0.88', 'lib' => '0', 'perl' => '5.008', 'utf8' => '0' } } }; $x; }libpod-markdown-perl-3.200000/t/00-report-prereqs.t000066400000000000000000000134261357220324000216320ustar00rootroot00000000000000#!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.027 use Test::More tests => 1; use ExtUtils::MakeMaker; use File::Spec; # from $version::LAX my $lax_version_re = qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )? | (?:\.[0-9]+) (?:_[0-9]+)? ) | (?: v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )? | (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)? ) )/x; # hide optional CPAN::Meta modules from prereq scanner # and check if they are available my $cpan_meta = "CPAN::Meta"; my $cpan_meta_pre = "CPAN::Meta::Prereqs"; my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic # Verify requirements? my $DO_VERIFY_PREREQS = 1; sub _max { my $max = shift; $max = ( $_ > $max ) ? $_ : $max for @_; return $max; } sub _merge_prereqs { my ($collector, $prereqs) = @_; # CPAN::Meta::Prereqs object if (ref $collector eq $cpan_meta_pre) { return $collector->with_merged_prereqs( CPAN::Meta::Prereqs->new( $prereqs ) ); } # Raw hashrefs for my $phase ( keys %$prereqs ) { for my $type ( keys %{ $prereqs->{$phase} } ) { for my $module ( keys %{ $prereqs->{$phase}{$type} } ) { $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module}; } } } return $collector; } my @include = qw( ); my @exclude = qw( ); # Add static prereqs to the included modules list my $static_prereqs = do './t/00-report-prereqs.dd'; # Merge all prereqs (either with ::Prereqs or a hashref) my $full_prereqs = _merge_prereqs( ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ), $static_prereqs ); # Add dynamic prereqs to the included modules list (if we can) my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; my $cpan_meta_error; if ( $source && $HAS_CPAN_META && (my $meta = eval { CPAN::Meta->load_file($source) } ) ) { $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs); } else { $cpan_meta_error = $@; # capture error from CPAN::Meta->load_file($source) $source = 'static metadata'; } my @full_reports; my @dep_errors; my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs; # Add static includes into a fake section for my $mod (@include) { $req_hash->{other}{modules}{$mod} = 0; } for my $phase ( qw(configure build test runtime develop other) ) { next unless $req_hash->{$phase}; next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING}); for my $type ( qw(requires recommends suggests conflicts modules) ) { next unless $req_hash->{$phase}{$type}; my $title = ucfirst($phase).' '.ucfirst($type); my @reports = [qw/Module Want Have/]; for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) { next if $mod eq 'perl'; next if grep { $_ eq $mod } @exclude; my $file = $mod; $file =~ s{::}{/}g; $file .= ".pm"; my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC; my $want = $req_hash->{$phase}{$type}{$mod}; $want = "undef" unless defined $want; $want = "any" if !$want && $want == 0; my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required"; if ($prefix) { my $have = MM->parse_version( File::Spec->catfile($prefix, $file) ); $have = "undef" unless defined $have; push @reports, [$mod, $want, $have]; if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) { if ( $have !~ /\A$lax_version_re\z/ ) { push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)"; } elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) { push @dep_errors, "$mod version '$have' is not in required range '$want'"; } } } else { push @reports, [$mod, $want, "missing"]; if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) { push @dep_errors, "$mod is not installed ($req_string)"; } } } if ( @reports ) { push @full_reports, "=== $title ===\n\n"; my $ml = _max( map { length $_->[0] } @reports ); my $wl = _max( map { length $_->[1] } @reports ); my $hl = _max( map { length $_->[2] } @reports ); if ($type eq 'modules') { splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports; } else { splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl]; push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports; } push @full_reports, "\n"; } } } if ( @full_reports ) { diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports; } if ( $cpan_meta_error || @dep_errors ) { diag "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n"; } if ( $cpan_meta_error ) { my ($orig_source) = grep { -f } 'MYMETA.json', 'MYMETA.yml'; diag "\nCPAN::Meta->load_file('$orig_source') failed with: $cpan_meta_error\n"; } if ( @dep_errors ) { diag join("\n", "\nThe following REQUIRED prerequisites were not satisfied:\n", @dep_errors, "\n" ); } pass; # vim: ts=4 sts=4 sw=4 et: libpod-markdown-perl-3.200000/t/back-compat.t000066400000000000000000000032211357220324000205740ustar00rootroot00000000000000# vim: set ts=2 sts=2 sw=2 expandtab smarttab: use strict; use warnings; use lib 't/lib'; use MarkdownTests; use File::Spec (); # Explicitly test using a real file. my $_pod_path = File::Spec->catfile(qw(corpus tinypod.txt)); my $_pod_text = "This is _pod_."; sub compare { my ($got, $exp, $desc) = @_; chomp $got; eq_or_diff $got, $exp, $desc; } # NOTE: With Pod::Parser apparently as_markdown would return # strings with html-encoded entities and no utf8 flag. # We could add that functionality into the parse_file/as_markdown subs # if needed, but it's been based on Pod::Simple for over a year so far # with no reports so it likely isn't (needed). # Dist::Zilla::Plugin::ReadmeAnyFromPod SKIP: { eval 'require IO::Scalar' or skip 'IO::Scalar not available for testing.', 1; my $pod = "=pod\n\nB\n"; my $parser = Pod::Markdown->new(); my $input_handle = IO::Scalar->new(\$pod); $parser->parse_from_filehandle($input_handle); my $content = $parser->as_markdown(); compare $content, '**foo**', 'parse_from_filehandle( IO::Scalar->new(\$string) )'; } # Minilla # Module::Build::Pluggable::ReadmeMarkdownFromPod # Module::Install::ReadmeMarkdownFromPod { my $readme_from = $_pod_path; my $parser = Pod::Markdown->new; $parser->parse_from_file($readme_from); my $markdown = $parser->as_markdown; compare $markdown, $_pod_text, 'parse_from_file( $path )'; } { my $pod = $_pod_path; open my $pod_fh, '<', $pod or die "Can't read POD '$pod'"; my $md = Pod::Markdown->new; $md->parse_from_filehandle($pod_fh); compare $md->as_markdown, $_pod_text, 'parse_from_filehandle( open(my) )'; } done_testing; libpod-markdown-perl-3.200000/t/basic.t000066400000000000000000000014341357220324000175000ustar00rootroot00000000000000# vim: set ts=2 sts=2 sw=2 expandtab smarttab: use strict; use warnings; use lib 't/lib'; use MarkdownTests tests => 1; # Test a small, easy section of pod just to show when the parser # is working. We'll test more of the details in other scripts. my $parser = Pod::Markdown->new( ); $parser->output_string(\my $markdown); $parser->parse_file(\*DATA); my $expect = < B I =cut libpod-markdown-perl-3.200000/t/codes.t000066400000000000000000000060431357220324000175150ustar00rootroot00000000000000# vim: set ts=2 sts=2 sw=2 expandtab smarttab: use utf8; use strict; use warnings; use lib 't/lib'; use MarkdownTests; my $pod_prefix = test_parser()->perldoc_url_prefix; sub code { my ($pod, $exp, %opts) = @_; my $desc = delete $opts{desc} || $pod; my %args = ( init => delete($opts{init}), ); convert_code_ok($pod, $exp, $desc, {}, %args); if( my $ents = delete $opts{entities} ){ # Use the same value for both if only one is specified. $ents->[1] = $ents->[0] if @$ents == 1; with_and_without_entities { my $e = $ents->[ $_[0] ? 0 : 1 ]; convert_code_ok($pod, $e, $desc, { html_encode_chars => '^\x20-\x7e', # most chars }, %args); }; } if( my $utf8 = delete $opts{utf8} ){ convert_code_ok($pod, $utf8, $desc, { output_encoding => 'UTF-8' }, %args); } die "Invalid args: %opts" if keys %opts; } sub convert_code_ok { my ($pod, $exp, $desc, $attr, %opts) = @_; convert_ok($pod, $exp, $desc, %opts, attr => $attr, verbose => 1, # Prefix line to avoid escaping beginning-of-line characters (like `>`). prefix => 'Code: ', ); } code 'I', '_italic_'; code 'B', '**bold**'; code 'C', '`code`'; code 'C', '`c*de`'; # Links tested extensively in t/links.t. code 'L', "[link](${pod_prefix}link)"; code 'L', "[star\\*](${pod_prefix}star%2A)"; # Pod::Simple handles the E<> entirely (Pod::Markdown never sees them). code 'E', '<'; code 'E', '>'; code 'E', '|'; code 'E', '/'; code 'E', '©', entities => ['©'], utf8 => "\xc2\xa9"; code 'E', 'Ă©', entities => ['é', 'é'], utf8 => "\xc3\xa9"; code 'E<0x201E>', '„', entities => ['„', '„'], desc => 'E hex'; code 'E<075>', '=', desc => 'E octal'; code 'E<0241>', '¡', entities => ['¡', '¡'], utf8 => "\xc2\xa1", desc => 'E octal'; code 'E<181>', 'µ', entities => ['µ', 'µ'], desc => 'E decimal'; # Legacy charnames specifically mentioned by perlpodspec. code 'E', '«', entities => ['«', '«'], utf8 => "\xc2\xab"; code 'E', '»', entities => ['»', '»'], utf8 => "\xc2\xbb"; # Translate F<> as code spans. code 'F', '`file.ext`'; code 'F', '`file_path.ext`'; code 'F', '`` /weird/file`path` ``'; # S<> for non-breaking spaces. code 'S<$x ? $y : $z>', '$x ? $y : $z', # Literal NBSP chars. # Entity-encode nbsp (whether we have HTML::Entities or not). entities => ['$x ? $y : $z']; code 'S>', '`$x & $y`', # Literal NBSP chars. # Amps inside code spans will get escaped, so leave nsbp bare. entities => ['`$x & $y`']; code 'S<$x C<& $y>>', '$x `& $y`', # Just spaces. entities => ['$x `& $y`'], init => sub { $_[0]->nbsp_for_S(0) }; # Zero-width entries. code 'X', ''; code 'Z<>', ''; # Pod::Simple swallows unknown codes. #code 'Q', 'Q', desc => 'uknown code (Q<>)'; done_testing; libpod-markdown-perl-3.200000/t/encoding.t000066400000000000000000000061301357220324000202030ustar00rootroot00000000000000# vim: set ts=2 sts=2 sw=2 expandtab smarttab: use strict; use warnings; use lib 't/lib'; use MarkdownTests; # NOTE: All strings in this test file are byte-strings. no utf8; sub test_encoding { my ($enc, $pod, %opts) = @_; my $desc = delete $opts{desc} || hex_escape $pod; foreach my $outenc ( keys %opts ){ convert_encodings($pod, $opts{$outenc}, $enc, $outenc, $desc); } } sub convert_encodings { my ($pod, $exp, $enc, $outenc, $desc) = @_; convert_ok($pod, $exp, $desc, attr => $outenc =~ /match(?:_(\w+))?/ ? { match_encoding => 1, output_encoding => $1||'' } : { output_encoding => $outenc }, prefix => ".", encoding => $enc, init => sub { # Ignore errors about high-bit chars without =encoding. $_[0]->no_errata_section(1) if !$enc || $enc =~ /invalid/; }, verbose => 1, ); } # Pod::Simple defaults to cp1252 (previously latin1) without an =encoding. with_and_without_entities { my $char = $_[0] ? 'À' : 'À'; foreach my $enc ( 'latin1', 'cp1252', '' ){ test_encoding( $enc => "\xc0", utf8 => "\xc3\x80", latin1 => "\xc0", ascii => $char, ); } }; with_and_without_entities { my $bullet = $_[0] ? '•' : '•'; test_encoding( cp1252 => "\x95", utf8 => "\xe2\x80\xa2", match => "\x95", (map { ($_ => $bullet) } qw(latin1 ascii)), ); }; with_and_without_entities { my $currency = $_[0] ? '¤' : '¤'; test_encoding( latin1 => "\xa4", match => "\xa4", utf8 => "\xc2\xa4", ascii => $currency, ); test_encoding( "utf-8" => "\xc2\xa4", match => "\xc2\xa4", latin1 => "\xa4", ascii => $currency, ); }; foreach my $enc ( '', 'invalid' ){ my $utf8 = "\xc2\xa9 a\xc2\xa0b"; test_encoding( $enc => 'E S', match_ascii => '© a b', latin1 => "\xa9 a\xa0b", utf8 => $utf8, match_utf8 => $utf8, match => $utf8, desc => 'ascii; ' . ($enc ? '' : 'no =encoding; ') . 'pod escapes generate non-ascii', ); } { # Verify that output_encoding => 'ascii' (even with match_encoding) is not safe. # > Inside Markdown code spans and blocks, angle brackets and ampersands are always encoded automatically. # Therefore we cannot use html entities to encode high-bit chars; they must be output literally. # It is possible with pod to embed non-ascii characters in a code span without # using literal high-bit characters (so there will be no detected_encoding). my $pod = "=pod\n\nC<< a E<0x2022> bullet >>\n"; my $test = sub { my $p = Pod::Markdown->new(@_); $p->output_string(\my $markdown); $p->parse_string_document($pod); chomp $markdown; ok !$p->detected_encoding, 'no encoding detected'; return $markdown; }; eq_or_diff $test->(output_encoding => 'UTF-8'), "`a \xe2\x80\xa2 bullet`", 'high-bit char UTF-8 encoded in code span'; # Without specifying encoding a character string is returned. eq_or_diff $test->(), "`a \x{2022} bullet`", 'high-bit char embedded in code span (character string)'; } done_testing; libpod-markdown-perl-3.200000/t/entities.t000066400000000000000000000140611357220324000202430ustar00rootroot00000000000000# vim: set ts=2 sts=2 sw=2 expandtab smarttab: use utf8; use strict; use warnings; use lib 't/lib'; use MarkdownTests; # Escape things that would be interpreted as inline html. sub entity_encode_ok { my ($desc, $pod, $markdown, %opts) = @_; my $verbatim = $opts{verbatim} || $pod; note hex_escape $pod; convert_both($pod, $markdown, $verbatim, $desc); # Encoding some entities (but not [&<]) should produce the same as none. convert_both($pod, $markdown, $verbatim, "$desc (html_encode_chars => non ascii)", attr => {html_encode_chars => '\x80-\xff'}); # Encoding [&<] will produce more of those chars. convert_both($pod, $opts{entities}, $verbatim, "$desc (html_encode_chars => 1)", attr => {html_encode_chars => 1}) if $opts{entities}; } sub convert_both { my ($pod, $markdown, $verbatim, $desc, %opts) = @_; convert_ok("B<<< $pod >>>", $markdown, "$desc: inline html escaped", %opts); convert_ok("C<<< $pod >>>", qq{`$verbatim`}, "$desc: html not escaped in code span", %opts); } my %_escape = Pod::Markdown::__escape_sequences; my %_e_escape = do { my $parser = Pod::Markdown->new(html_encode_chars => 1); map { ($_ => $parser->encode_entities($_escape{$_})) } keys %_escape; }; like $_e_escape{amp}, qr/&/, 'entity-encoded escape sanity check'; with_and_without_entities { my $char = $_[0] ? '•' : '•'; entity_encode_ok 'sanity check' => ( q{< & > E<0x2022>}, q{**< & > •**}, entities => "**< & > ${char}**", verbatim => q{< & > •}, ); }; # This was an actual bug report. entity_encode_ok 'command lines args' => ( q{--file=}, q{**--file=<filename>**}, entities => q{**--file=<filename>**}, ); # Ditto entity_encode_ok 'email address' => ( q{Email Address Efoo@bar.comE}, q{**Email Address **}, entities => q{**Email Address <foo@bar.com>**}, verbatim => q{Email Address }, ); # Use real html tags. # This is a good example to copy/paste into a markdown processor # to see how it handles the html. # For example, github respects "\<" and "\&" but daringfireball does not. # That's why we use html entity encoding (more portable). entity_encode_ok 'real html' => ( q{h =
}, q{**h&nbsp;=<hr>**}, entities => q{**h&nbsp;=<hr>**}, ); # Test link text. entity_encode_ok 'html chars in link text' => ( q{L<< Some & |http://some.where/ >>}, q{**[Some &amp; <thing>](http://some.where/)**}, entities => q{**[Some &amp; <thing>](http://some.where/)**}, # Markdown will print this rather than making it a link, # but I'm not sure what else to do about it. verbatim => q{[Some & ](http://some.where/)}, ); entity_encode_ok 'html chars in url' => ( # This may not be a valid url but let this test demonstrate how it currently works. q{L<< Yo|http://some.where?a=&<= >>}, q{**[Yo](http://some.where?a=&<=)**}, # Same as above (shrug). verbatim => q{[Yo](http://some.where?a=&<=)}, ); # Test with 'false' values to avoid conditional bugs. # In this case a bare zero won't trigger the need for an escape. entity_encode_ok 'false values' => ( q{<0 &0}, q{**<0 &0**}, entities => q{**<0 &0**}, ); # Ensure that two pod "strings" still escape the < and & properly. # Use S<> since it counts as an event (and therefore creates two separate # "handle_text" calls) but does not produce boundary characters (the text # inside and around the S<> will have no characters between them). entity_encode_ok '< and & are escaped properly even as separate pod strings' => ( q{the E operator and S<&>foobar; (or S<&>fooS;) and eol &}, q{**the <cmp> operator and &foobar; (or &foobar;) and eol &**}, entities => q{**the <cmp> operator and &foobar; (or &foobar;) and eol &**}, verbatim => q{the operator and &foobar; (or &foobar;) and eol &}, ); # Don't undo it for literal ones that happen to be at the end of strings. entity_encode_ok 'literal entity from pod at end of string stays amp-escaped' => ( q{literal & and <}, q{**literal &amp; and &lt;**}, ); entity_encode_ok 'field splitting: amps at beginning and end and multiple in the middle' => ( q{& ity &&& and &}, q{**& ity &&& and &**}, entities => q{**& ity &&& and &**}, ); entity_encode_ok 'literal occurrences of internal escape sequences are unaltered' => ( qq[hi $_escape{amp} ($_escape{amp_code}) & $_escape{lt} ($_escape{lt_code}) < &exclam;], qq[**hi $_escape{amp} ($_escape{amp_code}) & $_escape{lt} ($_escape{lt_code}) < &exclam;**], entities => qq[**hi $_e_escape{amp} ($_e_escape{amp_code}) & $_e_escape{lt} ($_e_escape{lt_code}) < &exclam;**], ); sub so_example { # Test case from http://stackoverflow.com/questions/28496298/escape-angle-brackets-using-podmarkdown { my $str = "=head1 OPTIONS\n\n=over 4\n\n=item B<< --file= >>\n\nFile name \n\n=back\n"; my $parser = Pod::Markdown->new(@_); # (@_) - rwstauner my $markdown; $parser->output_string( \$markdown ); $parser->parse_string_document($str); # } return $markdown; } eq_or_diff so_example(), "# OPTIONS\n\n- **--file=<filename>**\n\n File name \n", 'SO example properly escaped'; eq_or_diff so_example(html_encode_chars => 1), "# OPTIONS\n\n- **--file=<filename>**\n\n File name \n", 'SO example with additional escapes'; my $list_pod = < &you; < & =over =item & some < t&e;xt < & =back =over =item 1. item < & =back POD convert_ok($list_pod, < &you; < & - & some < t&e;xt <paragraph> < & 1. item <text> < & <para> MKDN 'escape entities in lists and items properly', ); convert_ok($list_pod, < { html_encode_chars => 1 } ); done_testing; libpod-markdown-perl-3.200000/t/escape.t000066400000000000000000000071151357220324000176610ustar00rootroot00000000000000# vim: set ts=2 sts=2 sw=2 expandtab smarttab: use utf8; use strict; use warnings; use lib 't/lib'; use MarkdownTests; convert_ok q{=head2 _Other_ *Characters* [Should](Be) `Escaped` in headers}, q{## \_Other\_ \*Characters\* \[Should\](Be) \`Escaped\` in headers}, 'literal markdown chars escaped in headers'; convert_ok q{Inline C<< code _need not_ be escaped >>.}, q{Inline `code _need not_ be escaped`.}, 'literal markdown chars allowed verbatim in code spans'; convert_ok q{=head3 Heading C<< code _need not_ be escaped, either >>.}, q{### Heading `code _need not_ be escaped, either`.}, 'literal markdown chars allowed verbatim in code spans (in headings)'; convert_ok q{B<< Nested C _should_ be escaped >> (but not code).}, q{**Nested `c*des` \_should\_ be escaped** (but not code).}, 'literal markdown chars escaped in nested sequences'; convert_ok q{Inline F<< filename_should_not >> be escaped}, q{Inline `filename_should_not` be escaped}, 'filenames (F<>) are code spans so no escaping needed'; convert_ok q{L<<< *chars* in_ `text|inside/"a link" >>>}, q{[\*chars\* in\_ \`text](pod://inside#a link)}, 'escape markdown characters in link text'; # Use heredoc to simplify the backslashes. convert_ok <<'POD', Inline L<< link *should* \_ be_escaped|/or\things(can)go\*wrong >>. POD <<'MKDN', Inline [link \*should\* \\\_ be\_escaped](#or\\things\(can\)go\\*wrong). MKDN 'link targets also escaped'; convert_ok <<'POD', =head1 SYNOPSIS $ pod2markdown < POD_File > Markdown_File POD <<'MKDN', # SYNOPSIS $ pod2markdown < POD_File > Markdown_File MKDN 'verbatim paragraph indents and requires no escaping'; convert_ok <<'POD', =head1 *Special* characters html: < & &entity; foo_bar is the result of 4 * 4 Regular characters like *asterisks* and __underscores__ should be escaped in regular text paragraphs. Also [brackets], lists: + a + b - a - b * A line that starts with an asterisk *should* be escaped to avoid incorrectly interpreting the line as a list item. # fake headings ### fake headings ### Setext fake =========== Another fake ------------ > Quote > blocks > 1. with > 2. lists 1996. A year. * Bird * Magic * List item `code` block Hr's: --- * * * Inline `code`; Links: [Foo] [1], [Bar](/baz) An image: ![image](/foo) backslash \ From http://daringfireball.net/projects/markdown/syntax: \ backslash ` backtick * asterisk _ underscore {} curly braces [] square brackets () parentheses # hash mark + plus sign - minus sign (hyphen) . dot ! exclamation mark POD <<'MKDN', # \*Special\* characters html: < & <tag/> &entity; foo_bar is the result of 4 * 4 Regular characters like \*asterisks\* and \_\_underscores\_\_ should be escaped in regular text paragraphs. Also \[brackets\], lists: \+ a \+ b \- a \- b \* A line that starts with an asterisk \*should\* be escaped to avoid incorrectly interpreting the line as a list item. \# fake headings \### fake headings ### Setext fake =========== Another fake \------------ \> Quote \> blocks \> 1. with \> 2. lists 1996\. A year. \* Bird \* Magic \* List item `code` block Hr's: \--- \* \* \* Inline \`code\`; Links: \[Foo\] \[1\], \[Bar\](/baz) An image: !\[image\](/foo) backslash \\ From http://daringfireball.net/projects/markdown/syntax: \\ backslash \` backtick \* asterisk \_ underscore {} curly braces \[\] square brackets () parentheses \# hash mark \+ plus sign \- minus sign (hyphen) . dot ! exclamation mark MKDN 'literal markdown characters in pod escaped'; done_testing; libpod-markdown-perl-3.200000/t/formats.t000066400000000000000000000033601357220324000200720ustar00rootroot00000000000000# vim: set ts=2 sts=2 sw=2 expandtab smarttab: use strict; use warnings; use lib 't/lib'; use MarkdownTests; convert_ok( <<'POD', Some I =for html html =for markdown **mkdn** =for something_else `ignored` POD <<'MKDN', Some _pod_ MKDN 'disable html and markdown targets', init => sub { $_[0]->unaccept_targets(qw(markdown html)) }, ); convert_ok( <<'POD', Some I =for other no =for html foo =for :html bar =for :other nope =for markdown baz =for :markdown qux POD <<'MKDN', Some _pod_
foo
bar baz qux MKDN 'by default accept html and markdown targets', ); convert_ok( <<'POD', Some I =for markdown **BOLD**! B POD <<'MKDN', Some _pod_ **BOLD**! B MKDN '=for markdown passed through', ); convert_ok( <<'POD', Some I =begin markdown **BOLD**! B =end markdown POD <<'MKDN', Some _pod_ **BOLD**! B MKDN '=begin/end markdown passed through', ); convert_ok( <<'POD', Some I =for :markdown **BOLD**! B =for :other `ignored` POD <<'MKDN', Some _pod_ \*\*BOLD\*\*! **real bold** MKDN '=for :markdown gets processed and escaped', ); convert_ok( <<'POD', Some I =begin :markdown **BOLD**! B =end :markdown POD <<'MKDN', Some _pod_ \*\*BOLD\*\*! **real bold** MKDN '=begin/end :markdown gets processed and escaped', ); convert_ok( <<'POD', Some I =for html not I *text* POD <<'MKDN', Some _pod_
not I *text*
MKDN '=for html passes through', ); convert_ok( <<'POD', Some I =for :html yes I *text* POD <<'MKDN', Some _pod_ <i>yes</i> _pod_ \*text\* MKDN '=for :html gets processed and escaped', ); done_testing; libpod-markdown-perl-3.200000/t/lib/000077500000000000000000000000001357220324000167765ustar00rootroot00000000000000libpod-markdown-perl-3.200000/t/lib/MarkdownTests.pm000066400000000000000000000065561357220324000221550ustar00rootroot00000000000000use strict; use warnings; package # no_index MarkdownTests; use Test::More 0.88; # done_testing use Test::Differences; use Pod::Markdown (); use Exporter (); our @ISA = qw(Exporter); our @EXPORT = ( qw( convert_ok hex_escape io_string eq_or_diff slurp_file test_parser warning with_and_without_entities ), @Test::More::EXPORT ); sub import { my $class = shift; Test::More::plan(@_) if @_; @_ = ($class); strict->import; warnings->import; goto &Exporter::import; } sub hex_escape { local $_ = $_[0]; s/([^\x20-\x7e])/sprintf "\\x{%x}", ord $1/ge; return $_; } sub diag_xml { diag_with('Pod::Simple::DumpAsXML', @_); } sub diag_text { diag_with('Pod::Simple::DumpAsText', @_); } sub diag_with { my ($class, $pod) = @_; $class =~ /[^a-zA-Z0-9:]/ and die "Invalid class name '$class'"; eval "require $class" or die $@; my $parser = $class->new; $parser->output_string(\(my $got)); $parser->parse_string_document("=pod\n\n$pod\n"); diag $got; } sub hash_string { my $h = $_[0]; return join ', ', map { "$_: $h->{$_}" } sort keys %$h; } sub convert_ok { local $Test::Builder::Level = $Test::Builder::Level + 1; my ($pod, $exp, $desc, %opts) = @_; my %attr = %{ $opts{attr} || {} }; my $parser = test_parser(%attr); my $prefix = $opts{prefix} || ''; my $podenc = ($opts{encoding} ? "=encoding $opts{encoding}\n\n" : ''); if( $opts{verbose} ){ $desc .= " \t" . hex_escape "($pod => $exp)"; $desc .= join ' ', ' (', hash_string(\%attr), ')' if keys %attr; $desc .= " =encoding $opts{encoding}" if $podenc; } diag_xml($pod) if $opts{diag_xml}; diag_text($pod) if $opts{diag_text}; $opts{init}->($parser) if $opts{init}; $parser->output_string(\(my $got)); $parser->parse_string_document("$podenc=pod\n\n$prefix$pod\n\n=cut\n"); # Chomp both ends. for ($got, $exp) { s/^\n+//; s/\n+$//; } eq_or_diff($got, $prefix.$exp, $desc); } sub test_parser { Pod::Markdown->new( # Default to very simple values for simple tests. perldoc_url_prefix => 'pod://', # Just return the raw fragment so we know that it isn't unexpectedly mangled. perldoc_fragment_format => sub { $_ }, markdown_fragment_format => sub { $_ }, @_ ); } { package # no_index MarkdownTests::IOString; use Symbol (); sub new { my $class = ref($_[0]) || $_[0]; my $s = $_[1]; my $self = Symbol::gensym; tie *$self, $class, $self; *$self->{lines} = [map { "$_\n" } split /\n/, $s ]; $self; } sub READLINE { shift @{ *{$_[0]}->{lines} } } sub TIEHANDLE { my ($class, $s) = @_; bless $s, $class; } { no warnings 'once'; *getline = \&READLINE; } } sub io_string { MarkdownTests::IOString->new(@_); } sub slurp_file { my $path = shift; open(my $fh, '<', $path) or die "Failed to open $path: $!"; slurp_fh($fh) } sub slurp_fh { my $fh = shift; local $/; <$fh>; } # Similar interface to Test::Fatal; sub warning (&) { ## no critic (Prototypes) my @warnings; local $SIG{__WARN__} = sub { push @warnings, $_[0] }; $_[0]->(); pop @warnings; } sub with_and_without_entities (&) { ## no critic (Prototypes) SKIP: for my $ents ( 0, 1 ){ if( $ents && ! $Pod::Markdown::HAS_HTML_ENTITIES ){ skip 'HTML::Entities required for this test', 1; } local $Pod::Markdown::HAS_HTML_ENTITIES = $ents; $_[0]->($ents); } } 1; libpod-markdown-perl-3.200000/t/links.t000066400000000000000000000304761357220324000175470ustar00rootroot00000000000000# vim: set ts=2 sts=2 sw=2 expandtab smarttab: use strict; use warnings; use lib 't/lib'; use MarkdownTests; # Test url aliases. local $Pod::Markdown::URL_PREFIXES{manny} = 'http://manny.local/page/'; my %defaults = ( # We'll test the various formats later # so for the first set just pass them through. perldoc_fragment_format => sub { $_ }, markdown_fragment_format => sub { $_ }, ); my ($pod_prefix, $man_prefix) = map { ($_->perldoc_url_prefix, $_->man_url_prefix) } Pod::Markdown->new; my $alt_text_for_urls = 1; # Assume we have a sufficient Pod::Simple version. my ($space, $quot) = map { sprintf '&#x%x;', ord } q[ ], q["]; my @tests = ( # in order of L<> examples in perlpod: ['name', q, qq^[name](${pod_prefix}name)^], ['other module', q, qq^[Other::Pod](${pod_prefix}Other%3A%3APod)^], ['other module, empty text', q<|Other::Pod>, qq^[Other::Pod](${pod_prefix}Other%3A%3APod)^], ['other module/sec, empty text', q<|Other::Pod/sec>, qq^["sec" in Other::Pod](${pod_prefix}Other%3A%3APod#sec)^], ['section in other module', q, qq^["sec" in Other::Pod](${pod_prefix}Other%3A%3APod#sec)^], ['quoted section in other doc', q, qq^["For Loops" in perlsyn](${pod_prefix}perlsyn#For${space}Loops)^], ['section in this doc', q, qq^["sec"](#sec)^], ['quoted section in this doc', q, qq^["sec"](#sec)^], ['/sec, empty text', q<|/sec>, qq^["sec"](#sec)^], ['other module, alternate text', q, qq^[other-pod](${pod_prefix}Other%3A%3APod)^], ['sec in other mod, alt text', q, qq^[x-sec](${pod_prefix}Other%3A%3APod#sec)^], ['"sec" in other mod, alt text', q, qq^[x-sec](${pod_prefix}Other%3A%3APod#sec)^], ['/"sec" in this doc, alt text', q, qq^[other-sec](#sec)^], ['/sec in this doc, alt text', q, qq^[other-sec](#sec)^], ['"sec" in this doc, alt text', q, qq^[other-sec](#sec)^], ['external ftp', q, qq^[ftp://server](ftp://server)^], ['external http', q, qq^[http://website](http://website)^], ['http, alt text (perl 5.12)', q, qq^[web](http://website)^], ['embedded codes', q^the docs on C<$.>|perlvar/"$."^, qq^[the docs on `\$.`](${pod_prefix}perlvar#\$.)^], ["don't expand nested L's", q^perlpodspec/"About LE...E Codes"^, qq^["About L<...> Codes" in perlpodspec](${pod_prefix}perlpodspec#About${space}L<...>${space}Codes)^], # perlpodspec examples: ['name', q, qq^[Foo::Bar](${pod_prefix}Foo%3A%3ABar)^], ['alt|pod/sec', q, qq^[Perlport's section on NL's](${pod_prefix}perlport#Newlines)^], ['pod/sec', q, qq^["Newlines" in perlport](${pod_prefix}perlport#Newlines)^], ['man/sec', q, qq^["DESCRIPTION" in crontab(5)](${man_prefix}5/crontab)^], ['/section name', q, qq^["Object Attributes"](#Object${space}Attributes)^], ['http', q, qq^[http://www.perl.org/](http://www.perl.org/)^], ['text|http', q, qq^[Perl.org](http://www.perl.org/)^], # man pages ['man(1)', q, qq^[crontab(1)](${man_prefix}1/crontab)^], ['man(5)', q, qq^[crontab(5)](${man_prefix}5/crontab)^], # how should these be handled? these are unlikely/contrived occurrences and are mostly here for test coverage #['man()', q, qq^[crontab()](${man_prefix}1/crontab)^], #['man(X)', q, qq^[crontab(X)](${man_prefix}X/crontab)^], #['man(2)-page', q, qq^[crontab(2)-page](${man_prefix}2/crontab)^], #['(X)man', q<(X)foo>, qq^[(X)foo](${man_prefix}1/(X)foo)^], #['()', q<()>, qq^[()](${man_prefix}1/())^], # varies according to pod-to-html formatter: ['other/section name', q, qq^["Section Name" in Other](${pod_prefix}Other#Section${space}Name)^], # Insert backslashes (to escape markdown). ['_underscore_', q<_underscore_>, qq^[\\_underscore\\_](${pod_prefix}_underscore_)^], ['*asterisk*', q<*asterisk*>, qq^[\\*asterisk\\*](${pod_prefix}%2Aasterisk%2A)^], ['section with quotes', q, qq^[whiskey](#Say${space}${quot}Cheese${quot})^], # is there something better to do? # These seem so useless I don't think I care what they do. #['no url: empty', q<>, qq^L<>^], # FIXME: Error # These work on 3.28 but not on 3.16: #['no url: pipe', q<|>, qq^L<|>^], #['no url: slash', q, qq^L^], #['no url: quotes', q<"">, qq^L<"">^], ['empty text: |url', q<|http://foo>, qq^[http://foo](http://foo)^], ['false text: 0|url', q<0|http://foo>, qq^[0](http://foo)^], # Alternate parser options: ['man url', q, qq^[crontab(1)](file:///docs/man1/crontab)^, man_url_prefix => 'file:///docs/man'], ['man alias: manny', q, qq^[crontab(1)](http://manny.local/page/1/crontab)^, man_url_prefix => 'manny'], ['man alias: man', q, qq^[crontab(1)](http://man.he.net/man1/crontab)^, man_url_prefix => 'man'], ['pod url', q, qq^[Foo::Bar](http://localhost/pod/Foo%3A%3ABar)^, perldoc_url_prefix => 'http://localhost/pod/'], ['pod alias: sco', q, qq^[Foo::Bar](http://search.cpan.org/perldoc?Foo%3A%3ABar)^, perldoc_url_prefix => 'sco'], ['pod alias: metacpan', q, qq^[Foo::Bar](https://metacpan.org/pod/Foo%3A%3ABar)^, perldoc_url_prefix => 'metacpan'], ['pod alias: perldoc', q, qq^[Foo::Bar](https://metacpan.org/pod/Foo%3A%3ABar)^, perldoc_url_prefix => 'perldoc'], ); # Local Module URLs { my $p = {}; #'<,'>perldo if (s/^\[|\],$//g){ $a = [map { s/^\s+|\s+$//gr } split /,/, $_, 4]; @$a > 2 and $_ = " test_link({$a->[3]}, $a->[1], $a->[2], $a->[0]);" } test_link($p, q, qq^[Local::Foo](${pod_prefix}Local%3A%3AFoo)^, 'Local::* defaults to perldoc'); test_link($p, q, qq^[Foo\\_Corp::Bar](${pod_prefix}Foo_Corp%3A%3ABar)^, 'Foo_Corp::* defaults to perldoc'); $p->{perldoc_url_prefix} = 'perldoc://'; test_link($p, q, qq^[Local::Foo](perldoc://Local%3A%3AFoo)^, 'local module without custom url respects perldoc_url_prefix'); $p->{local_module_url_prefix} = 'local://'; test_link($p, q, qq^[Local::Foo](local://Local%3A%3AFoo)^, 'Local::* custom url'); test_link($p, q, qq^[Foo\\_Corp::Bar](local://Foo_Corp%3A%3ABar)^, 'Foo_Corp::* custom url'); test_link($p, q, qq^[Normal::Foo](perldoc://Normal%3A%3AFoo)^, 'non local module'); $p->{local_module_re} = qr/Normal/; test_link($p, q, qq^[Normal::Foo](local://Normal%3A%3AFoo)^, 'Normal::* with custom RE'); test_link($p, q, qq^[NonLocal::Foo](perldoc://NonLocal%3A%3AFoo)^, 'NonLocal* with custom RE'); test_link($p, q, qq^[Local::Foo](perldoc://Local%3A%3AFoo)^, 'even Local::* uses perldoc when custom re does not match'); $p = {local_module_url_prefix => ''}; test_link($p, q, qq^[Local::Foo::Bar](Local%3A%3AFoo%3A%3ABar)^, 'local module with empty prefix'); } # Most of these examples were internal links # so we add the perldoc name to make testing easier. test_fragments( q^perlvar/$.^, { # It's unfortunate that Pod::Simple::XHTML can't do links to just symbols: # https://rt.cpan.org/Ticket/Display.html?id=90207 metacpan => q^["$." in perlvar](:perlvar#pod)^, sco => q^["$." in perlvar](:perlvar#$.)^, }, 'section with only symbols', ); test_fragments( q^perlop/"IEO Operators"^, { metacpan => q^["I/O Operators" in perlop](:perlop#I-O-Operators)^, sco => q^["I/O Operators" in perlop](:perlop#I/O_Operators)^, }, 'perlvar.pod: external section with symbols', ); test_fragments( q^perlpodspec/"About LE...E Codes"^, { metacpan => q^["About L<...> Codes" in perlpodspec](:perlpodspec#About-L...-Codes)^, sco => q^["About L<...> Codes" in perlpodspec](:perlpodspec#About_L<...>_Codes)^, markdown => q^["About L<...> Codes" in perlpodspec](:perlpodspec#about-l-codes)^, }, 'section with pod escapes', ); test_fragments( q^perlpodspec/About Data Paragraphs and "=beginE=end" Regions^, { metacpan => q^["About Data Paragraphs and "=begin/=end" Regions" in perlpodspec](:perlpodspec#About-Data-Paragraphs-and-begin-end-Regions)^, sco => qq^["About Data Paragraphs and "=begin/=end" Regions" in perlpodspec](:perlpodspec#About_Data_Paragraphs_and_${quot}=begin/=end${quot}_Regions)^, }, 'section with pod commands', ); test_fragments( q^detach|Catalyst/"$c->detach( $action [, \@arguments ] )"^, { metacpan => q^[detach](:Catalyst#c-detach-action-arguments)^, sco => q^[detach](:Catalyst#$c->detach\(_$action_[,_\\\\@arguments_]_\))^, }, 'section with sigils and syntax', ); test_fragments( q^perlpod/"Formatting Codes"^, { metacpan => q^["Formatting Codes" in perlpod](:perlpod#Formatting-Codes)^, sco => q^["Formatting Codes" in perlpod](:perlpod#Formatting_Codes)^, }, 'quoted section in other doc', ); test_fragments( q, { markdown => q^["Some, OTHER Section!"](#some-other-section)^, }, 'complicated section', ); test_fragments( q, { markdown => qq^["If you have a setup working, share your 'definition' with me. That would be fun!"](#if-you-have-a-setup-working-share-your-definition-with-me-that-would-be-fun)^, }, 'extra long real life example complicated section', ); test_fragments( q
, { metacpan => q^[A \\[charclass\\] is \\\\\\* bad](:page#section-with-Parens-and-Escapes-star)^, sco => qq^[A \\[charclass\\] is \\\\\\* bad](:page#section_with_\\(Parens\\)_and_\\\\Escapes_*star*)^, }, 'extra long real life example complicated section', ); with_and_without_entities { my $ents = shift; my $exp = $ents ? '101' : 'x65'; test_fragments( q, { metacpan => qq^["s&#${exp};ction" in pag&#${exp};](:page#section)^, sco => qq^["s&#${exp};ction" in pag&#${exp};](:page#section)^, }, "respect html_encode_chars in code link text but not in fragment (HTML::Entites $ents)", html_encode_chars => 'e', ); }; foreach my $test ( @tests ){ my ($desc, $pod, $mkdn, %opts) = @$test; %opts = %defaults unless %opts; test_link( \%opts, $pod, $mkdn, $desc, ); } sub test_link { my ($opts, $pod, $mkdn, $desc) = @_; my $parser = Pod::Markdown->new(%$opts); SKIP: { skip 'alt text with schemes/absolute URLs not supported until perl 5.12 / Pod::ParseLink 1.10', 1 if !$alt_text_for_urls && $pod =~ m/\|\w+:[^:\s]\S*\z/; # /alt text \| url (not perl module)/ (regexp from perlpodspec) $parser->output_string(\(my $got)); $parser->parse_string_document("=pod\n\nL<<< $pod >>>"); chomp($got); is $got, $mkdn, $desc . ' (interpolate)'; } } sub test_fragments { my ($pod, $tests, $desc, %opts) = @_; foreach my $format ( sort keys %$tests ){ test_link( # Only some combinations of these will normally make sense # but it makes the function reusable. { perldoc_fragment_format => $format, perldoc_url_prefix => ':', # easier markdown_fragment_format => $format, %opts, }, $pod, $tests->{$format}, "$desc: $format", ); } } done_testing; libpod-markdown-perl-3.200000/t/lists.t000066400000000000000000000051721357220324000175600ustar00rootroot00000000000000# vim: set ts=2 sts=2 sw=2 expandtab smarttab: use strict; use warnings; use lib 't/lib'; use MarkdownTests tests => 1; my $parser = Pod::Markdown->new( perldoc_url_prefix => 'pod:', ); $parser->output_string(\my $markdown); $parser->parse_file(\*DATA); # TODO: Verify this list behavior in html and perlpod(spec). my $expect = <<'EOMARKDOWN'; # Lists ## Unordered - This - is - a basic - bulleted item - list - test - and _Italics_, **Bold**, `Code`, and [Links](pod:Links) should work in list item and _in_ **paragraph** `after` [item](pod:item) - verbatim paragraphs need double-indent inside lists ## Unordered nested list **Note:** Markdown does not support definition lists (word => text), just bullets or numbers - Head1 Paragraph should be indented. \* And escaped. - Head2 Paragraph should be indented. - Head1 Paragraph should be indented. ## Unordered nested huddled list - This is a list head. - This is a list head, too. - Again, this is a list head. - Finally, this is also a list head. And - A list item \\with a line that starts with a markdown char. - item 2 ## Ordered 1. B 2. D ## Ordered without dot 1. B 2. D ## No text after number 1. verbatim item EOMARKDOWN # check out Pod::IkiWiki (or something like that)... # the code looks very similar to some of the code in this module # but it appears to have some list processing methods... { eq_or_diff $markdown, $expect, "this file's POD as markdown"; } __DATA__ =head1 Lists =head2 Unordered =over 4 =item * This =item * is =item * a basic =item * bulleted item =item * list =item * test =item * and I, B, C, and L should work in list item and I B C L =item * verbatim paragraphs need double-indent inside lists =back =head2 Unordered nested list B Markdown does not support definition lists (word => text), just bullets or numbers =over 4 =item Head1 Paragraph should be indented. * And escaped. =over 4 =item Head2 Paragraph should be indented. =back =item Head1 Paragraph should be indented. =back =head2 Unordered nested huddled list =over 4 =item * This is a list head. =item * This is a list head, too. =over 4 =item * Again, this is a list head. =back =item * Finally, this is also a list head. =back And =over =item * A list item \with a line that starts with a markdown char. =item * item 2 =back =head2 Ordered =over =item 1. B =item 2. D =back =head2 Ordered without dot =over =item 1 B =item 2 D =back =head2 No text after number =over =item 1 verbatim item =back =cut libpod-markdown-perl-3.200000/t/meta.t000066400000000000000000000031731357220324000173470ustar00rootroot00000000000000# vim: set ts=2 sts=2 sw=2 expandtab smarttab: use strict; use warnings; use lib 't/lib'; use MarkdownTests; my @tests; push @tests, ['name', < scalar @tests * 3; foreach my $test ( @tests ) { as_markdown_with_meta(@$test); output_string_include_meta_tags(@$test); both(@$test); } sub as_markdown_with_meta { my ($desc, $pod, $exp, $use_attr) = @_; my $parser = Pod::Markdown->new( include_meta_tags => $use_attr, ); $parser->parse_from_filehandle( io_string($pod) ); my $markdown = $parser->as_markdown(with_meta => ($desc ne 'none')); my $prefix = $use_attr ? 'both' : 'with_meta'; eq_or_diff $markdown, $exp, "${prefix}: $desc"; } sub output_string_include_meta_tags { my ($desc, $pod, $exp) = @_; my $parser = Pod::Markdown->new( include_meta_tags => ($desc ne 'none'), ); $parser->output_string(\(my $markdown)); $parser->parse_string_document($pod); eq_or_diff $markdown, $exp, "include_meta_tags: $desc"; } sub both { as_markdown_with_meta(@_, $_[0] ne 'none'); } libpod-markdown-perl-3.200000/t/misc.t000066400000000000000000000027501357220324000173540ustar00rootroot00000000000000# vim: set ts=2 sts=2 sw=2 expandtab smarttab: use utf8; use strict; use warnings; use lib 't/lib'; use MarkdownTests; convert_ok "C", "```` a ```code``` span ````", 'code span with backticks uses more backticks as delimiter'; # This example is straight from http://daringfireball.net/projects/markdown/syntax#code. convert_ok "C<`>", "`` ` ``", 'multi-backtick delimiters also use spaces so that code spans can start or end with backticks'; convert_ok q{B<< Nested C and I >> work, too}, q{**Nested `codes` and _tags_** work, too}, 'sequences can be nested'; convert_ok q{L<<< FormattZ<>ing Codes|Links/"LE...E" >>>}, q{[Formatting `C`odes](pod://Links#L<...>)}, 'pod sequences in link text'; convert_ok( <, B, C, and L should work in headers I, B, C, and L should work in body text. POD < Quote some poetry > or say something special. MKDN 'over/back becomes block quote'; convert_ok < C<< E >> codes POD < C<< E >> codes MKDN ''; done_testing; libpod-markdown-perl-3.200000/t/nested.t000066400000000000000000000021221357220324000176740ustar00rootroot00000000000000# vim: set ts=2 sts=2 sw=2 expandtab smarttab: use strict; use warnings; use lib 't/lib'; use MarkdownTests; # TODO: Test everything beneath a numbered list and inside a blockquote. convert_ok( <<'POD', =over =item 1. lizard =item 2. bird =over =item 1. duck =item 2. penguin =item 3. turkey gobble gobble. =item 4. eagle =back =item 3. bear =over =item 1. grizzly =item 2. polar =over =item 1. angry =item 2. sleepy =back =back =back POD <<'MKDN', 1. lizard 2. bird 1. duck 2. penguin 3. turkey gobble gobble. 4. eagle 3. bear 1. grizzly 2. polar 1. angry 2. sleepy MKDN 'indent content of numbered list items', ); convert_ok( # NOTE: Pod::Simple considers a heading inside over/back an error. <<'POD', =over Quote: =over line 1 line 2 =over =item * a =over =item * b para verbatim =back =back =back =back POD <<'MKDN', > Quote: > > > line 1 > > line 2 > > > > - a > > - b > > > > para > > > > verbatim MKDN 'test nesting inside blockquotes' ); done_testing; libpod-markdown-perl-3.200000/t/new.t000066400000000000000000000035331357220324000172120ustar00rootroot00000000000000# vim: set ts=2 sts=2 sw=2 expandtab smarttab: use strict; use warnings; use lib 't/lib'; use MarkdownTests; sub test_args { my $desc = pop; my $args = shift || {}; my %exp = ( man_url_prefix => $Pod::Markdown::URL_PREFIXES{man}, perldoc_url_prefix => $Pod::Markdown::URL_PREFIXES{metacpan}, perldoc_fragment_format => 'metacpan', markdown_fragment_format => 'markdown', @_ ? %{ $_[0] } : () ); my $parser = Pod::Markdown->new(%$args); foreach my $attr ( sort keys %exp ){ is $parser->$attr, $exp{$attr}, "$desc: $attr"; } } test_args 'Default attributes'; foreach my $site ( qw( metacpan sco ) ){ test_args { perldoc_url_prefix => $site }, { perldoc_url_prefix => $Pod::Markdown::URL_PREFIXES{$site}, perldoc_fragment_format => $site, }, "Set perldoc_url_prefix to $site; get matching fragment format"; } foreach my $format ( map { 'pod_simple_' . $_ } qw( xhtml html ) ){ test_args { perldoc_fragment_format => $format }, { perldoc_fragment_format => $format }, "Explicit format $format"; } foreach my $fragtype ( map { $_ . '_fragment_format' } qw( perldoc markdown ) ){ my $sub = sub { 'blah' }; test_args { $fragtype => $sub }, { $fragtype => $sub }, "Pass a code ref for $fragtype"; } test_args { markdown_fragment_format => 'pod_simple_html', perldoc_fragment_format => 'markdown', }, { markdown_fragment_format => 'pod_simple_html', perldoc_fragment_format => 'markdown', }, 'Values are interchangeable'; # TODO: Change this to an error after a sufficient amount of time. like warning { Pod::Markdown->new(unknown_arg => 1); }, qr/unknown_arg/, 'unknown arg throws a warning'; like warning { Pod::Markdown->new(encoding => 'oops'); }, qr/encoding/, 'method that is not a rw attribute throws a warning'; done_testing; libpod-markdown-perl-3.200000/t/perldoc.t000066400000000000000000000011271357220324000200460ustar00rootroot00000000000000# vim: set ts=2 sts=2 sw=2 expandtab smarttab: use strict; use warnings; use lib 't/lib'; use MarkdownTests; use Pod::Perldoc::ToMarkdown; use File::Temp qw{ tempfile }; # core use File::Spec::Functions qw( catfile ); # core my ($tmp_out, $outfile) = tempfile( 'pod2markdown-out.XXXXXX', TMPDIR => 1, UNLINK => 1 ); print $tmp_out "overwrite me\n"; close $tmp_out; sub corpus { catfile( corpus => $_[0] ); } Pod::Perldoc::ToMarkdown->parse_from_file( corpus('copy.pod'), $outfile); like slurp_file($outfile), qr/# cr\n\n\{ \\`\xc2\xa9\\` \}/, 'ToMarkdown class for perldoc'; done_testing; libpod-markdown-perl-3.200000/t/pod2markdown.t000066400000000000000000000050741357220324000210320ustar00rootroot00000000000000# vim: set ts=2 sts=2 sw=2 expandtab smarttab: use strict; use warnings; use lib 't/lib'; use MarkdownTests; use File::Temp qw{ tempfile }; # core use File::Spec::Functions qw( catfile ); # core my ($lib, $bin) = scalar(grep { /\bblib\Wlib$/ } @INC) ? ('blib/lib', 'blib/script') : ('lib', 'bin'); my $script = catfile($bin, qw(pod2markdown)); my ($tmp_in, $infile) = tempfile( 'pod2markdown-in.XXXXXX', TMPDIR => 1, UNLINK => 1 ); print $tmp_in "=head1 Temp\n\nI\n"; close $tmp_in; my ($tmp_out, $outfile) = tempfile( 'pod2markdown-out.XXXXXX', TMPDIR => 1, UNLINK => 1 ); print $tmp_out "overwrite me\n"; close $tmp_out; sub corpus { catfile( corpus => $_[0] ); } # I tried this with IPC::Open2, but windows hangs waiting for more ... sub pod2markdown { my ($args, $exp, $desc) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; unshift @$args, $^X, "-I$lib", $script; { open(my $fh, '>', $outfile) or die "Failed to open $outfile: $!"; print $fh "oops\n"; close $fh; } is slurp_file($outfile), "oops\n", 'output file prepared'; system(join ' ', map { length($_) > 1 ? qq["$_"] : $_ } @$args); is slurp_file($outfile), $exp, $desc; } { sub testp2m { splice @_, 1, 0, "# Temp\n\n_File_\n"; goto &pod2markdown; } testp2m( ['<', $infile, '>', $outfile], 'no args: < in > out', ); testp2m( [$infile, '>', $outfile], '1 arg: input file, stdout', ); testp2m( [$infile, $outfile], '2 args: input file, output file', ); testp2m( ['-', $outfile, '<', $infile], '2 args: - (stdin), output file', ); testp2m( ['-', '-', '<', $infile, '>', $outfile], 'both dashes: - (stdin) - (stdout)', ); } { my $in = corpus('copy.pod'); my @args = ($in, $outfile); my $exp = sub { sprintf "# cr\n\n{ \\`%s\\` }\n", $_[0] }; pod2markdown( [@args], $exp->("\xc2\xa9"), 'no encoding specified returns UTF-8', ); pod2markdown( ['--html-encode-chars=1', @args], $exp->("©"), 'html_encode_chars=1 encodes entities', ); pod2markdown( ['-e', 'ascii', @args], $exp->("©"), 'ascii encoding returns ascii with html entities encoded', ); pod2markdown( ['--output-encoding=utf-8', @args], $exp->("\xc2\xa9"), 'specify utf-8 output encoding', ); pod2markdown( ['--match-encoding', corpus('lit-cp1252-enc.pod'), $outfile], $exp->("\xa9"), 'match input cp1252', ); pod2markdown( ['-m', corpus('lit-utf8-enc.pod'), $outfile], $exp->("\xc2\xa9"), 'match input utf-8', ); } done_testing; libpod-markdown-perl-3.200000/t/verbatim.t000066400000000000000000000033361357220324000202330ustar00rootroot00000000000000# vim: set ts=2 sts=2 sw=2 expandtab smarttab: use strict; use warnings; use lib 't/lib'; use MarkdownTests tests => 1; my $parser = Pod::Markdown->new; $parser->output_string(\my $markdown); $parser->parse_file(\*DATA); my $expect = <<'EOMARKDOWN'; # SYNOPSIS # 4 spaces # should come out the same # TABS These tabs will be expanded. # 3 SPACES 3 spaces should be converted to 4. Here, too And also here. # MIXED (You don't really want to do that, though, do you?) Mixed paragraphs should all get the same indentation added to preserve the formatting: 4 spaces (+ 2 = 6) a tab 3 spaces (+ 2 = 5) 2 spaces (+ 2 = 4) (the minimum) # 5 spaces Because you can if you want to # 1 space a little short, but valid # indented blank lines one two three four # nonindented blank lines one two three four # THAT'S ENOUGH EOMARKDOWN eq_or_diff $markdown, $expect, 'preserve verbatim paragraphs of various initial whitespace combinations'; __DATA__ =head1 SYNOPSIS # 4 spaces # should come out the same =head1 TABS These tabs will be expanded. =head1 3 SPACES 3 spaces should be converted to 4. Here, too And also here. =head1 MIXED (You don't really want to do that, though, do you?) Mixed paragraphs should all get the same indentation added to preserve the formatting: 4 spaces (+ 2 = 6) a tab 3 spaces (+ 2 = 5) 2 spaces (+ 2 = 4) (the minimum) =head1 5 spaces Because you can if you want to =head1 1 space a little short, but valid =head1 indented blank lines one two three four =head1 nonindented blank lines one two three four =head1 THAT'S ENOUGH =cut libpod-markdown-perl-3.200000/xt/000077500000000000000000000000001357220324000164205ustar00rootroot00000000000000libpod-markdown-perl-3.200000/xt/author/000077500000000000000000000000001357220324000177225ustar00rootroot00000000000000libpod-markdown-perl-3.200000/xt/author/critic.t000066400000000000000000000002011357220324000213550ustar00rootroot00000000000000#!perl use strict; use warnings; use Test::Perl::Critic (-profile => "perlcritic.rc") x!! -e "perlcritic.rc"; all_critic_ok(); libpod-markdown-perl-3.200000/xt/author/eol.t000066400000000000000000000013201357220324000206620ustar00rootroot00000000000000use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::EOL 0.19 use Test::More 0.88; use Test::EOL; my @files = ( 'bin/pod2markdown', 'lib/Pod/Markdown.pm', 'lib/Pod/Perldoc/ToMarkdown.pm', 't/00-compile.t', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/back-compat.t', 't/basic.t', 't/codes.t', 't/encoding.t', 't/entities.t', 't/escape.t', 't/formats.t', 't/lib/MarkdownTests.pm', 't/links.t', 't/lists.t', 't/meta.t', 't/misc.t', 't/nested.t', 't/new.t', 't/perldoc.t', 't/pod2markdown.t', 't/verbatim.t' ); eol_unix_ok($_, { trailing_whitespace => 0 }) foreach @files; done_testing; libpod-markdown-perl-3.200000/xt/author/minimum-version.t000066400000000000000000000001521357220324000232430ustar00rootroot00000000000000use strict; use warnings; use Test::More; use Test::MinimumVersion; all_minimum_version_ok( qq{5.008} ); libpod-markdown-perl-3.200000/xt/author/mojibake.t000066400000000000000000000001511357220324000216650ustar00rootroot00000000000000#!perl use strict; use warnings qw(all); use Test::More; use Test::Mojibake; all_files_encoding_ok(); libpod-markdown-perl-3.200000/xt/author/no-tabs.t000066400000000000000000000012661357220324000214570ustar00rootroot00000000000000use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.15 use Test::More 0.88; use Test::NoTabs; my @files = ( 'bin/pod2markdown', 'lib/Pod/Markdown.pm', 'lib/Pod/Perldoc/ToMarkdown.pm', 't/00-compile.t', 't/00-report-prereqs.dd', 't/00-report-prereqs.t', 't/back-compat.t', 't/basic.t', 't/codes.t', 't/encoding.t', 't/entities.t', 't/escape.t', 't/formats.t', 't/lib/MarkdownTests.pm', 't/links.t', 't/lists.t', 't/meta.t', 't/misc.t', 't/nested.t', 't/new.t', 't/perldoc.t', 't/pod2markdown.t', 't/verbatim.t' ); notabs_ok($_) foreach @files; done_testing; libpod-markdown-perl-3.200000/xt/author/pod-coverage.t000066400000000000000000000003341357220324000224620ustar00rootroot00000000000000#!perl # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. use Test::Pod::Coverage 1.08; use Pod::Coverage::TrustPod; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); libpod-markdown-perl-3.200000/xt/author/pod-syntax.t000066400000000000000000000002521357220324000222140ustar00rootroot00000000000000#!perl # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); libpod-markdown-perl-3.200000/xt/author/portability.t000066400000000000000000000002671357220324000224560ustar00rootroot00000000000000use strict; use warnings; use Test::More; eval 'use Test::Portability::Files'; plan skip_all => 'Test::Portability::Files required for testing portability' if $@; run_tests(); libpod-markdown-perl-3.200000/xt/author/synopsis.t000066400000000000000000000000601357220324000217720ustar00rootroot00000000000000#!perl use Test::Synopsis; all_synopsis_ok(); libpod-markdown-perl-3.200000/xt/author/test-version.t000066400000000000000000000006371357220324000225570ustar00rootroot00000000000000use strict; use warnings; use Test::More; # generated by Dist::Zilla::Plugin::Test::Version 1.09 use Test::Version; my @imports = qw( version_all_ok ); my $params = { is_strict => 0, has_version => 1, multiple => 0, }; push @imports, $params if version->parse( $Test::Version::VERSION ) >= version->parse('1.002'); Test::Version->import(@imports); version_all_ok; done_testing; libpod-markdown-perl-3.200000/xt/release/000077500000000000000000000000001357220324000200405ustar00rootroot00000000000000libpod-markdown-perl-3.200000/xt/release/cpan-changes.t000066400000000000000000000003441357220324000225550ustar00rootroot00000000000000use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::CPAN::Changes 0.012 use Test::More 0.96 tests => 1; use Test::CPAN::Changes; subtest 'changes_ok' => sub { changes_file_ok('Changes'); }; libpod-markdown-perl-3.200000/xt/release/dist-manifest.t000066400000000000000000000002301357220324000227670ustar00rootroot00000000000000#!perl use Test::More; eval "use Test::DistManifest"; plan skip_all => "Test::DistManifest required for testing the manifest" if $@; manifest_ok(); libpod-markdown-perl-3.200000/xt/release/distmeta.t000066400000000000000000000001721357220324000220370ustar00rootroot00000000000000#!perl # This file was automatically generated by Dist::Zilla::Plugin::MetaTests. use Test::CPAN::Meta; meta_yaml_ok(); libpod-markdown-perl-3.200000/xt/release/kwalitee.t000066400000000000000000000002751357220324000220360ustar00rootroot00000000000000# this test was generated with Dist::Zilla::Plugin::Test::Kwalitee 2.12 use strict; use warnings; use Test::More 0.88; use Test::Kwalitee 1.21 'kwalitee_ok'; kwalitee_ok(); done_testing; libpod-markdown-perl-3.200000/xt/release/meta-json.t000066400000000000000000000000641357220324000221220ustar00rootroot00000000000000#!perl use Test::CPAN::Meta::JSON; meta_json_ok();