Pod-Elemental-0.103006/000755 000765 000024 00000000000 14354124547 014505 5ustar00rjbsstaff000000 000000 Pod-Elemental-0.103006/LICENSE000644 000765 000024 00000043656 14354124547 015530 0ustar00rjbsstaff000000 000000 This software is copyright (c) 2022 by Ricardo SIGNES. 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) 2022 by Ricardo SIGNES. 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) 2022 by Ricardo SIGNES. 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 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End Pod-Elemental-0.103006/Changes000644 000765 000024 00000007270 14354124547 016006 0ustar00rjbsstaff000000 000000 Revision history for Pod-Elemental 0.103006 2022-12-31 16:28:06-05:00 America/New_York - update packaging and metadata - minimum required Perl is now v5.12 0.103005 2020-01-25 15:53:25-05:00 America/New_York - fix a typo in documentation (thanks, BooK!) 0.103004 2014-12-26 22:31:16-05:00 America/New_York - fix a regression in 0.103003, in which Nonpod paragraphs were not converted into Pod5::Nonpod paragraphs by the Pod5 transformer 0.103003 2014-12-23 21:11:26-05:00 America/New_York - remove use of Moose::Autobox 0.103002 2014-10-27 21:12:54-04:00 America/New_York - make classes immutable to improve runtime speed 0.103001 2014-05-20 20:45:43-04:00 America/New_York - load Class::Load, which older Moose does not automatically load 0.103000 2014-01-12 09:03:06-05:00 America/New_York Pod::Elemental::Document only adds leading =pod or trailing =cut if they are not already present 0.102364 2013-11-28 07:27:08 America/New_York stop using deprecated Class::MOP::load_class 0.102363 2013-10-09 17:15:13 America/New_York update bugtracker and repo metadata 0.102362 2012-05-04 22:42:29 America/New_York do not fail to nestify elements at the end of a sequence just because they couldn't get any new children; it can break things down the line; q.v., [rt.cpan.org #69189] 0.102361 2011-08-05 10:32:02 America/New_York the Pod5 transformer no longer loses vertical whitespace after Data paragraphs 0.102360 2010-08-24 07:52:09 America/New_York avoid a deprecation in Moose 1.10 by using new-style "-excludes" 0.101620 2010-06-11 19:39:05 America/New_York no longer throws exception on empty regions (RT #57834) 0.100220 2010-01-22 10:31:46 America/New_York Autochomp workaround for the loss of "has '+attr'" in roles in new Moose 0.093280 2009-11-24 18:37:04 America/New_York emit a =begin/=end pair instead of =for in more cases where required 0.093000 2009-10-27 correct a regex is format region parsing to allow multiline =for 0.092970 2009-10-24 fix the loss of newlines when combining verbatim paragraphs minor documentation fixes 0.092941 2009-10-21 Pod5 elements now "Autochomp" so their content has no trailing newlin 0.092940 2009-10-21 relatively extensive documentation added improve behavior of =for/=begin/=end stringification no longer convert many subsequent Pod5::Ordinary paras into one 0.092930 2009-10-20 introduce Pod5::Nonpod for self-=cut-enclosing nonpod sections improved output of as_debug_string methods 0.092920 2009-10-19 introduce Pod::Elemental::Transformer::Gatherer refine the criteria for emitting =for instead of =begin/=end pod5 transformer can convert =for into a Region 0.092910 2009-10-18 transformers now operate on nodes, not documents introduce Pod::Elemental::Transformer::Nester introduce Pod::Elemental::Selectors remove more dead code and modules (region-related, mostly) 0.092901 2009-10-17 improve vertical whitespace handling improve as_debug_string 0.092900 2009-10-17 Pod5 support is, at least tentatively, complete 0.092500 2009-09-07 major restructure lots of features removed, but they'll come back 0.091470 2009-05-27 20:43:28 UTC temporary workaround for new Pod::Eventual's "blank" events 0.003 2009-01-31 experimental Document class 0.002 2008-10-25 first release with documentation worth mentioning Pod-Elemental-0.103006/MANIFEST000644 000765 000024 00000003027 14354124547 015640 0ustar00rjbsstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.029. Changes LICENSE MANIFEST META.json META.yml Makefile.PL README dist.ini eg/demo-pod eg/pod-debug lib/Pod/Elemental.pm lib/Pod/Elemental/Autoblank.pm lib/Pod/Elemental/Autochomp.pm lib/Pod/Elemental/Command.pm lib/Pod/Elemental/Document.pm lib/Pod/Elemental/Element/Generic/Blank.pm lib/Pod/Elemental/Element/Generic/Command.pm lib/Pod/Elemental/Element/Generic/Nonpod.pm lib/Pod/Elemental/Element/Generic/Text.pm lib/Pod/Elemental/Element/Nested.pm lib/Pod/Elemental/Element/Pod5/Command.pm lib/Pod/Elemental/Element/Pod5/Data.pm lib/Pod/Elemental/Element/Pod5/Nonpod.pm lib/Pod/Elemental/Element/Pod5/Ordinary.pm lib/Pod/Elemental/Element/Pod5/Region.pm lib/Pod/Elemental/Element/Pod5/Verbatim.pm lib/Pod/Elemental/Flat.pm lib/Pod/Elemental/Node.pm lib/Pod/Elemental/Objectifier.pm lib/Pod/Elemental/Paragraph.pm lib/Pod/Elemental/Selectors.pm lib/Pod/Elemental/Transformer.pm lib/Pod/Elemental/Transformer/Gatherer.pm lib/Pod/Elemental/Transformer/Nester.pm lib/Pod/Elemental/Transformer/Pod5.pm lib/Pod/Elemental/Types.pm t/00-report-prereqs.dd t/00-report-prereqs.t t/eg/Simple.pm t/eg/from-lol.pod t/eg/nested-begin.pod t/eg/nested-over.pod t/eg/one-with-everything.pod t/elem/nested.t t/elemental.t t/from-lol.t t/gather.t t/nester.t t/objectifier.t t/pod5/combine.t t/pod5/cut.t t/pod5/data-blanks.t t/pod5/for-begin.t t/pod5/nested-same.t t/pod5/nonpod.t t/pod5/region.t t/pod5/text-type.t t/selectors.t t/types.t xt/author/pod-syntax.t xt/release/changes_has_content.t Pod-Elemental-0.103006/t/000755 000765 000024 00000000000 14354124547 014750 5ustar00rjbsstaff000000 000000 Pod-Elemental-0.103006/xt/000755 000765 000024 00000000000 14354124547 015140 5ustar00rjbsstaff000000 000000 Pod-Elemental-0.103006/README000644 000765 000024 00000000563 14354124547 015371 0ustar00rjbsstaff000000 000000 This archive contains the distribution Pod-Elemental, version 0.103006: work with nestable Pod elements This software is copyright (c) 2022 by Ricardo SIGNES. 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.029. Pod-Elemental-0.103006/META.yml000644 000765 000024 00000030216 14354124547 015760 0ustar00rjbsstaff000000 000000 --- abstract: 'work with nestable Pod elements' author: - 'Ricardo SIGNES ' build_requires: Data::Dumper: '0' ExtUtils::MakeMaker: '0' File::Spec: '0' Test::Deep: '0' Test::Differences: '0' Test::More: '0.96' configure_requires: ExtUtils::MakeMaker: '6.78' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.029, 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-Elemental requires: Class::Load: '0' Encode: '0' List::Util: '1.33' Mixin::Linewise::Readers: '0' Moose: '0' Moose::Role: '0.90' MooseX::Types: '0' MooseX::Types::Moose: '0' Pod::Eventual::Simple: '0.004' String::RewritePrefix: '0' String::Truncate: '0' Sub::Exporter: '0' Sub::Exporter::ForMethods: '0' namespace::autoclean: '0' perl: '5.012' strict: '0' utf8: '0' warnings: '0' resources: bugtracker: https://github.com/rjbs/Pod-Elemental/issues homepage: https://github.com/rjbs/Pod-Elemental repository: https://github.com/rjbs/Pod-Elemental.git version: '0.103006' x_Dist_Zilla: perl: version: '5.037002' plugins: - class: Dist::Zilla::Plugin::Git::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: [] exclude_match: [] follow_symlinks: 0 include_dotfiles: 0 prefix: '' prune_directory: [] root: . Dist::Zilla::Plugin::Git::GatherDir: include_untracked: 0 name: '@RJBS/Git::GatherDir' version: '2.048' - class: Dist::Zilla::Plugin::CheckPrereqsIndexed name: '@RJBS/CheckPrereqsIndexed' version: '0.021' - class: Dist::Zilla::Plugin::CheckExtraTests name: '@RJBS/CheckExtraTests' version: '0.029' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 0 check_all_prereqs: 0 modules: - Dist::Zilla::PluginBundle::RJBS phase: build run_under_travis: 0 skip: [] name: '@RJBS/RJBS-Outdated' version: '0.057' - class: Dist::Zilla::Plugin::PromptIfStale config: Dist::Zilla::Plugin::PromptIfStale: check_all_plugins: 1 check_all_prereqs: 0 modules: [] phase: release run_under_travis: 0 skip: - Dist::Zilla::Plugin::RJBSMisc name: '@RJBS/CPAN-Outdated' version: '0.057' - class: Dist::Zilla::Plugin::PruneCruft name: '@RJBS/@Filter/PruneCruft' version: '6.029' - class: Dist::Zilla::Plugin::ManifestSkip name: '@RJBS/@Filter/ManifestSkip' version: '6.029' - class: Dist::Zilla::Plugin::MetaYAML name: '@RJBS/@Filter/MetaYAML' version: '6.029' - class: Dist::Zilla::Plugin::License name: '@RJBS/@Filter/License' version: '6.029' - class: Dist::Zilla::Plugin::Readme name: '@RJBS/@Filter/Readme' version: '6.029' - class: Dist::Zilla::Plugin::ExecDir name: '@RJBS/@Filter/ExecDir' version: '6.029' - class: Dist::Zilla::Plugin::ShareDir name: '@RJBS/@Filter/ShareDir' version: '6.029' - class: Dist::Zilla::Plugin::Manifest name: '@RJBS/@Filter/Manifest' version: '6.029' - class: Dist::Zilla::Plugin::TestRelease name: '@RJBS/@Filter/TestRelease' version: '6.029' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@RJBS/@Filter/ConfirmRelease' version: '6.029' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@RJBS/@Filter/UploadToCPAN' version: '6.029' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 9 name: '@RJBS/MakeMaker' version: '6.029' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@RJBS/AutoPrereqs' version: '6.029' - class: Dist::Zilla::Plugin::Git::NextVersion config: Dist::Zilla::Plugin::Git::NextVersion: first_version: '0.001' version_by_branch: 1 version_regexp: (?^:^([0-9]+\.[0-9]+)$) Dist::Zilla::Role::Git::Repo: git_version: 2.38.0 repo_root: . name: '@RJBS/Git::NextVersion' version: '2.048' - class: Dist::Zilla::Plugin::PkgVersion name: '@RJBS/PkgVersion' version: '6.029' - class: Dist::Zilla::Plugin::MetaConfig name: '@RJBS/MetaConfig' version: '6.029' - class: Dist::Zilla::Plugin::MetaJSON name: '@RJBS/MetaJSON' version: '6.029' - class: Dist::Zilla::Plugin::NextRelease name: '@RJBS/NextRelease' version: '6.029' - class: Dist::Zilla::Plugin::Test::ChangesHasContent name: '@RJBS/Test::ChangesHasContent' version: '0.011' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@RJBS/PodSyntaxTests' version: '6.029' - class: Dist::Zilla::Plugin::Test::ReportPrereqs name: '@RJBS/Test::ReportPrereqs' version: '0.028' - class: Dist::Zilla::Plugin::Git::Remote::Check name: '@RJBS/Git::Remote::Check' version: 0.1.2 - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: '@RJBS/TestMoreWithSubtests' version: '6.029' - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: config_plugins: - '@RJBS' finder: - ':InstallModules' - ':ExecFiles' plugins: - class: Pod::Weaver::Plugin::EnsurePod5 name: '@CorePrep/EnsurePod5' version: '4.018' - class: Pod::Weaver::Plugin::H1Nester name: '@CorePrep/H1Nester' version: '4.018' - class: Pod::Weaver::Plugin::SingleEncoding name: '@RJBS/SingleEncoding' version: '4.018' - class: Pod::Weaver::Section::Name name: '@RJBS/Name' version: '4.018' - class: Pod::Weaver::Section::Version name: '@RJBS/Version' version: '4.018' - class: Pod::Weaver::Section::Region name: '@RJBS/Prelude' version: '4.018' - class: Pod::Weaver::Section::Generic name: '@RJBS/Synopsis' version: '4.018' - class: Pod::Weaver::Section::Generic name: '@RJBS/Description' version: '4.018' - class: Pod::Weaver::Section::Generic name: '@RJBS/Overview' version: '4.018' - class: Pod::Weaver::Section::Generic name: '@RJBS/Stability' version: '4.018' - class: Pod::Weaver::Section::GenerateSection name: '@RJBS/PerlSupport' version: '4.018' - class: Pod::Weaver::Section::Collect name: Attributes version: '4.018' - class: Pod::Weaver::Section::Collect name: Methods version: '4.018' - class: Pod::Weaver::Section::Collect name: Functions version: '4.018' - class: Pod::Weaver::Section::Leftovers name: '@RJBS/Leftovers' version: '4.018' - class: Pod::Weaver::Section::Region name: '@RJBS/postlude' version: '4.018' - class: Pod::Weaver::Section::Authors name: '@RJBS/Authors' version: '4.018' - class: Pod::Weaver::Section::Contributors name: '@RJBS/Contributors' version: '0.009' - class: Pod::Weaver::Section::Legal name: '@RJBS/Legal' version: '4.018' - class: Pod::Weaver::Plugin::Transformer name: '@RJBS/List' version: '4.018' name: '@RJBS/PodWeaver' version: '4.009' - class: Dist::Zilla::Plugin::RJBSMisc name: '@RJBS/RJBSMisc' version: '5.020' - class: Dist::Zilla::Plugin::GithubMeta name: '@RJBS/GithubMeta' version: '0.58' - class: Dist::Zilla::Plugin::Git::Check config: Dist::Zilla::Plugin::Git::Check: untracked_files: die Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - dist.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.38.0 repo_root: . name: '@RJBS/@Git/Check' version: '2.048' - class: Dist::Zilla::Plugin::Git::Commit config: Dist::Zilla::Plugin::Git::Commit: add_files_in: [] commit_msg: v%V%n%n%c signoff: 0 Dist::Zilla::Role::Git::DirtyFiles: allow_dirty: - Changes - dist.ini allow_dirty_match: [] changelog: Changes Dist::Zilla::Role::Git::Repo: git_version: 2.38.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@RJBS/@Git/Commit' version: '2.048' - class: Dist::Zilla::Plugin::Git::Tag config: Dist::Zilla::Plugin::Git::Tag: branch: ~ changelog: Changes signed: 0 tag: '0.103006' tag_format: '%v' tag_message: v%V Dist::Zilla::Role::Git::Repo: git_version: 2.38.0 repo_root: . Dist::Zilla::Role::Git::StringFormatter: time_zone: local name: '@RJBS/@Git/Tag' version: '2.048' - class: Dist::Zilla::Plugin::Git::Push config: Dist::Zilla::Plugin::Git::Push: push_to: - 'github :' remotes_must_exist: 0 Dist::Zilla::Role::Git::Repo: git_version: 2.38.0 repo_root: . name: '@RJBS/@Git/Push' version: '2.048' - class: Dist::Zilla::Plugin::Git::Contributors config: Dist::Zilla::Plugin::Git::Contributors: git_version: 2.38.0 include_authors: 0 include_releaser: 1 order_by: name paths: [] name: '@RJBS/Git::Contributors' version: '0.036' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.029' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.029' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.029' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.029' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.029' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.029' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.029' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.029' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.029' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.029' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: 0 version: '6.029' x_contributors: - 'Christian Walde ' - 'Justin Cook ' - 'Karen Etheridge ' - 'Philippe Bruhat (BooK) ' - 'Ricardo Signes ' x_generated_by_perl: v5.37.2 x_rjbs_perl_window: long-term x_serialization_backend: 'YAML::Tiny version 1.73' x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' Pod-Elemental-0.103006/lib/000755 000765 000024 00000000000 14354124547 015253 5ustar00rjbsstaff000000 000000 Pod-Elemental-0.103006/Makefile.PL000644 000765 000024 00000004236 14354124547 016464 0ustar00rjbsstaff000000 000000 # This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.029. use strict; use warnings; use 5.012; use ExtUtils::MakeMaker 6.78; my %WriteMakefileArgs = ( "ABSTRACT" => "work with nestable Pod elements", "AUTHOR" => "Ricardo SIGNES ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => "6.78" }, "DISTNAME" => "Pod-Elemental", "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.012", "NAME" => "Pod::Elemental", "PREREQ_PM" => { "Class::Load" => 0, "Encode" => 0, "List::Util" => "1.33", "Mixin::Linewise::Readers" => 0, "Moose" => 0, "Moose::Role" => "0.90", "MooseX::Types" => 0, "MooseX::Types::Moose" => 0, "Pod::Eventual::Simple" => "0.004", "String::RewritePrefix" => 0, "String::Truncate" => 0, "Sub::Exporter" => 0, "Sub::Exporter::ForMethods" => 0, "namespace::autoclean" => 0, "strict" => 0, "utf8" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "Data::Dumper" => 0, "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "Test::Deep" => 0, "Test::Differences" => 0, "Test::More" => "0.96" }, "VERSION" => "0.103006", "test" => { "TESTS" => "t/*.t t/elem/*.t t/pod5/*.t" } ); my %FallbackPrereqs = ( "Class::Load" => 0, "Data::Dumper" => 0, "Encode" => 0, "ExtUtils::MakeMaker" => 0, "File::Spec" => 0, "List::Util" => "1.33", "Mixin::Linewise::Readers" => 0, "Moose" => 0, "Moose::Role" => "0.90", "MooseX::Types" => 0, "MooseX::Types::Moose" => 0, "Pod::Eventual::Simple" => "0.004", "String::RewritePrefix" => 0, "String::Truncate" => 0, "Sub::Exporter" => 0, "Sub::Exporter::ForMethods" => 0, "Test::Deep" => 0, "Test::Differences" => 0, "Test::More" => "0.96", "namespace::autoclean" => 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); Pod-Elemental-0.103006/eg/000755 000765 000024 00000000000 14354124547 015100 5ustar00rjbsstaff000000 000000 Pod-Elemental-0.103006/META.json000644 000765 000024 00000045715 14354124547 016142 0ustar00rjbsstaff000000 000000 { "abstract" : "work with nestable Pod elements", "author" : [ "Ricardo SIGNES " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.029, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Pod-Elemental", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.78" } }, "develop" : { "requires" : { "Test::More" : "0", "Test::Pod" : "1.41" } }, "runtime" : { "requires" : { "Class::Load" : "0", "Encode" : "0", "List::Util" : "1.33", "Mixin::Linewise::Readers" : "0", "Moose" : "0", "Moose::Role" : "0.90", "MooseX::Types" : "0", "MooseX::Types::Moose" : "0", "Pod::Eventual::Simple" : "0.004", "String::RewritePrefix" : "0", "String::Truncate" : "0", "Sub::Exporter" : "0", "Sub::Exporter::ForMethods" : "0", "namespace::autoclean" : "0", "perl" : "5.012", "strict" : "0", "utf8" : "0", "warnings" : "0" } }, "test" : { "recommends" : { "CPAN::Meta" : "2.120900" }, "requires" : { "Data::Dumper" : "0", "ExtUtils::MakeMaker" : "0", "File::Spec" : "0", "Test::Deep" : "0", "Test::Differences" : "0", "Test::More" : "0.96" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/rjbs/Pod-Elemental/issues" }, "homepage" : "https://github.com/rjbs/Pod-Elemental", "repository" : { "type" : "git", "url" : "https://github.com/rjbs/Pod-Elemental.git", "web" : "https://github.com/rjbs/Pod-Elemental" } }, "version" : "0.103006", "x_Dist_Zilla" : { "perl" : { "version" : "5.037002" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::Git::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [], "exclude_match" : [], "follow_symlinks" : 0, "include_dotfiles" : 0, "prefix" : "", "prune_directory" : [], "root" : "." }, "Dist::Zilla::Plugin::Git::GatherDir" : { "include_untracked" : 0 } }, "name" : "@RJBS/Git::GatherDir", "version" : "2.048" }, { "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed", "name" : "@RJBS/CheckPrereqsIndexed", "version" : "0.021" }, { "class" : "Dist::Zilla::Plugin::CheckExtraTests", "name" : "@RJBS/CheckExtraTests", "version" : "0.029" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 0, "check_all_prereqs" : 0, "modules" : [ "Dist::Zilla::PluginBundle::RJBS" ], "phase" : "build", "run_under_travis" : 0, "skip" : [] } }, "name" : "@RJBS/RJBS-Outdated", "version" : "0.057" }, { "class" : "Dist::Zilla::Plugin::PromptIfStale", "config" : { "Dist::Zilla::Plugin::PromptIfStale" : { "check_all_plugins" : 1, "check_all_prereqs" : 0, "modules" : [], "phase" : "release", "run_under_travis" : 0, "skip" : [ "Dist::Zilla::Plugin::RJBSMisc" ] } }, "name" : "@RJBS/CPAN-Outdated", "version" : "0.057" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@RJBS/@Filter/PruneCruft", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@RJBS/@Filter/ManifestSkip", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@RJBS/@Filter/MetaYAML", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@RJBS/@Filter/License", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::Readme", "name" : "@RJBS/@Filter/Readme", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@RJBS/@Filter/ExecDir", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@RJBS/@Filter/ShareDir", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@RJBS/@Filter/Manifest", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@RJBS/@Filter/TestRelease", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@RJBS/@Filter/ConfirmRelease", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@RJBS/@Filter/UploadToCPAN", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 9 } }, "name" : "@RJBS/MakeMaker", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@RJBS/AutoPrereqs", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::Git::NextVersion", "config" : { "Dist::Zilla::Plugin::Git::NextVersion" : { "first_version" : "0.001", "version_by_branch" : 1, "version_regexp" : "(?^:^([0-9]+\\.[0-9]+)$)" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.38.0", "repo_root" : "." } }, "name" : "@RJBS/Git::NextVersion", "version" : "2.048" }, { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "@RJBS/PkgVersion", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@RJBS/MetaConfig", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@RJBS/MetaJSON", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::NextRelease", "name" : "@RJBS/NextRelease", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::Test::ChangesHasContent", "name" : "@RJBS/Test::ChangesHasContent", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@RJBS/PodSyntaxTests", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs", "name" : "@RJBS/Test::ReportPrereqs", "version" : "0.028" }, { "class" : "Dist::Zilla::Plugin::Git::Remote::Check", "name" : "@RJBS/Git::Remote::Check", "version" : "0.1.2" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "@RJBS/TestMoreWithSubtests", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "config_plugins" : [ "@RJBS" ], "finder" : [ ":InstallModules", ":ExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@CorePrep/EnsurePod5", "version" : "4.018" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@CorePrep/H1Nester", "version" : "4.018" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@RJBS/SingleEncoding", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@RJBS/Name", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@RJBS/Version", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@RJBS/Prelude", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Synopsis", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Description", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Overview", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "@RJBS/Stability", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::GenerateSection", "name" : "@RJBS/PerlSupport", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "Attributes", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "Methods", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "Functions", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@RJBS/Leftovers", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@RJBS/postlude", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@RJBS/Authors", "version" : "4.018" }, { "class" : "Pod::Weaver::Section::Contributors", "name" : "@RJBS/Contributors", "version" : "0.009" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@RJBS/Legal", "version" : "4.018" }, { "class" : "Pod::Weaver::Plugin::Transformer", "name" : "@RJBS/List", "version" : "4.018" } ] } }, "name" : "@RJBS/PodWeaver", "version" : "4.009" }, { "class" : "Dist::Zilla::Plugin::RJBSMisc", "name" : "@RJBS/RJBSMisc", "version" : "5.020" }, { "class" : "Dist::Zilla::Plugin::GithubMeta", "name" : "@RJBS/GithubMeta", "version" : "0.58" }, { "class" : "Dist::Zilla::Plugin::Git::Check", "config" : { "Dist::Zilla::Plugin::Git::Check" : { "untracked_files" : "die" }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "dist.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.38.0", "repo_root" : "." } }, "name" : "@RJBS/@Git/Check", "version" : "2.048" }, { "class" : "Dist::Zilla::Plugin::Git::Commit", "config" : { "Dist::Zilla::Plugin::Git::Commit" : { "add_files_in" : [], "commit_msg" : "v%V%n%n%c", "signoff" : 0 }, "Dist::Zilla::Role::Git::DirtyFiles" : { "allow_dirty" : [ "Changes", "dist.ini" ], "allow_dirty_match" : [], "changelog" : "Changes" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.38.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@RJBS/@Git/Commit", "version" : "2.048" }, { "class" : "Dist::Zilla::Plugin::Git::Tag", "config" : { "Dist::Zilla::Plugin::Git::Tag" : { "branch" : null, "changelog" : "Changes", "signed" : 0, "tag" : "0.103006", "tag_format" : "%v", "tag_message" : "v%V" }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.38.0", "repo_root" : "." }, "Dist::Zilla::Role::Git::StringFormatter" : { "time_zone" : "local" } }, "name" : "@RJBS/@Git/Tag", "version" : "2.048" }, { "class" : "Dist::Zilla::Plugin::Git::Push", "config" : { "Dist::Zilla::Plugin::Git::Push" : { "push_to" : [ "github :" ], "remotes_must_exist" : 0 }, "Dist::Zilla::Role::Git::Repo" : { "git_version" : "2.38.0", "repo_root" : "." } }, "name" : "@RJBS/@Git/Push", "version" : "2.048" }, { "class" : "Dist::Zilla::Plugin::Git::Contributors", "config" : { "Dist::Zilla::Plugin::Git::Contributors" : { "git_version" : "2.38.0", "include_authors" : 0, "include_releaser" : 1, "order_by" : "name", "paths" : [] } }, "name" : "@RJBS/Git::Contributors", "version" : "0.036" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.029" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.029" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : 0 }, "version" : "6.029" } }, "x_contributors" : [ "Christian Walde ", "Justin Cook ", "Karen Etheridge ", "Philippe Bruhat (BooK) ", "Ricardo Signes " ], "x_generated_by_perl" : "v5.37.2", "x_rjbs_perl_window" : "long-term", "x_serialization_backend" : "Cpanel::JSON::XS version 4.30", "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later" } Pod-Elemental-0.103006/dist.ini000644 000765 000024 00000000235 14354124547 016151 0ustar00rjbsstaff000000 000000 name = Pod-Elemental author = Ricardo SIGNES license = Perl_5 copyright_holder = Ricardo SIGNES [@RJBS] perl-window = long-term Pod-Elemental-0.103006/eg/pod-debug000644 000765 000024 00000000371 14354124547 016672 0ustar00rjbsstaff000000 000000 #!perl use strict; use warnings; use lib 'lib'; use Pod::Elemental; use Pod::Elemental::Transformer::Pod5; my $doc = Pod::Elemental::Transformer::Pod5->transform_node( Pod::Elemental->read_file($ARGV[0]), ); print $doc->as_debug_string, "\n"; Pod-Elemental-0.103006/eg/demo-pod000644 000765 000024 00000004556 14354124547 016541 0ustar00rjbsstaff000000 000000 #!perl use strict; use warnings; use Pod::Eventual::Simple; use Pod::Elemental; use Pod::Elemental::Selectors -all; use Pod::Elemental::Transformer::Pod5; use Pod::Elemental::Transformer::Nester; use Pod::Elemental::Transformer::Gatherer; my $str = do { local $/; }; my $document = Pod::Elemental->read_string($str); print "## INPUT DOCUMENT:\n\n"; print $str, "\n\n"; print "## INITIAL DOCUMENT LOAD:\n\n"; print $document->as_debug_string, "\n\n"; Pod::Elemental::Transformer::Pod5->transform_node($document); print "## AFTER TRANSFORM TO POD5:\n\n"; print $document->as_debug_string, "\n\n"; my $nester = Pod::Elemental::Transformer::Nester->new({ top_selector => s_command([ qw(head1 method) ]), content_selectors => [ s_flat, s_command( [ qw(head2 head3 head4 over item back) ]), ], }); my $gatherer = Pod::Elemental::Transformer::Gatherer->new({ gather_selector => s_command([ qw(method) ]), container => Pod::Elemental::Element::Nested->new({ command => 'head1', content => "METHODS\n", }), }); $nester->transform_node($document); print "## AFTER NESTING HEAD1 AND METHOD ELEMENTS:\n\n"; print $document->as_debug_string, "\n\n"; $gatherer->transform_node($document); print "## AFTER GATHERING METHOD ELEMENTS UNDER CONTAINER:\n\n"; print $document->as_debug_string, "\n\n"; $_->command('head2') foreach grep { s_command('method', $_) } @{ $gatherer->container->children }; print "## AFTER TRANSFORMING METHOD ELEMENTS TO HEAD2:\n\n"; print $document->as_debug_string, "\n\n"; print "## FINAL POD OUTPUT:\n\n"; print $document->as_pod_string; __DATA__ =pod Ordinary Paragraph 1.1 =begin :dialect Pod7 This is a paragraph. =image foo =end :dialect =head1 Header 1.1 =head2 Header 2.1 =method foo Ordinary Paragraph 2.1 =over 2 =item * bar =back =head2 Header 2.2 Ordinary Paragraph 2.2 =head3 Header 3.1 =over 4 =item * foo =back =head1 Header 1.2 Ordinary Paragraph 2.3 Ordinary Paragraph 2.4 =begin comments This is a big comment I have to write down. It's not important, but it goes on and on. =end comments =method quux Ordinary Paragraph 2.4 =cut =method quince my $method = $obj->quince(1,2,3); The above will work. The following will not: my $method = $obj->quince(3,2,1); =cut sub quince { my ($self, @args) = @_; die unless increasing(@args); return ordinality(@args); } =pod Is that clear? Pod-Elemental-0.103006/lib/Pod/000755 000765 000024 00000000000 14354124547 015775 5ustar00rjbsstaff000000 000000 Pod-Elemental-0.103006/lib/Pod/Elemental.pm000644 000765 000024 00000014651 14354124547 020250 0ustar00rjbsstaff000000 000000 package Pod::Elemental 0.103006; # ABSTRACT: work with nestable Pod elements use Moose; use namespace::autoclean; use Sub::Exporter::ForMethods (); use Mixin::Linewise::Readers { installer => Sub::Exporter::ForMethods::method_installer }, -readers; use MooseX::Types; use Pod::Eventual::Simple 0.004; # nonpod events use Pod::Elemental::Document; use Pod::Elemental::Transformer::Pod5; use Pod::Elemental::Objectifier; #pod =head1 DESCRIPTION #pod #pod Pod::Elemental is a system for treating a Pod (L) documents as trees of elements. This model may be #pod familiar from many other document systems, especially the HTML DOM. #pod Pod::Elemental's document object model is much less sophisticated than the HTML #pod DOM, but still makes a lot of document transformations easy. #pod #pod In general, you'll want to read in a Pod document and then perform a number of #pod prepackaged transformations on it. The most common of these will be the L, which assumes that the basic #pod meaning of Pod commands described in the Perl 5 documentation hold: C<=begin>, #pod C<=end>, and C<=for> commands mark regions of the document, leading whitespace #pod marks a verbatim paragraph, and so on. The Pod5 transformer also eliminates #pod the need to track elements representing vertical whitespace. #pod #pod =head1 SYNOPSIS #pod #pod use Pod::Elemental; #pod use Pod::Elemental::Transformer::Pod5; #pod #pod my $document = Pod::Elemental->read_file('lib/Pod/Elemental.pm'); #pod #pod Pod::Elemental::Transformer::Pod5->new->transform_node($document); #pod #pod print $document->as_debug_string, "\n"; # quick overview of doc structure #pod #pod print $document->as_pod_string, "\n"; # reproduce the document in Pod #pod #pod =method read_handle #pod #pod =method read_file #pod #pod =method read_string #pod #pod These methods read the given input and return a Pod::Elemental::Document. #pod #pod =cut sub read_handle { my ($self, $handle) = @_; $self = $self->new unless ref $self; my $events = $self->event_reader->read_handle($handle); my $elements = $self->objectifier->objectify_events($events); my $document = $self->document_class->new({ children => $elements, }); return $document; } #pod =attr event_reader #pod #pod The event reader (by default a new instance of #pod L is used to convert input into an #pod event stream. In general, it should provide C methods that behave like #pod Pod::Eventual::Simple. #pod #pod =cut has event_reader => ( is => 'ro', required => 1, default => sub { return Pod::Eventual::Simple->new }, ); #pod =attr objectifier #pod #pod The objectifier (by default a new Pod::Elemental::Objectifier) must provide an #pod C method that converts Pod events into #pod Pod::Elemental::Element objects. #pod #pod =cut has objectifier => ( is => 'ro', isa => duck_type( [qw(objectify_events) ]), required => 1, default => sub { return Pod::Elemental::Objectifier->new }, ); #pod =attr document_class #pod #pod This is the class for documents created by reading pod. #pod #pod =cut has document_class => ( is => 'ro', required => 1, default => 'Pod::Elemental::Document', ); __PACKAGE__->meta->make_immutable; no Moose; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental - work with nestable Pod elements =head1 VERSION version 0.103006 =head1 SYNOPSIS use Pod::Elemental; use Pod::Elemental::Transformer::Pod5; my $document = Pod::Elemental->read_file('lib/Pod/Elemental.pm'); Pod::Elemental::Transformer::Pod5->new->transform_node($document); print $document->as_debug_string, "\n"; # quick overview of doc structure print $document->as_pod_string, "\n"; # reproduce the document in Pod =head1 DESCRIPTION Pod::Elemental is a system for treating a Pod (L) documents as trees of elements. This model may be familiar from many other document systems, especially the HTML DOM. Pod::Elemental's document object model is much less sophisticated than the HTML DOM, but still makes a lot of document transformations easy. In general, you'll want to read in a Pod document and then perform a number of prepackaged transformations on it. The most common of these will be the L, which assumes that the basic meaning of Pod commands described in the Perl 5 documentation hold: C<=begin>, C<=end>, and C<=for> commands mark regions of the document, leading whitespace marks a verbatim paragraph, and so on. The Pod5 transformer also eliminates the need to track elements representing vertical whitespace. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 ATTRIBUTES =head2 event_reader The event reader (by default a new instance of L is used to convert input into an event stream. In general, it should provide C methods that behave like Pod::Eventual::Simple. =head2 objectifier The objectifier (by default a new Pod::Elemental::Objectifier) must provide an C method that converts Pod events into Pod::Elemental::Element objects. =head2 document_class This is the class for documents created by reading pod. =head1 METHODS =head2 read_handle =head2 read_file =head2 read_string These methods read the given input and return a Pod::Elemental::Document. =head1 AUTHOR Ricardo SIGNES =head1 CONTRIBUTORS =for stopwords Christian Walde Justin Cook Karen Etheridge Philippe Bruhat (BooK) Ricardo Signes =over 4 =item * Christian Walde =item * Justin Cook =item * Karen Etheridge =item * Philippe Bruhat (BooK) =item * Ricardo Signes =back =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/000755 000765 000024 00000000000 14354124547 017703 5ustar00rjbsstaff000000 000000 Pod-Elemental-0.103006/lib/Pod/Elemental/Command.pm000644 000765 000024 00000004361 14354124547 021623 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Command 0.103006; # ABSTRACT: a =command paragraph use Moose::Role 0.90; with 'Pod::Elemental::Paragraph' => { -excludes => [ 'as_pod_string' ] }; #pod =head1 OVERVIEW #pod #pod This is a role to be included by paragraph classes that represent Pod commands. #pod It defines C and C methods. Most code looking #pod for commands will check for the inclusion of this role, so be sure to use it #pod even if you override the provided methods. Classes implementing this role must #pod also provide a C method. Generally this method will implemented by #pod an attribute, but this is not necessary. #pod #pod =cut requires 'command'; sub as_pod_string { my ($self) = @_; my $content = $self->content; sprintf "=%s%s", $self->command, ($content =~ /\S/ ? " $content" : $content); } sub as_debug_string { my ($self) = @_; my $str = $self->_summarize_string($self->content); return sprintf '=%s %s', $self->command, $str; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Command - a =command paragraph =head1 VERSION version 0.103006 =head1 OVERVIEW This is a role to be included by paragraph classes that represent Pod commands. It defines C and C methods. Most code looking for commands will check for the inclusion of this role, so be sure to use it even if you override the provided methods. Classes implementing this role must also provide a C method. Generally this method will implemented by an attribute, but this is not necessary. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Transformer/000755 000765 000024 00000000000 14354124547 022205 5ustar00rjbsstaff000000 000000 Pod-Elemental-0.103006/lib/Pod/Elemental/Element/000755 000765 000024 00000000000 14354124547 021274 5ustar00rjbsstaff000000 000000 Pod-Elemental-0.103006/lib/Pod/Elemental/Autochomp.pm000644 000765 000024 00000002476 14354124547 022211 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Autochomp 0.103006; # ABSTRACT: a paragraph that chomps set content use namespace::autoclean; use Moose::Role; use Pod::Elemental::Types qw(ChompedString); #pod =head1 OVERVIEW #pod #pod This role exists primarily to simplify elements produced by the Pod5 #pod transformer. #pod #pod =cut # has '+content' => ( # coerce => 1, # isa => ChompedString, # ); 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Autochomp - a paragraph that chomps set content =head1 VERSION version 0.103006 =head1 OVERVIEW This role exists primarily to simplify elements produced by the Pod5 transformer. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Types.pm000644 000765 000024 00000004121 14354124547 021343 0ustar00rjbsstaff000000 000000 use strict; use warnings; package Pod::Elemental::Types 0.103006; # ABSTRACT: data types for Pod::Elemental use MooseX::Types -declare => [ qw(FormatName ChompedString) ]; use MooseX::Types::Moose qw(Str); #pod =head1 OVERVIEW #pod #pod This is a library of MooseX::Types types used by Pod::Elemental. #pod #pod =head1 TYPES #pod #pod =head2 FormatName #pod #pod This is a valid name for a format (a Pod5::Region). It does not expect the #pod leading colon for pod-like regions. #pod #pod =cut # Probably needs refining -- rjbs, 2009-05-26 subtype FormatName, as Str, where { length $_ and /\A\S+\z/ }; #pod =head2 ChompedString #pod #pod This is a string that does not end with newlines. It can be coerced from a #pod Str ending in a single newline -- the newline is dropped. #pod #pod =cut subtype ChompedString, as Str, where { ! /\n\z/ }; coerce ChompedString, from Str, via { chomp; $_ }; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Types - data types for Pod::Elemental =head1 VERSION version 0.103006 =head1 OVERVIEW This is a library of MooseX::Types types used by Pod::Elemental. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 TYPES =head2 FormatName This is a valid name for a format (a Pod5::Region). It does not expect the leading colon for pod-like regions. =head2 ChompedString This is a string that does not end with newlines. It can be coerced from a Str ending in a single newline -- the newline is dropped. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Selectors.pm000644 000765 000024 00000014412 14354124547 022206 0ustar00rjbsstaff000000 000000 use strict; use warnings; package Pod::Elemental::Selectors 0.103006; # ABSTRACT: predicates for selecting elements #pod =head1 OVERVIEW #pod #pod Pod::Elemental::Selectors provides a number of routines to check for #pod Pod::Elemental paragraphs with given qualities. #pod #pod =head1 SELECTORS #pod #pod Selectors are predicates: they examine paragraphs and return either true or #pod false. All the selectors have (by default) names like: C. They #pod expect zero or more parameters to affect the selection. If these parameters #pod are given, but no paragraph, a callback will be returned that will expect a #pod paragraph. If a paragraph is given, the selector will return immediately. #pod #pod For example, the C selector expects a parameter that can be the name #pod of the command desired. Both of the following uses are valid: #pod #pod # create and use a callback: #pod #pod my $selector = s_command('head1'); #pod my @headers = grep { $selector->($_) } @paragraphs; #pod #pod # just check a paragraph right now: #pod #pod if ( s_command('head1', $paragraph) ) { ... } #pod #pod The selectors can be imported individually or as the C<-all> group, and can be #pod renamed with L features. (Selectors cannot I be curried by #pod Sub::Exporter.) #pod #pod =cut use List::Util 1.33 'any'; use Sub::Exporter -setup => { exports => [ qw(s_blank s_flat s_node s_command) ], }; #pod =head2 s_blank #pod #pod my $callback = s_blank; #pod #pod if( s_blank($para) ) { ... } #pod #pod C tests whether a paragraph is a Generic::Blank element. #pod #pod =cut sub s_blank { my $code = sub { my $para = shift; return $para && $para->isa('Pod::Elemental::Element::Generic::Blank'); }; return @_ ? $code->(@_) : $code; } #pod =head2 s_flat #pod #pod my $callback = s_flat; #pod #pod if( s_flat($para) ) { ... } #pod #pod C tests whether a paragraph does Pod::Elemental::Flat -- in other #pod words, is content-only. #pod #pod =cut sub s_flat { my $code = sub { my $para = shift; return $para && $para->does('Pod::Elemental::Flat'); }; return @_ ? $code->(@_) : $code; } #pod =head2 s_node #pod #pod my $callback = s_node; #pod #pod if( s_node($para) ) { ... } #pod #pod C tests whether a paragraph does Pod::Elemental::Node -- in other #pod words, whether it may have children. #pod #pod =cut sub s_node { my $code = sub { my $para = shift; return $para && $para->does('Pod::Elemental::Node'); }; return @_ ? $code->(@_) : $code; } #pod =head2 s_command #pod #pod my $callback = s_command; #pod my $callback = s_command( $command_name); #pod my $callback = s_command(\@command_names); #pod #pod if( s_command(undef, \$para) ) { ... } #pod #pod if( s_command( $command_name, \$para) ) { ... } #pod if( s_command(\@command_names, \$para) ) { ... } #pod #pod C tests whether a paragraph does Pod::Elemental::Command. If a #pod command name (or a reference to an array of command names) is given, the tested #pod paragraph's command must match one of the given command names. #pod #pod =cut sub s_command { my $command = shift; my $code = sub { my $para = shift; return unless $para && $para->does('Pod::Elemental::Command'); return 1 unless defined $command; my $alts = ref $command ? $command : [ $command ]; return any { $para->command eq $_ } @$alts; }; return @_ ? $code->(@_) : $code; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Selectors - predicates for selecting elements =head1 VERSION version 0.103006 =head1 OVERVIEW Pod::Elemental::Selectors provides a number of routines to check for Pod::Elemental paragraphs with given qualities. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 SELECTORS Selectors are predicates: they examine paragraphs and return either true or false. All the selectors have (by default) names like: C. They expect zero or more parameters to affect the selection. If these parameters are given, but no paragraph, a callback will be returned that will expect a paragraph. If a paragraph is given, the selector will return immediately. For example, the C selector expects a parameter that can be the name of the command desired. Both of the following uses are valid: # create and use a callback: my $selector = s_command('head1'); my @headers = grep { $selector->($_) } @paragraphs; # just check a paragraph right now: if ( s_command('head1', $paragraph) ) { ... } The selectors can be imported individually or as the C<-all> group, and can be renamed with L features. (Selectors cannot I be curried by Sub::Exporter.) =head2 s_blank my $callback = s_blank; if( s_blank($para) ) { ... } C tests whether a paragraph is a Generic::Blank element. =head2 s_flat my $callback = s_flat; if( s_flat($para) ) { ... } C tests whether a paragraph does Pod::Elemental::Flat -- in other words, is content-only. =head2 s_node my $callback = s_node; if( s_node($para) ) { ... } C tests whether a paragraph does Pod::Elemental::Node -- in other words, whether it may have children. =head2 s_command my $callback = s_command; my $callback = s_command( $command_name); my $callback = s_command(\@command_names); if( s_command(undef, \$para) ) { ... } if( s_command( $command_name, \$para) ) { ... } if( s_command(\@command_names, \$para) ) { ... } C tests whether a paragraph does Pod::Elemental::Command. If a command name (or a reference to an array of command names) is given, the tested paragraph's command must match one of the given command names. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Flat.pm000644 000765 000024 00000003307 14354124547 021132 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Flat 0.103006; # ABSTRACT: a content-only pod paragraph use Moose::Role; use namespace::autoclean; #pod =head1 OVERVIEW #pod #pod Pod::Elemental::Flat is a role that is included to indicate that a class #pod represents a Pod paragraph that will have no children, and represents only its #pod own content. Generally it is used for text paragraphs. #pod #pod =cut with 'Pod::Elemental::Paragraph'; excludes 'Pod::Elemental::Node'; sub as_debug_string { my ($self) = @_; my $moniker = ref $self; $moniker =~ s/\APod::Elemental::Element:://; my $summary = $self->_summarize_string($self->content); return "$moniker <$summary>"; } 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Flat - a content-only pod paragraph =head1 VERSION version 0.103006 =head1 OVERVIEW Pod::Elemental::Flat is a role that is included to indicate that a class represents a Pod paragraph that will have no children, and represents only its own content. Generally it is used for text paragraphs. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Paragraph.pm000644 000765 000024 00000007571 14354124547 022160 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Paragraph 0.103006; # ABSTRACT: a paragraph in a Pod document use namespace::autoclean; use Moose::Role; use Encode qw(encode); use String::Truncate qw(elide); #pod =head1 OVERVIEW #pod #pod This is probably the most important role in the Pod-Elemental distribution. #pod Classes including this role represent paragraphs in a Pod document. The #pod paragraph is the fundamental unit of dividing up Pod documents, so this is a #pod often-included role. #pod #pod =attr content #pod #pod This is the textual content of the element, as in a Pod::Eventual event. In #pod other words, this Pod: #pod #pod =head2 content #pod #pod has a content of "content\n" #pod #pod =attr start_line #pod #pod This attribute, which may or may not be set, indicates the line in the source #pod document where the element began. #pod #pod =cut has content => (is => 'rw', isa => 'Str', required => 1); has start_line => (is => 'ro', isa => 'Int', required => 0); #pod =method as_pod_string #pod #pod This returns the element as a string, suitable for turning elements back into #pod a document. Some elements, like a C<=over> command, will stringify to include #pod extra content like a C<=back> command. In the case of elements with children, #pod this method will include the stringified children as well. #pod #pod =cut sub as_pod_string { my ($self) = @_; return $self->content; } #pod =method as_debug_string #pod #pod This method returns a string, like C, but is meant for getting an #pod overview of the document structure, and is not suitable for reproducing a #pod document. Its exact output is likely to change over time. #pod #pod =cut sub _summarize_string { my ($self, $str, $length) = @_; $length ||= 30; use utf8; chomp $str; my $elided = elide($str, $length, { truncate => 'middle', marker => '…' }); $elided =~ tr/\n\t/␤␉/; return encode('utf-8', $elided); } requires 'as_debug_string'; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Paragraph - a paragraph in a Pod document =head1 VERSION version 0.103006 =head1 OVERVIEW This is probably the most important role in the Pod-Elemental distribution. Classes including this role represent paragraphs in a Pod document. The paragraph is the fundamental unit of dividing up Pod documents, so this is a often-included role. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 ATTRIBUTES =head2 content This is the textual content of the element, as in a Pod::Eventual event. In other words, this Pod: =head2 content has a content of "content\n" =head2 start_line This attribute, which may or may not be set, indicates the line in the source document where the element began. =head1 METHODS =head2 as_pod_string This returns the element as a string, suitable for turning elements back into a document. Some elements, like a C<=over> command, will stringify to include extra content like a C<=back> command. In the case of elements with children, this method will include the stringified children as well. =head2 as_debug_string This method returns a string, like C, but is meant for getting an overview of the document structure, and is not suitable for reproducing a document. Its exact output is likely to change over time. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Document.pm000644 000765 000024 00000007354 14354124547 022030 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Document 0.103006; # ABSTRACT: a pod document use Moose; with 'Pod::Elemental::Node'; use Class::Load (); use namespace::autoclean; use Pod::Elemental::Element::Generic::Blank; use String::RewritePrefix; #pod =head1 OVERVIEW #pod #pod Pod::Elemental::Document is a container for Pod documents. It performs #pod L but I L. #pod #pod Documents are used almost exclusively to give a small amount of behavior to #pod arrayrefs of paragraphs, and have few methods of their own. #pod #pod =cut sub _expand_name { my ($self, $name) = @_; return String::RewritePrefix->rewrite( { '' => 'Pod::Elemental::Element::', '=' => '' }, $name, ); } sub as_pod_string { my ($self) = @_; my $str = join q{}, map { $_->as_pod_string } @{ $self->children }; $str = "=pod\n\n$str" unless $str =~ /\A=pod\n/; $str .= "=cut\n" unless $str =~ /=cut\n+\z/; return $str; } sub as_debug_string { return 'Document' } sub _elem_from_lol_entry { my ($self, $entry) = @_; my ($type, $content, $arg) = @$entry; $arg ||= {}; if (! defined $type) { my $n_class = $self->_expand_name($arg->{class} || 'Generic::Text'); Class::Load::load_class($n_class); return $n_class->new({ content => "$content\n" }); } elsif ($type =~ /\A=(\w+)\z/) { my $command = $1; my $n_class = $self->_expand_name($arg->{class} || 'Generic::Command'); Class::Load::load_class($n_class); return $n_class->new({ command => $command, content => "$content\n" }); } else { my $n_class = $self->_expand_name($arg->{class} || 'Pod5::Region'); Class::Load::load_class($n_class); my @children; for my $child (@$content) { push @children, $self->_elem_from_lol_entry($child); } continue { my $blank = $self->_expand_name('Generic::Blank'); push @children, $blank->new({ content => "\n" }); } pop @children while $children[-1]->isa('Pod::Elemental::Element::Generic::Blank'); my ($colon, $target) = $type =~ /\A(:)?(.+)\z/; return $n_class->new({ format_name => $target, is_pod => $colon ? 1 : 0, content => "\n", children => \@children, }) } } sub new_from_lol { my ($class, $lol) = @_; my $self = $class->new; my @children; ENTRY: for my $entry (@$lol) { my $elem = $self->_elem_from_lol_entry($entry); push @children, $elem; } continue { my $blank = $self->_expand_name('Generic::Blank'); push @children, $blank->new({ content => "\n" }); } push @{ $self->children }, @children; return $self; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Document - a pod document =head1 VERSION version 0.103006 =head1 OVERVIEW Pod::Elemental::Document is a container for Pod documents. It performs L but I L. Documents are used almost exclusively to give a small amount of behavior to arrayrefs of paragraphs, and have few methods of their own. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Transformer.pm000644 000765 000024 00000004101 14354124547 022537 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Transformer 0.103006; # ABSTRACT: something that transforms a node tree into a new tree use Moose::Role; use namespace::autoclean; requires 'transform_node'; #pod =head1 OVERVIEW #pod #pod Pod::Elemental::Transformer is a role to be composed by anything that takes a #pod node and messes around with its contents. This includes transformers to #pod implement Pod dialects, Pod tree nesting strategies, and Pod document #pod rewriters. #pod #pod A class including this role must implement the following methods: #pod #pod =method transform_node #pod #pod my $node = $nester->transform_node($node); #pod #pod This method alters the given node and returns it. Apart from that, the sky is #pod the limit. #pod #pod =cut 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Transformer - something that transforms a node tree into a new tree =head1 VERSION version 0.103006 =head1 OVERVIEW Pod::Elemental::Transformer is a role to be composed by anything that takes a node and messes around with its contents. This includes transformers to implement Pod dialects, Pod tree nesting strategies, and Pod document rewriters. A class including this role must implement the following methods: =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 METHODS =head2 transform_node my $node = $nester->transform_node($node); This method alters the given node and returns it. Apart from that, the sky is the limit. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Objectifier.pm000644 000765 000024 00000006647 14354124547 022503 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Objectifier 0.103006; # ABSTRACT: it turns a Pod::Eventual event stream into objects use Moose; #pod =head1 OVERVIEW #pod #pod An objectifier is responsible for taking the events produced by #pod L and converting them into objects that perform #pod the Pod::Elemental::Paragraph role. #pod #pod In general, it does this by producing a sequence of element objects in the #pod Pod::Elemental::Element::Generic namespace. #pod #pod =cut use namespace::autoclean; use Pod::Elemental::Element::Generic::Blank; use Pod::Elemental::Element::Generic::Command; use Pod::Elemental::Element::Generic::Nonpod; use Pod::Elemental::Element::Generic::Text; #pod =method objectify_events #pod #pod my $elements = $objectifier->objectify_events(\@events); #pod #pod Given an arrayref of Pod events, this method returns an arrayref of objects #pod formed from the event stream. #pod #pod =cut sub objectify_events { my ($self, $events) = @_; return [ map { Carp::croak("not a valid event") unless ref $_; my $class = $self->element_class_for_event($_); my %guts = ( content => $_->{content}, start_line => $_->{start_line}, ($_->{type} eq 'command' ? (command => $_->{command}) : ()), ); $class->new(\%guts); } @$events ]; } #pod =method element_class_for_event #pod #pod This method returns the name of the class to be used for the given event. #pod #pod =cut sub __class_for { return { blank => 'Pod::Elemental::Element::Generic::Blank', command => 'Pod::Elemental::Element::Generic::Command', nonpod => 'Pod::Elemental::Element::Generic::Nonpod', text => 'Pod::Elemental::Element::Generic::Text', }; } sub element_class_for_event { my ($self, $event) = @_; my $t = $event->{type}; my $class_for = $self->__class_for; Carp::croak "unknown event type: $t" unless exists $class_for->{ $t }; return $class_for->{ $t }; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Objectifier - it turns a Pod::Eventual event stream into objects =head1 VERSION version 0.103006 =head1 OVERVIEW An objectifier is responsible for taking the events produced by L and converting them into objects that perform the Pod::Elemental::Paragraph role. In general, it does this by producing a sequence of element objects in the Pod::Elemental::Element::Generic namespace. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 METHODS =head2 objectify_events my $elements = $objectifier->objectify_events(\@events); Given an arrayref of Pod events, this method returns an arrayref of objects formed from the event stream. =head2 element_class_for_event This method returns the name of the class to be used for the given event. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Node.pm000644 000765 000024 00000004474 14354124547 021137 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Node 0.103006; # ABSTRACT: a thing with Pod::Elemental::Nodes as children use Moose::Role; use namespace::autoclean; use MooseX::Types; use MooseX::Types::Moose qw(ArrayRef); requires 'as_pod_string'; requires 'as_debug_string'; #pod =head1 OVERVIEW #pod #pod Classes that include Pod::Elemental::Node represent collections of child #pod Pod::Elemental::Paragraphs. This includes Pod documents, Pod5 regions, and #pod nested Pod elements produced by the Gatherer transformer. #pod #pod =attr children #pod #pod This attribute is an arrayref of #pod L-performing objects, and represents #pod elements contained by an object. #pod #pod =cut has children => ( is => 'rw', isa => ArrayRef[ role_type('Pod::Elemental::Paragraph') ], required => 1, default => sub { [] }, ); around as_debug_string => sub { my ($orig, $self) = @_; my $str = $self->$orig; my @children = map { $_->as_debug_string } @{ $self->children }; s/^/ /sgm for @children; $str = join "\n", $str, @children; return $str; }; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Node - a thing with Pod::Elemental::Nodes as children =head1 VERSION version 0.103006 =head1 OVERVIEW Classes that include Pod::Elemental::Node represent collections of child Pod::Elemental::Paragraphs. This includes Pod documents, Pod5 regions, and nested Pod elements produced by the Gatherer transformer. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 ATTRIBUTES =head2 children This attribute is an arrayref of L-performing objects, and represents elements contained by an object. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Autoblank.pm000644 000765 000024 00000003260 14354124547 022162 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Autoblank 0.103006; # ABSTRACT: a paragraph that always displays an extra blank line in Pod form use namespace::autoclean; use Moose::Role; #pod =head1 OVERVIEW #pod #pod This role exists primarily to simplify elements produced by the Pod5 #pod transformer. Any element with this role composed into it will append an extra #pod newline to the normally generated response to the C method. #pod #pod That's it! #pod #pod =cut around as_pod_string => sub { my ($orig, $self, @arg) = @_; my $str = $self->$orig(@arg); "$str\n\n"; }; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Autoblank - a paragraph that always displays an extra blank line in Pod form =head1 VERSION version 0.103006 =head1 OVERVIEW This role exists primarily to simplify elements produced by the Pod5 transformer. Any element with this role composed into it will append an extra newline to the normally generated response to the C method. That's it! =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Element/Pod5/000755 000765 000024 00000000000 14354124547 022103 5ustar00rjbsstaff000000 000000 Pod-Elemental-0.103006/lib/Pod/Elemental/Element/Generic/000755 000765 000024 00000000000 14354124547 022650 5ustar00rjbsstaff000000 000000 Pod-Elemental-0.103006/lib/Pod/Elemental/Element/Nested.pm000644 000765 000024 00000004555 14354124547 023065 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Element::Nested 0.103006; # ABSTRACT: an element that is a command and a node use Moose; extends 'Pod::Elemental::Element::Generic::Command'; with 'Pod::Elemental::Node'; with 'Pod::Elemental::Autochomp'; use namespace::autoclean; # BEGIN Autochomp Replacement use Pod::Elemental::Types qw(ChompedString); has '+content' => (coerce => 1, isa => ChompedString); # END Autochomp Replacement #pod =head1 WARNING #pod #pod This class is somewhat sketchy and may be refactored somewhat in the future, #pod specifically to refactor its similarities to #pod L. #pod #pod =head1 OVERVIEW #pod #pod A Nested element is a Generic::Command element that is also a node. #pod #pod It's used by the nester transformer to produce commands with children, to make #pod documents seem more structured for easy manipulation. #pod #pod =cut override as_pod_string => sub { my ($self) = @_; my $string = super; $string = join q{}, "$string\n\n", map { $_->as_pod_string } @{ $self->children }; $string =~ s/\n{3,}\z/\n\n/g; return $string; }; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Element::Nested - an element that is a command and a node =head1 VERSION version 0.103006 =head1 OVERVIEW A Nested element is a Generic::Command element that is also a node. It's used by the nester transformer to produce commands with children, to make documents seem more structured for easy manipulation. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 WARNING This class is somewhat sketchy and may be refactored somewhat in the future, specifically to refactor its similarities to L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Element/Generic/Command.pm000644 000765 000024 00000003370 14354124547 024567 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Element::Generic::Command 0.103006; # ABSTRACT: a Pod =command element use Moose; use namespace::autoclean; #pod =head1 OVERVIEW #pod #pod Generic::Command elements are paragraph elements implementing the #pod Pod::Elemental::Command role. They provide the command method by implementing #pod a read/write command attribute. #pod #pod =attr command #pod #pod This attribute contains the name of the command, like C or C. #pod #pod =cut has command => ( is => 'rw', isa => 'Str', required => 1, ); with 'Pod::Elemental::Command'; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Element::Generic::Command - a Pod =command element =head1 VERSION version 0.103006 =head1 OVERVIEW Generic::Command elements are paragraph elements implementing the Pod::Elemental::Command role. They provide the command method by implementing a read/write command attribute. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 ATTRIBUTES =head2 command This attribute contains the name of the command, like C or C. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Element/Generic/Text.pm000644 000765 000024 00000003162 14354124547 024134 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Element::Generic::Text 0.103006; # ABSTRACT: a Pod text or verbatim element use Moose; with 'Pod::Elemental::Flat'; use namespace::autoclean; #pod =head1 OVERVIEW #pod #pod Generic::Text elements represent text paragraphs found in raw Pod. They are #pod likely to be fed to a Pod5 translator and converted to ordinary, verbatim, or #pod data paragraphs in that dialect. Otherwise, Generic::Text paragraphs are #pod simple flat paragraphs. #pod #pod =cut __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Element::Generic::Text - a Pod text or verbatim element =head1 VERSION version 0.103006 =head1 OVERVIEW Generic::Text elements represent text paragraphs found in raw Pod. They are likely to be fed to a Pod5 translator and converted to ordinary, verbatim, or data paragraphs in that dialect. Otherwise, Generic::Text paragraphs are simple flat paragraphs. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Element/Generic/Nonpod.pm000644 000765 000024 00000002550 14354124547 024445 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Element::Generic::Nonpod 0.103006; # ABSTRACT: a non-pod element in a Pod document use Moose; with 'Pod::Elemental::Flat'; use namespace::autoclean; #pod =head1 OVERVIEW #pod #pod Generic::Nonpod elements are just like Generic::Text elements, but represent #pod non-pod content found in the Pod stream. #pod #pod =cut __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Element::Generic::Nonpod - a non-pod element in a Pod document =head1 VERSION version 0.103006 =head1 OVERVIEW Generic::Nonpod elements are just like Generic::Text elements, but represent non-pod content found in the Pod stream. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Element/Generic/Blank.pm000644 000765 000024 00000003147 14354124547 024242 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Element::Generic::Blank 0.103006; # ABSTRACT: a series of blank lines use Moose; with 'Pod::Elemental::Flat'; #pod =head1 OVERVIEW #pod #pod Generic::Blank elements represent vertical whitespace in a Pod document. For #pod the most part, these are meant to be placeholders until made unnecessary by the #pod Pod5 transformer. Most end-users will never need to worry about these #pod elements. #pod #pod =cut use namespace::autoclean; sub as_debug_string { '|' } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Element::Generic::Blank - a series of blank lines =head1 VERSION version 0.103006 =head1 OVERVIEW Generic::Blank elements represent vertical whitespace in a Pod document. For the most part, these are meant to be placeholders until made unnecessary by the Pod5 transformer. Most end-users will never need to worry about these elements. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Element/Pod5/Command.pm000644 000765 000024 00000003400 14354124547 024014 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Element::Pod5::Command 0.103006; # ABSTRACT: a Pod5 =command element use Moose; extends 'Pod::Elemental::Element::Generic::Command'; with 'Pod::Elemental::Autoblank'; with 'Pod::Elemental::Autochomp'; use Pod::Elemental::Types qw(ChompedString); has '+content' => ( coerce => 1, isa => ChompedString, ); #pod =head1 OVERVIEW #pod #pod Pod5::Command elements are identical to #pod L elements, except #pod that they incorporate L. They represent command #pod paragraphs in a Pod5 document. #pod #pod =cut use namespace::autoclean; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Element::Pod5::Command - a Pod5 =command element =head1 VERSION version 0.103006 =head1 OVERVIEW Pod5::Command elements are identical to L elements, except that they incorporate L. They represent command paragraphs in a Pod5 document. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Element/Pod5/Ordinary.pm000644 000765 000024 00000003166 14354124547 024236 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Element::Pod5::Ordinary 0.103006; # ABSTRACT: a Pod5 ordinary text paragraph use Moose; extends 'Pod::Elemental::Element::Generic::Text'; with 'Pod::Elemental::Autoblank'; with 'Pod::Elemental::Autochomp'; # BEGIN Autochomp Replacement use Pod::Elemental::Types qw(ChompedString); has '+content' => (coerce => 1, isa => ChompedString); # END Autochomp Replacement #pod =head1 OVERVIEW #pod #pod A Pod5::Ordinary element represents a plain old paragraph of text found in a #pod Pod document that's gone through the Pod5 translator. #pod #pod =cut use namespace::autoclean; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Element::Pod5::Ordinary - a Pod5 ordinary text paragraph =head1 VERSION version 0.103006 =head1 OVERVIEW A Pod5::Ordinary element represents a plain old paragraph of text found in a Pod document that's gone through the Pod5 translator. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Element/Pod5/Region.pm000644 000765 000024 00000013371 14354124547 023671 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Element::Pod5::Region 0.103006; # ABSTRACT: a region of Pod (this role likely to be removed) use Moose; with qw( Pod::Elemental::Paragraph Pod::Elemental::Node Pod::Elemental::Command ); #pod =head1 WARNING #pod #pod This class is somewhat sketchy and may be refactored somewhat in the future, #pod specifically to refactor its similarities to #pod L. #pod #pod =head1 OVERVIEW #pod #pod A Pod5::Region element represents a region marked by a C<=for> command or a #pod pair of C<=begin> and C<=end> commands. It may have content of its own as well #pod as child paragraphs. #pod #pod Its C method will emit either a C<=begin/=end>-enclosed string #pod or a C<=for> command, based on whichever is permissible. #pod #pod =cut use Pod::Elemental::Types qw(FormatName); use MooseX::Types::Moose qw(Bool); #pod =attr format_name #pod #pod This is the format to which the region was targeted. #pod #pod B The format name should I include the leading colon to indicate a #pod pod paragraph. For that, see C>. #pod #pod =cut has format_name => (is => 'ro', isa => FormatName, required => 1); #pod =attr is_pod #pod #pod If true, this region contains pod (ordinary or verbatim) paragraphs, as opposed #pod to data paragraphs. This will generally result from the document originating #pod in a C<=begin> block with a colon-prefixed target identifier: #pod #pod =begin :html #pod #pod This is still a verbatim paragraph. #pod #pod =end :html #pod #pod =cut has is_pod => (is => 'ro', isa => Bool, required => 1, default => 1); sub command { 'begin' } sub closing_command { 'end' } sub _display_as_for { my ($self) = @_; # Everything after "=for target" becomes the lone child paragraph, so there # is nowhere to put the (technically illegal) content. -- rjbs, 2009-11-24 return if $self->content =~ /\S/; # We can't have more than one paragraph, because there'd be a blank, so we # couldn't round trip. -- rjbs, 2009-11-24 return if @{ $self->children } != 1; my $child = $self->children->[0]; return if $child->content =~ m{^\s*$}m; my $base = 'Pod::Elemental::Element::Pod5::'; return 1 if $self->is_pod and $child->isa("${base}Ordinary"); return 1 if ! $self->is_pod and $child->isa("${base}Data"); return; } sub as_pod_string { my ($self) = @_; my $string; if ($self->_display_as_for) { $string = $self->__as_pod_string_for($self); } else { $string = $self->__as_pod_string_begin($self); } $string =~ s/\n*\z//g; return $string; } sub __as_pod_string_begin { my ($self) = @_; my $content = $self->content; my $colon = $self->is_pod ? ':' : ''; my $string = sprintf "=%s %s%s\n", $self->command, $colon . $self->format_name, ($content =~ /\S/ ? " $content\n" : "\n"); $string .= join(q{}, map { $_->as_pod_string } @{ $self->children }); $string .= "\n\n" if @{ $self->children } and $self->children->[-1]->isa( 'Pod::Elemental::Element::Pod5::Data'); # Pod5::$self->is_pod; # XXX: HACK!! -- rjbs, 2009-10-21 $string .= sprintf "=%s %s", $self->closing_command, $colon . $self->format_name; return $string; } sub __as_pod_string_for { my ($self) = @_; my $content = $self->content; my $colon = $self->is_pod ? ':' : ''; my $string = sprintf "=for %s %s", $colon . $self->format_name, $self->children->[0]->as_pod_string; return $string; } sub as_debug_string { my ($self) = @_; my $colon = $self->is_pod ? ':' : ''; my $string = sprintf "=%s %s", $self->command, $colon . $self->format_name; return $string; } with 'Pod::Elemental::Autoblank'; with 'Pod::Elemental::Autochomp'; # BEGIN Autochomp Replacement use Pod::Elemental::Types qw(ChompedString); has '+content' => (coerce => 1, isa => ChompedString); # END Autochomp Replacement __PACKAGE__->meta->make_immutable; no Moose; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Element::Pod5::Region - a region of Pod (this role likely to be removed) =head1 VERSION version 0.103006 =head1 OVERVIEW A Pod5::Region element represents a region marked by a C<=for> command or a pair of C<=begin> and C<=end> commands. It may have content of its own as well as child paragraphs. Its C method will emit either a C<=begin/=end>-enclosed string or a C<=for> command, based on whichever is permissible. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 ATTRIBUTES =head2 format_name This is the format to which the region was targeted. B The format name should I include the leading colon to indicate a pod paragraph. For that, see C>. =head2 is_pod If true, this region contains pod (ordinary or verbatim) paragraphs, as opposed to data paragraphs. This will generally result from the document originating in a C<=begin> block with a colon-prefixed target identifier: =begin :html This is still a verbatim paragraph. =end :html =head1 WARNING This class is somewhat sketchy and may be refactored somewhat in the future, specifically to refactor its similarities to L. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Element/Pod5/Nonpod.pm000644 000765 000024 00000003763 14354124547 023707 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Element::Pod5::Nonpod 0.103006; # ABSTRACT: a non-pod element in a Pod document use Moose; with 'Pod::Elemental::Flat'; with 'Pod::Elemental::Autoblank'; #pod =head1 OVERVIEW #pod #pod A Pod5::Nonpod element represents a hunk of non-Pod content found in a Pod #pod document tree. It is equivalent to a #pod L element, with the #pod following differences: #pod #pod =over 4 #pod #pod =item * it includes L #pod #pod =item * when producing a pod string, it wraps the non-pod content in =cut/=pod #pod #pod =back #pod #pod =cut use namespace::autoclean; sub as_pod_string { my ($self) = @_; return sprintf "=cut\n%s=pod\n", $self->content; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Element::Pod5::Nonpod - a non-pod element in a Pod document =head1 VERSION version 0.103006 =head1 OVERVIEW A Pod5::Nonpod element represents a hunk of non-Pod content found in a Pod document tree. It is equivalent to a L element, with the following differences: =over 4 =item * it includes L =item * when producing a pod string, it wraps the non-pod content in =cut/=pod =back =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Element/Pod5/Verbatim.pm000644 000765 000024 00000004025 14354124547 024213 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Element::Pod5::Verbatim 0.103006; # ABSTRACT: a Pod verbatim paragraph use Moose; extends 'Pod::Elemental::Element::Generic::Text'; with 'Pod::Elemental::Autoblank'; with 'Pod::Elemental::Autochomp'; # BEGIN Autochomp Replacement use Pod::Elemental::Types qw(ChompedString); has '+content' => (coerce => 1, isa => ChompedString); # END Autochomp Replacement #pod =head1 OVERVIEW #pod #pod Pod5::Verbatim elements represent "verbatim" paragraphs of text. These are #pod ordinary, flat paragraphs of text that were indented in the source Pod to #pod indicate that they should be represented verbatim in formatted output. The #pod following paragraph is a verbatim paragraph: #pod #pod This is a verbatim #pod paragraph #pod right here. #pod #pod =cut use namespace::autoclean; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Element::Pod5::Verbatim - a Pod verbatim paragraph =head1 VERSION version 0.103006 =head1 OVERVIEW Pod5::Verbatim elements represent "verbatim" paragraphs of text. These are ordinary, flat paragraphs of text that were indented in the source Pod to indicate that they should be represented verbatim in formatted output. The following paragraph is a verbatim paragraph: This is a verbatim paragraph right here. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Element/Pod5/Data.pm000644 000765 000024 00000003103 14354124547 023307 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Element::Pod5::Data 0.103006; # ABSTRACT: a Pod data paragraph use Moose; extends 'Pod::Elemental::Element::Generic::Text'; #pod =head1 OVERVIEW #pod #pod Pod5::Data paragraphs represent the content of #pod L paragraphs when the #pod region is not a Pod-like region. These regions should generally have a single #pod data element contained in them. #pod #pod =cut use namespace::autoclean; __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Element::Pod5::Data - a Pod data paragraph =head1 VERSION version 0.103006 =head1 OVERVIEW Pod5::Data paragraphs represent the content of L paragraphs when the region is not a Pod-like region. These regions should generally have a single data element contained in them. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Transformer/Gatherer.pm000644 000765 000024 00000011512 14354124547 024304 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Transformer::Gatherer 0.103006; # ABSTRACT: gather related paragraphs under a shared header use Moose; with 'Pod::Elemental::Transformer'; use namespace::autoclean; use MooseX::Types::Moose qw(CodeRef); use Pod::Elemental::Node; #pod =head1 OVERVIEW #pod #pod Like the Nester transformer, this Gatherer produces structure and containment #pod in a Pod document. Unlike that Nester, it does not find top-level elements, #pod but instead produces them. #pod #pod It looks for all elements matching the C. They are removed #pod from the node. In the place of the first found element, the C node #pod is placed into the transformed node, and all the gathered elements are made #pod children of the container. #pod #pod So, given this document: #pod #pod Document #pod =head1 Foo #pod =over 4 #pod =item * xyzzy #pod =item * abcdef #pod =back #pod =head1 Bar #pod =over 4 #pod =item * 1234 #pod =item * 8765 #pod =back #pod #pod ...and this nester... #pod #pod my $gatherer = Pod::Elemental::Transformer::Gatherer->new({ #pod gather_selector => s_command( [ qw(over item back) ] ), #pod container => Pod::Elemental::Element::Pod5::Command->new({ #pod command => 'head1', #pod content => "LISTS\n", #pod }), #pod }); #pod #pod Then this: #pod #pod $nester->transform_node($document); #pod #pod Will result in this document: #pod #pod Document #pod =head1 Foo #pod =head1 LISTS #pod =over 4 #pod =item * xyzzy #pod =item * abcdef #pod =back #pod =over 4 #pod =item * 1234 #pod =item * 8765 #pod =back #pod =head1 Bar #pod #pod =attr gather_selector #pod #pod This is a coderef (a predicate) used to find the paragraphs to gather up. #pod #pod =cut has gather_selector => ( is => 'ro', isa => CodeRef, required => 1, ); #pod =attr container #pod #pod This is a Pod::Elemental::Node that will be inserted into the node, containing #pod all gathered elements. #pod #pod =cut has container => ( is => 'ro', does => 'Pod::Elemental::Node', required => 1, ); sub transform_node { my ($self, $node) = @_; my @indexes; for my $i (0 .. @{ $node->children } - 1) { push @indexes, $i if $self->gather_selector->($node->children->[ $i ]); } my @paras; for my $idx (reverse @indexes) { unshift @paras, splice @{ $node->children }, $idx, 1; } $self->container->children(\@paras); splice @{ $node->children }, $indexes[0], 0, $self->container; return $node; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Transformer::Gatherer - gather related paragraphs under a shared header =head1 VERSION version 0.103006 =head1 OVERVIEW Like the Nester transformer, this Gatherer produces structure and containment in a Pod document. Unlike that Nester, it does not find top-level elements, but instead produces them. It looks for all elements matching the C. They are removed from the node. In the place of the first found element, the C node is placed into the transformed node, and all the gathered elements are made children of the container. So, given this document: Document =head1 Foo =over 4 =item * xyzzy =item * abcdef =back =head1 Bar =over 4 =item * 1234 =item * 8765 =back ...and this nester... my $gatherer = Pod::Elemental::Transformer::Gatherer->new({ gather_selector => s_command( [ qw(over item back) ] ), container => Pod::Elemental::Element::Pod5::Command->new({ command => 'head1', content => "LISTS\n", }), }); Then this: $nester->transform_node($document); Will result in this document: Document =head1 Foo =head1 LISTS =over 4 =item * xyzzy =item * abcdef =back =over 4 =item * 1234 =item * 8765 =back =head1 Bar =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 ATTRIBUTES =head2 gather_selector This is a coderef (a predicate) used to find the paragraphs to gather up. =head2 container This is a Pod::Elemental::Node that will be inserted into the node, containing all gathered elements. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Transformer/Pod5.pm000644 000765 000024 00000022777 14354124547 023371 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Transformer::Pod5 0.103006; # ABSTRACT: the default, minimal semantics of Perl5's pod element hierarchy use Moose; with 'Pod::Elemental::Transformer'; #pod =head1 SYNOPSIS #pod #pod Pod::Elemental::Transformer::Pod5->new->transform_node($pod_elem_document); #pod #pod ...and that's it. #pod #pod =head1 OVERVIEW #pod #pod The Pod5 transformer is meant to be used to convert the result of a "stock" #pod Pod::Elemental::Document into something simpler to work with. It assumes that #pod the document conforms more or less to the convetions laid out in L and #pod L. It is not very strict, and makes very few assumptions, #pod described here: #pod #pod =over 4 #pod #pod =item * =begin/=end and =for enclose or produce regions within the document #pod #pod =item * regions are associated with format names; format names that begin with a colon enclose more pod-like content #pod #pod =item * regions nest strictly; all inner regions must end before outer regions #pod #pod =item * paragraphs in non-pod regions are "data" paragraphs #pod #pod =item * non-data paragraphs that start with spaces are "verbatim" paragraphs #pod #pod =item * groups of data or verbatim paragraphs can be consolidated #pod #pod =back #pod #pod Further, all elements are replaced with equivalent elements that perform the #pod L role, so all "blank" events can be removed form #pod the tree and ignored. #pod #pod =head1 CONFIGURATION #pod #pod None. For now, it just does the same thing every time with no configuration or #pod options. #pod #pod =cut use namespace::autoclean; use Pod::Elemental::Document; use Pod::Elemental::Element::Pod5::Command; use Pod::Elemental::Element::Pod5::Data; use Pod::Elemental::Element::Pod5::Nonpod; use Pod::Elemental::Element::Pod5::Ordinary; use Pod::Elemental::Element::Pod5::Verbatim; use Pod::Elemental::Element::Pod5::Region; use Pod::Elemental::Selectors -all; sub _gen_class { "Pod::Elemental::Element::Generic::$_[1]" } sub _class { "Pod::Elemental::Element::Pod5::$_[1]" } sub _region_para_parts { my ($self, $para) = @_; my ($colon, $target, $content, $nl) = $para->content =~ m/ \A (:)? (\S+) (?:\s+(.+))? (\s+)\z /xsm; confess("=begin cannot be parsed") unless defined $target; $colon ||= ''; $content ||= ''; return ($colon, $target, "$content$nl"); } sub __extract_region { my ($self, $name, $in_paras) = @_; my %nest = ($name => 1); my @region_paras; REGION_PARA: while (my $region_para = shift @$in_paras) { if (s_command([ qw(begin end) ], $region_para)) { my ($r_colon, $r_target) = $self->_region_para_parts($region_para); for ($nest{ "$r_colon$r_target" }) { $_ += $region_para->command eq 'begin' ? 1 : -1; confess("=end $r_colon$r_target without matching begin") if $_ < 0; last REGION_PARA if !$_ and "$r_colon$r_target" eq $name; } } push @region_paras, $region_para; }; return \@region_paras; } sub _upgrade_nonpod { my ($self, $in_paras) = @_; @$in_paras = map { $_->isa( $self->_gen_class('Nonpod') ) ? $self->_class('Nonpod')->new({ content => $_->content, }) : $_ } @$in_paras; } sub _collect_regions { my ($self, $in_paras) = @_; my @out_paras; my $s_region = s_command([ qw(begin for) ]); my $region_class = $self->_class('Region'); PARA: while (my $para = shift @{ $in_paras }) { push(@out_paras, $para), next PARA unless $s_region->($para); if ($para->command eq 'for') { # factor out (for vertical space if nothing else) -- rjbs, 2009-10-20 my ($colon, $target, $content) = $self->_region_para_parts($para); my $region = $region_class->new({ children => [ $self->_gen_class('Text')->new({ content => $content }), ], format_name => $target, is_pod => $colon ? 1 : 0, content => "\n", }); push @out_paras, $region; next PARA; } my ($colon, $target, $content) = $self->_region_para_parts($para); my $region_paras = $self->__extract_region("$colon$target", $in_paras); shift @$region_paras while s_blank($region_paras->[0]); pop @$region_paras while @$region_paras && s_blank($region_paras->[-1]); my $region = $region_class->new({ children => $self->_collect_regions($region_paras), format_name => $target, is_pod => $colon ? 1 : 0, content => $content, }); push @out_paras, $region; } @$in_paras = @out_paras; return $in_paras; } sub _strip_markers { my ($self, $in_paras) = @_; @$in_paras = grep { ! s_command([ qw(cut pod) ], $_) } @$in_paras; shift @$in_paras while @$in_paras and s_blank($in_paras->[0]); } sub _autotype_paras { my ($self, $paras, $is_pod) = @_; @$paras = map { my $elem = $_; if ($elem->isa( $self->_gen_class('Text') )) { my $class = $is_pod ? $elem->content =~ /\A\s/ ? $self->_class('Verbatim') : $self->_class('Ordinary') : $self->_class('Data'); $elem = $class->new({ content => $elem->content }); } if ($elem->isa( $self->_class('Region') )) { $self->_autotype_paras( $elem->children, $elem->is_pod ); } if ($elem->isa( $self->_gen_class('Command') )) { $elem = $self->_class('Command')->new({ command => $elem->command, content => $elem->content, }); } $elem; } @$paras; } sub __text_class { my ($self, $para) = @_; for my $type (qw(Verbatim Data)) { my $class = $self->_class($type); return $class if $para->isa($class); } return; } sub _collect_runs { my ($self, $paras) = @_; $self->_collect_runs($_->children) foreach grep { $_->isa( $self->_class('Region') ) } @$paras; PASS: for my $start (0 .. $#$paras) { last PASS if $#$paras - $start < 2; # we need X..Blank..X at minimum my $class = $self->__text_class( $paras->[ $start ] ); next PASS unless $class; my @to_collect = ($start); NEXT: for my $next ($start+1 .. $#$paras) { if ($paras->[ $next ]->isa($class) or s_blank($paras->[ $next ])) { push @to_collect, $next; next NEXT; } last NEXT; } pop @to_collect while s_blank($paras->[ $to_collect[ -1 ] ]); next PASS unless @to_collect >= 3; my $new_content = join(qq{\n}, map { $_ = $_->content; chomp; $_ } @$paras[@to_collect] ); splice @$paras, $start, scalar(@to_collect), $class->new({ content => $new_content, }); redo PASS; } my @out; PASS: for (my $i = 0; $i < @$paras; $i++) { my $this = $paras->[$i]; push @out, $this; while ($paras->[$i+1] and s_blank($paras->[$i+1])) { $i++; next unless $this->isa( $self->_class('Data') ); $this->content( $this->content . $paras->[$i]->content ); } } # @out = grep { not s_blank($_) } @$paras; # I really don't feel bad about rewriting in place by the time we get here. # These are private methods, and I know the consequence of calling them. # Nobody else should be. So there. -- rjbs, 2009-10-17 @$paras = @out; return \@out; } sub transform_node { my ($self, $node) = @_; $self->_strip_markers($node->children); $self->_upgrade_nonpod($node->children); $self->_collect_regions($node->children); $self->_autotype_paras($node->children, 1); $self->_collect_runs($node->children); return $node; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Transformer::Pod5 - the default, minimal semantics of Perl5's pod element hierarchy =head1 VERSION version 0.103006 =head1 SYNOPSIS Pod::Elemental::Transformer::Pod5->new->transform_node($pod_elem_document); ...and that's it. =head1 OVERVIEW The Pod5 transformer is meant to be used to convert the result of a "stock" Pod::Elemental::Document into something simpler to work with. It assumes that the document conforms more or less to the convetions laid out in L and L. It is not very strict, and makes very few assumptions, described here: =over 4 =item * =begin/=end and =for enclose or produce regions within the document =item * regions are associated with format names; format names that begin with a colon enclose more pod-like content =item * regions nest strictly; all inner regions must end before outer regions =item * paragraphs in non-pod regions are "data" paragraphs =item * non-data paragraphs that start with spaces are "verbatim" paragraphs =item * groups of data or verbatim paragraphs can be consolidated =back Further, all elements are replaced with equivalent elements that perform the L role, so all "blank" events can be removed form the tree and ignored. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 CONFIGURATION None. For now, it just does the same thing every time with no configuration or options. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/lib/Pod/Elemental/Transformer/Nester.pm000644 000765 000024 00000015303 14354124547 024005 0ustar00rjbsstaff000000 000000 package Pod::Elemental::Transformer::Nester 0.103006; # ABSTRACT: group the document into sections use Moose; with 'Pod::Elemental::Transformer'; #pod =head1 OVERVIEW #pod #pod The Nester transformer is meant to find potential container elements and make #pod them into actual containers. It works by being told what elements may be made #pod into containers and what subsequent elements they should allow to be stuffed #pod into them. #pod #pod For example, given the following nester: #pod #pod use Pod::Elemental::Selectors qw(s_command s_flat); #pod #pod my $nester = Pod::Elemental::Transformer::Nester->new({ #pod top_selector => s_command('head1'), #pod content_selectors => [ #pod s_command([ qw(head2 head3 head4) ]), #pod s_flat, #pod ], #pod }); #pod #pod ..then when we apply the transformation: #pod #pod $nester->transform_node($document); #pod #pod ...the nester will find all C<=head1> elements in the top-level of the #pod document. It will ensure that they are represented by objects that perform the #pod Pod::Elemental::Node role, and then it will move all subsequent elements #pod matching the C into the container. #pod #pod So, if we start with this input: #pod #pod =head1 Header #pod =head2 Subheader #pod Pod5::Ordinary #pod =head1 New Header #pod #pod The nester will convert its structure to look like this: #pod #pod =head1 Header #pod =head2 Subheader #pod Pod5::Ordinary #pod =head1 New Header #pod #pod Once an element is reached that does not pass the content selectors, the #pod nesting ceases until the next potential container. #pod #pod =cut use MooseX::Types::Moose qw(ArrayRef CodeRef); use Pod::Elemental::Element::Nested; use Pod::Elemental::Selectors -all; use namespace::autoclean; #pod =attr top_selector #pod #pod This attribute must be a coderef (presumably made from #pod Pod::Elemental::Selectors) that will test elements in the transformed node and #pod return true if the element is a potential new container. #pod #pod =cut has top_selector => ( is => 'ro', isa => CodeRef, required => 1, ); #pod =attr content_selectors #pod #pod This attribute must be an arrayref of coderefs (again presumably made from #pod Pod::Elemental::Selectors) that will test whether paragraphs subsequent to the #pod top-level container may be moved under the container. #pod #pod =cut has content_selectors => ( is => 'ro', isa => ArrayRef[ CodeRef ], required => 1, ); sub _is_containable { my ($self, $para) = @_; for my $sel (@{ $self->content_selectors }) { return 1 if $sel->($para); } return; } sub transform_node { my ($self, $node) = @_; # We used to say (length -2) because "if we're already at the last element, # we can't nest anything -- there's nothing subsequent to the potential # top-level element to nest!" -- my (rjbs's) reasoning in 2009. # # This was an unneeded optimization, and therefore stupid. Worse, it was a # bug. It meant that a nestable element that was the last element in a # sequence wouldn't be upgraded to a Nested element, so later munging could # barf. In fact, that's what happened in [rt.cpan.org #69189] # -- rjbs, 2012-05-04 PASS: for my $i (0 .. @{ $node->children }- 1) { last PASS if $i >= @{ $node->children }; my $para = $node->children->[ $i ]; next unless $self->top_selector->($para); if (s_command(undef, $para) and not s_node($para)) { $para = $node->children->[ $i ] = Pod::Elemental::Element::Nested->new({ command => $para->command, content => $para->content, }); } if (! s_node($para) or @{ $para->children }) { confess "can't use $para as the top of a nesting"; } my @to_nest; NEST: for my $j ($i+1 .. @{ $node->children } - 1) { last unless $self->_is_containable($node->children->[ $j ]); push @to_nest, $j; } if (@to_nest) { my @to_nest_elem = splice @{ $node->children }, $to_nest[0], scalar(@to_nest); push @{ $para->children }, @to_nest_elem; next PASS; } } return $node; } __PACKAGE__->meta->make_immutable; 1; __END__ =pod =encoding UTF-8 =head1 NAME Pod::Elemental::Transformer::Nester - group the document into sections =head1 VERSION version 0.103006 =head1 OVERVIEW The Nester transformer is meant to find potential container elements and make them into actual containers. It works by being told what elements may be made into containers and what subsequent elements they should allow to be stuffed into them. For example, given the following nester: use Pod::Elemental::Selectors qw(s_command s_flat); my $nester = Pod::Elemental::Transformer::Nester->new({ top_selector => s_command('head1'), content_selectors => [ s_command([ qw(head2 head3 head4) ]), s_flat, ], }); ..then when we apply the transformation: $nester->transform_node($document); ...the nester will find all C<=head1> elements in the top-level of the document. It will ensure that they are represented by objects that perform the Pod::Elemental::Node role, and then it will move all subsequent elements matching the C into the container. So, if we start with this input: =head1 Header =head2 Subheader Pod5::Ordinary =head1 New Header The nester will convert its structure to look like this: =head1 Header =head2 Subheader Pod5::Ordinary =head1 New Header Once an element is reached that does not pass the content selectors, the nesting ceases until the next potential container. =head1 PERL VERSION This library should run on perls released even a long time ago. It should work on any version of perl released in the last five years. Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. =head1 ATTRIBUTES =head2 top_selector This attribute must be a coderef (presumably made from Pod::Elemental::Selectors) that will test elements in the transformed node and return true if the element is a potential new container. =head2 content_selectors This attribute must be an arrayref of coderefs (again presumably made from Pod::Elemental::Selectors) that will test whether paragraphs subsequent to the top-level container may be moved under the container. =head1 AUTHOR Ricardo SIGNES =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2022 by Ricardo SIGNES. 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 Pod-Elemental-0.103006/xt/author/000755 000765 000024 00000000000 14354124547 016442 5ustar00rjbsstaff000000 000000 Pod-Elemental-0.103006/xt/release/000755 000765 000024 00000000000 14354124547 016560 5ustar00rjbsstaff000000 000000 Pod-Elemental-0.103006/xt/release/changes_has_content.t000644 000765 000024 00000002104 14354124547 022737 0ustar00rjbsstaff000000 000000 use Test::More tests => 2; note 'Checking Changes'; my $changes_file = 'Changes'; my $newver = '0.103006'; my $trial_token = '-TRIAL'; my $encoding = 'UTF-8'; SKIP: { ok(-e $changes_file, "$changes_file file exists") or skip 'Changes is missing', 1; ok(_get_changes($newver), "$changes_file has content for $newver"); } done_testing; sub _get_changes { my $newver = shift; # parse changelog to find commit message open(my $fh, '<', $changes_file) or die "cannot open $changes_file: $!"; my $changelog = join('', <$fh>); if ($encoding) { require Encode; $changelog = Encode::decode($encoding, $changelog, Encode::FB_CROAK()); } close $fh; my @content = grep { /^$newver(?:$trial_token)?(?:\s+|$)/ ... /^\S/ } # from newver to un-indented split /\n/, $changelog; shift @content; # drop the version line # drop unindented last line and trailing blank lines pop @content while ( @content && $content[-1] =~ /^(?:\S|\s*$)/ ); # return number of non-blank lines return scalar @content; } Pod-Elemental-0.103006/xt/author/pod-syntax.t000644 000765 000024 00000000252 14354124547 020734 0ustar00rjbsstaff000000 000000 #!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(); Pod-Elemental-0.103006/t/elem/000755 000765 000024 00000000000 14354124547 015672 5ustar00rjbsstaff000000 000000 Pod-Elemental-0.103006/t/objectifier.t000644 000765 000024 00000006462 14354124547 017432 0ustar00rjbsstaff000000 000000 use strict; use warnings; use Test::More tests => 1; use Test::Deep; use Pod::Eventual::Simple; use Pod::Elemental::Objectifier; my $events = Pod::Eventual::Simple->read_file('t/eg/Simple.pm'); my $elements = Pod::Elemental::Objectifier->objectify_events($events); my @want = ( { type => 'Nonpod', content => ignore() }, { type => 'Command', command => 'head1', content => "DESCRIPTION\n" }, { type => 'Blank', content => "\n" }, { type => 'Text', content => re(qr{^This is .+ that\?}) }, { type => 'Blank', content => "\n" }, { type => 'Command', command => 'synopsis', content => "\n" }, { type => 'Blank', content => "\n" }, { type => 'Text', content => re(qr{^ use Test.+;$}) }, { type => 'Blank', content => "\n" }, { type => 'Text', content => re(qr{^ .*uisp.*$}) }, { type => 'Blank', content => "\n" }, { type => 'Command', command => 'head2', content => "Free Radical\n" }, { type => 'Blank', content => "\n" }, { type => 'Command', command => 'head3', content => "Subsumed Radical\n" }, { type => 'Blank', content => "\n" }, { type => 'Command', command => 'over', content => "4\n" }, { type => 'Blank', content => "\n" }, { type => 'Command', command => 'item', content => re(qr{^\* nom.+st$}) }, { type => 'Blank', content => "\n" }, { type => 'Command', command => 'back', content => "\n" }, { type => 'Blank', content => "\n" }, { type => 'Command', command => 'method', content => "none\n" }, { type => 'Blank', content => "\n" }, { type => 'Text', content => "Nope, there are no methods.\n" }, { type => 'Blank', content => "\n" }, { type => 'Command', command => 'attr', content => "also_none\n" }, { type => 'Blank', content => "\n" }, { type => 'Text', content => "None of these, either.\n" }, { type => 'Blank', content => "\n" }, { type => 'Command', command => 'method', content => "i_lied\n" }, { type => 'Blank', content => "\n" }, { type => 'Text', content => "Ha! Gotcha!\n" }, { type => 'Blank', content => "\n" }, { type => 'Command', command => 'cut', content => "\n" }, { type => 'Nonpod', content => ignore() }, ); my @got; for my $elem (@$elements) { my $class = ref $elem; $class =~ s/^.+:://g; push @got, { type => $class, content => $elem->content, ($elem->can('command') ? (command => $elem->command) : ()), }; } use Data::Dumper; cmp_deeply( \@got, \@want, "we get the right chunky content we wanted", ); Pod-Elemental-0.103006/t/pod5/000755 000765 000024 00000000000 14354124547 015617 5ustar00rjbsstaff000000 000000 Pod-Elemental-0.103006/t/selectors.t000644 000765 000024 00000004476 14354124547 017153 0ustar00rjbsstaff000000 000000 use strict; use warnings; use Test::More; use Pod::Elemental::Selectors -all; use Pod::Elemental::Element::Generic::Command; use Pod::Elemental::Element::Generic::Text; use Pod::Elemental::Element::Pod5::Command; use Pod::Elemental::Element::Pod5::Ordinary; my %elem; my %sel; $elem{g_head1} = Pod::Elemental::Element::Generic::Command->new({ command => 'head1', content => "\n", }); $elem{g_head2} = Pod::Elemental::Element::Generic::Command->new({ command => 'head2', content => "\n", }); $elem{g_text} = Pod::Elemental::Element::Generic::Text->new({ content => "Generic text.\n", }); $elem{p5_head1} = Pod::Elemental::Element::Pod5::Command->new({ command => 'head1', content => "\n", }); $elem{p5_head2} = Pod::Elemental::Element::Pod5::Command->new({ command => 'head2', content => "\n", }); $elem{p5_ord} = Pod::Elemental::Element::Pod5::Ordinary->new({ content => "Ordinary text.\n", }); $sel{head1} = s_command('head1'); $sel{cmd} = s_command; $sel{msc1} = s_command([ qw(head1) ]); $sel{msc2} = s_command([ qw(over head1) ]); $sel{msc3} = s_command([ qw(head1 head2) ]); my @test = ( head1 => g_head1 => 1, head1 => g_head2 => 0, head1 => g_text => 0, head1 => p5_head1 => 1, head1 => p5_head2 => 0, head1 => p5_ord => 0, cmd => g_head1 => 1, cmd => g_head2 => 1, cmd => g_text => 0, cmd => p5_head1 => 1, cmd => p5_head2 => 1, cmd => p5_ord => 0, msc1 => g_head1 => 1, msc1 => g_head2 => 0, msc1 => g_text => 0, msc1 => p5_head1 => 1, msc1 => p5_head2 => 0, msc1 => p5_ord => 0, msc2 => g_head1 => 1, msc2 => g_head2 => 0, msc2 => g_text => 0, msc2 => p5_head1 => 1, msc2 => p5_head2 => 0, msc2 => p5_ord => 0, msc3 => g_head1 => 1, msc3 => g_head2 => 1, msc3 => g_text => 0, msc3 => p5_head1 => 1, msc3 => p5_head2 => 1, msc3 => p5_ord => 0, ); plan tests => scalar(@test/3); for my $i (0 .. @test/3 - 1) { my ($sel_name, $elem_name, $expect) = splice @test, 0, 3; my $str = $expect ? "matches" : "doesn't match"; die "unknown element '$elem_name'" unless my $elem = $elem{ $elem_name }; die "unknown selector '$sel_name'" unless my $sel = $sel{ $sel_name }; my $ok = $sel->($elem); $ok = not $ok if ! $expect; ok($ok, "expect that $elem_name $str $sel_name"); } 1; Pod-Elemental-0.103006/t/nester.t000644 000765 000024 00000002771 14354124547 016444 0ustar00rjbsstaff000000 000000 #!perl use strict; use warnings; use Test::More; use Test::Differences; use Pod::Eventual::Simple; use Pod::Elemental; use Pod::Elemental::Selectors -all; use Pod::Elemental::Transformer::Pod5; use Pod::Elemental::Transformer::Nester; my $str = do { local $/; }; my $document = Pod::Elemental->read_string($str); Pod::Elemental::Transformer::Pod5->transform_node($document); my $nester = Pod::Elemental::Transformer::Nester->new({ top_selector => s_command('head1'), content_selectors => [ s_flat, s_command( [ qw(head2 head3 head4 over item back) ]), ], }); $nester->transform_node($document); my @children = @{ $document->children }; is(@children, 3, "the nested document has 3 top-level elements"); ok(s_flat($children[0]), "the first paragraph is a flat/text paragraph"); ok( $children[1]->isa('Pod::Elemental::Element::Nested'), "the second paragraph is a nested command node", ); { my @children = @{ $children[1]->children }; is(@children, 7, "...which has 7 children"); } ok( $children[2]->isa('Pod::Elemental::Element::Nested'), "the third paragraph is a nested command node", ); { my @children = @{ $children[2]->children }; is(@children, 1, "...which has 1 child"); } eq_or_diff($document->as_pod_string, $str, "round-tripped okay"); done_testing; __DATA__ =pod Ordinary Paragraph 1.1 =head1 Header 1.1 =head2 Header 2.1 =head2 Header 2.2 Ordinary Paragraph 2.1 =head3 Header 3.1 =over 4 =item * foo =back =head1 Header 1.2 Ordinary Paragraph 2.1 =cut Pod-Elemental-0.103006/t/types.t000644 000765 000024 00000000273 14354124547 016303 0ustar00rjbsstaff000000 000000 use strict; use warnings; use Test::More; use Pod::Elemental::Types -all; is( to_ChompedString("this is a string\n"), "this is a string", "we can 'autochomp'", ); done_testing; Pod-Elemental-0.103006/t/elemental.t000644 000765 000024 00000000255 14354124547 017105 0ustar00rjbsstaff000000 000000 use strict; use warnings; use Test::More tests => 1; use Test::Deep; use Pod::Elemental; my $document = Pod::Elemental->read_file('t/eg/one-with-everything.pod'); ok(1); Pod-Elemental-0.103006/t/gather.t000644 000765 000024 00000004434 14354124547 016414 0ustar00rjbsstaff000000 000000 #!perl use strict; use warnings; use Test::More; use Test::Differences; use Pod::Eventual::Simple; use Pod::Elemental; use Pod::Elemental::Selectors -all; use Pod::Elemental::Transformer::Pod5; use Pod::Elemental::Transformer::Nester; use Pod::Elemental::Transformer::Gatherer; my $str = do { local $/; }; my $document = Pod::Elemental->read_string($str); Pod::Elemental::Transformer::Pod5->transform_node($document); my $nester = Pod::Elemental::Transformer::Nester->new({ top_selector => s_command([ qw(head1 method) ]), content_selectors => [ s_flat, s_command( [ qw(head2 head3 head4 over item back) ]), ], }); my $gatherer = Pod::Elemental::Transformer::Gatherer->new({ gather_selector => s_command([ qw(method) ]), container => Pod::Elemental::Element::Nested->new({ command => 'head1', content => "METHODS\n", }), }); $nester->transform_node($document); $gatherer->transform_node($document); $_->command('head2') foreach grep { s_command('method')->($_) } @{ $gatherer->container->children }; my @children = @{ $document->children }; is(@children, 4, "the nested document has 4 top-level elements"); ok(s_flat($children[0]), "the first paragraph is a flat/text paragraph"); ok( $children[1]->isa('Pod::Elemental::Element::Nested'), "the second paragraph is a nested command node", ); { my @children = @{ $children[1]->children }; is(@children, 1, "...which has 1 child"); } ok( $children[2]->isa('Pod::Elemental::Element::Nested'), "the third paragraph is a nested command node", ); { my @children = @{ $children[2]->children }; is(@children, 2, "...which has 2 children"); { my @children = @{ $children[0]->children }; is(@children, 10, "...the first of which which has 10 children"); } } ok( $children[3]->isa('Pod::Elemental::Element::Nested'), "the fourth paragraph is a nested command node", ); { my @children = @{ $children[3]->children }; is(@children, 1, "...which has 1 child"); } done_testing; __DATA__ =pod Ordinary Paragraph 1.1 =head1 Header 1.1 =head2 Header 2.1 =method foo Ordinary Paragraph 2.1 =over 2 =item * bar =back =head2 Header 2.2 Ordinary Paragraph 2.2 =head3 Header 3.1 =over 4 =item * foo =back =head1 Header 1.2 Ordinary Paragraph 2.3 =method quux Ordinary Paragraph 2.4 =cut Pod-Elemental-0.103006/t/from-lol.t000644 000765 000024 00000003332 14354124547 016665 0ustar00rjbsstaff000000 000000 #!perl use strict; use warnings; use Test::More 'no_plan'; use Pod::Elemental::Document; use Test::Differences; my $pod_string = do { local $/; open my $fh, '<', 't/eg/from-lol.pod' or die "can't read test data: $!"; <$fh>; }; my $flat_lol = [ [ '=head1' => "This is a head." ], [ '=head2' => "This is a subhead." ], [ (undef) => "Ordinary 1" ], [ (undef) => "Ordinary 2" ], [ '=begin' => ':pod_region' ], [ (undef) => "Ordinary 3" ], [ (undef) => "Ordinary 4" ], [ '=head1' => 'This is a head.' ], [ '=begin' => 'nonpod_region' ], [ (undef) => "Data 1" ], [ (undef) => "Data 2" ], [ (undef) => "Data 3" ], [ '=end' => 'nonpod_region' ], [ '=end' => ':pod_region' ], [ '=begin' => ':empty' ], [ '=end' => ':empty' ], ]; { my $document = Pod::Elemental::Document->new_from_lol($flat_lol); isa_ok($document, 'Pod::Elemental::Document'); is( $document->as_pod_string, $pod_string, "from_lol stringifies to what we want", ); } # my $nested_lol = [ # [ '=head1' => "This is a head." ], # [ '=head2' => "This is a subhead." ], # [ (undef) => "Ordinary 1" ], # [ (undef) => "Ordinary 2" ], # [ ':pod_region' => [ # [ (undef) => "Ordinary 3" ], # [ (undef) => "Ordinary 4" ], # [ '=head1' => 'This is a head.' ], # [ nonpod_region => [ # [ (undef) => "Data 1" ], # [ (undef) => "Data 2" ], # [ (undef) => "Data 3" ], # ] ], # ] ], # ]; # # { # my $document = Pod::Elemental::Document->new_from_lol($nested_lol); # isa_ok($document, 'Pod::Elemental::Document'); # eq_or_diff( # $document->as_pod_string, # $pod_string, # "from_lol stringifies to what we want", # ); # } Pod-Elemental-0.103006/t/00-report-prereqs.t000644 000765 000024 00000013452 14354124547 020351 0ustar00rjbsstaff000000 000000 #!perl use strict; use warnings; # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.028 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('Reported prereqs'); # vim: ts=4 sts=4 sw=4 et: Pod-Elemental-0.103006/t/00-report-prereqs.dd000644 000765 000024 00000004431 14354124547 020472 0ustar00rjbsstaff000000 000000 do { my $x = { 'configure' => { 'requires' => { 'ExtUtils::MakeMaker' => '6.78' } }, 'develop' => { 'requires' => { 'Test::More' => '0', 'Test::Pod' => '1.41' } }, 'runtime' => { 'requires' => { 'Class::Load' => '0', 'Encode' => '0', 'List::Util' => '1.33', 'Mixin::Linewise::Readers' => '0', 'Moose' => '0', 'Moose::Role' => '0.90', 'MooseX::Types' => '0', 'MooseX::Types::Moose' => '0', 'Pod::Eventual::Simple' => '0.004', 'String::RewritePrefix' => '0', 'String::Truncate' => '0', 'Sub::Exporter' => '0', 'Sub::Exporter::ForMethods' => '0', 'namespace::autoclean' => '0', 'perl' => '5.012', 'strict' => '0', 'utf8' => '0', 'warnings' => '0' } }, 'test' => { 'recommends' => { 'CPAN::Meta' => '2.120900' }, 'requires' => { 'Data::Dumper' => '0', 'ExtUtils::MakeMaker' => '0', 'File::Spec' => '0', 'Test::Deep' => '0', 'Test::Differences' => '0', 'Test::More' => '0.96' } } }; $x; }Pod-Elemental-0.103006/t/eg/000755 000765 000024 00000000000 14354124547 015343 5ustar00rjbsstaff000000 000000 Pod-Elemental-0.103006/t/eg/nested-over.pod000644 000765 000024 00000000243 14354124547 020301 0ustar00rjbsstaff000000 000000 =head1 DESCRIPTION Foo. =over =item * one =over =item * oneone =item * twotwo =back =item * two =back =head2 Sub-Description Bar. =head1 Final Baz. Pod-Elemental-0.103006/t/eg/nested-begin.pod000644 000765 000024 00000000351 14354124547 020412 0ustar00rjbsstaff000000 000000 =pod =head1 DESCRIPTION Foo. =begin outer =begin inner =head1 Inner! =over =item * one =back =begin inner =head1 Another! =end inner =head2 Welcome to my Second Head =end inner =head3 Finalizing =end outer Baz. =cut Pod-Elemental-0.103006/t/eg/one-with-everything.pod000644 000765 000024 00000000530 14354124547 021761 0ustar00rjbsstaff000000 000000 =head1 DESCRIPTION Foo. =over 2 =item * parent =over 1 =item * child =back =back =begin outer =begin inner =head1 Inner! =over 4 =cut We can put non-pod text in the strangest places. =item * one =back =begin inner =head1 Another! =end inner =head2 Welcome to my Second Head =end inner =head3 Finalizing =end outer Baz. Pod-Elemental-0.103006/t/eg/from-lol.pod000644 000765 000024 00000000412 14354124547 017573 0ustar00rjbsstaff000000 000000 =pod =head1 This is a head. =head2 This is a subhead. Ordinary 1 Ordinary 2 =begin :pod_region Ordinary 3 Ordinary 4 =head1 This is a head. =begin nonpod_region Data 1 Data 2 Data 3 =end nonpod_region =end :pod_region =begin :empty =end :empty =cut Pod-Elemental-0.103006/t/eg/Simple.pm000644 000765 000024 00000000661 14354124547 017135 0ustar00rjbsstaff000000 000000 use strict; package Simple; # ABSTRACT: this is just a test =head1 DESCRIPTION This is a test. How many times do I need to tell you that? =synopsis use Test::Example::Pod q(uisp); uisp('q'); =head2 Free Radical =head3 Subsumed Radical =over 4 =item * nom nom nom list =back =method none Nope, there are no methods. =attr also_none None of these, either. =method i_lied Ha! Gotcha! =cut sub i_lied { ... } 1; Pod-Elemental-0.103006/t/pod5/nested-same.t000644 000765 000024 00000001434 14354124547 020213 0ustar00rjbsstaff000000 000000 #!perl use strict; use warnings; # PURPOSE: # show that we can have a "foo" region inside another "foo" region use Test::More tests => 1; use Test::Deep; use Test::Differences; use Pod::Eventual::Simple; use Pod::Elemental::Objectifier; use Pod::Elemental::Transformer::Pod5; use Pod::Elemental::Document; my $string = do { local $/; open my $fh, '<', 't/eg/nested-begin.pod'; <$fh>; }; my @events = grep { $_->{type} ne 'nonpod' } @{ Pod::Eventual::Simple->read_file('t/eg/nested-begin.pod') }; my $elements = Pod::Elemental::Objectifier->objectify_events(\@events); my $document = Pod::Elemental::Document->new({ children => $elements }); Pod::Elemental::Transformer::Pod5->transform_node($document); eq_or_diff($document->as_pod_string, $string, 'we got what we expected'); Pod-Elemental-0.103006/t/pod5/nonpod.t000644 000765 000024 00000001016 14354124547 017277 0ustar00rjbsstaff000000 000000 #!perl use strict; use warnings; use Test::More; use Pod::Elemental; use Pod::Elemental::Transformer::Pod5; use Pod::Elemental::Element::Pod5::Region; use Pod::Elemental::Element::Pod5::Ordinary; my $for_pl_pod = <<'END_POD'; This is not a Pod paragraph. =cut END_POD ### parse a podlike =for my $for_pl = Pod::Elemental->read_string($for_pl_pod); Pod::Elemental::Transformer::Pod5->new->transform_node($for_pl); my $para = $for_pl->children->[0]; isa_ok($para, 'Pod::Elemental::Element::Pod5::Nonpod'); done_testing; Pod-Elemental-0.103006/t/pod5/combine.t000644 000765 000024 00000004467 14354124547 017433 0ustar00rjbsstaff000000 000000 #!perl use strict; use warnings; # PURPOSE: # sequences of text..(blank|text)+..text should be collapsed into text # sequences of data..(blank|data)+..data should be collapsed into data use Test::More; use Test::Differences; use Pod::Eventual::Simple; use Pod::Elemental; use Pod::Elemental::Transformer::Pod5; sub _pod5 { "Pod::Elemental::Element::Pod5::$_[0]" } my $str = do { local $/; }; my $document = Pod::Elemental::Transformer::Pod5->transform_node( Pod::Elemental->read_string($str), ); my @children = grep { ! $_->isa('Pod::Elemental::Element::Generic::Blank') } @{ $document->children }; is(@children, 4, "four top-level elements"); isa_ok($children[0], _pod5('Ordinary'), "...first element"); isa_ok($children[1], _pod5('Ordinary'), "...second element"); isa_ok($children[2], _pod5('Region'), "...third element"); isa_ok($children[3], _pod5('Ordinary'), "...fourth element"); { # first region contents my @children = grep { ! $_->isa('Pod::Elemental::Element::Generic::Blank') } @{ $children[2]->children }; is(@children, 7, "top-level-contained region has five non-blanks"); isa_ok($children[0], _pod5('Ordinary'), "...1st second-level para"); isa_ok($children[1], _pod5('Ordinary'), "...2nd second-level para"); isa_ok($children[2], _pod5('Verbatim'), "...3rd second-level para"); isa_ok($children[3], _pod5('Ordinary'), "...4th second-level para"); isa_ok($children[4], _pod5('Verbatim'), "...5th second-level para"); isa_ok($children[5], _pod5('Region'), "...6th second-level para"); isa_ok($children[6], _pod5('Ordinary'), "...7th second-level para"); { # second region contents my @children = grep { ! $_->isa('Pod::Elemental::Element::Generic::Blank') } @{ $children[5]->children }; is(@children, 1, "second-level-contained region has one non-blank"); isa_ok($children[0], _pod5('Data'), "...1st third-level para"); } } done_testing; __DATA__ =pod Ordinary Paragraph 1.1 Ordinary Paragraph 1.2 =begin :pod_like Ordinary Paragraph 2.1 Ordinary Paragraph 2.2 Verbatim Paragraph 2.1 Verbatim Paragraph 2.2 Ordinary Paragraph 2.3 Verbatim Paragraph 2.3 =begin nonpod Data Paragraph 3.1 Data Paragraph 3.2 Data Paragraph 3.3 =end nonpod Ordinary Paragraph 2.4 =end :pod_like Ordinary Paragraph 1.3 Pod-Elemental-0.103006/t/pod5/data-blanks.t000644 000765 000024 00000000755 14354124547 020174 0ustar00rjbsstaff000000 000000 #!/usr/bin/env perl use strict; use warnings; use Pod::Elemental; use Pod::Elemental::Transformer::Pod5; use Test::More; my $string = <<'END_POD'; =begin foo =over 4 =item * foo bar =item * bar baz =back =end foo END_POD my $document = Pod::Elemental->read_string($string); Pod::Elemental::Transformer::Pod5->new->transform_node($document); like( $document->as_pod_string, qr{^=item \* bar\n\nbaz\n\n=back}m, "we do not drop newlines in data paragraphs", ); done_testing; Pod-Elemental-0.103006/t/pod5/for-begin.t000644 000765 000024 00000010274 14354124547 017660 0ustar00rjbsstaff000000 000000 #!perl use strict; use warnings; use Test::More tests => 10; use Pod::Elemental; use Pod::Elemental::Transformer::Pod5; use Pod::Elemental::Element::Pod5::Region; use Pod::Elemental::Element::Pod5::Ordinary; ### =begin with content (no children) my $begin_content = Pod::Elemental::Element::Pod5::Region->new({ format_name => 'test', is_pod => 1, content => "This is a test.\n", }); my $begin_content_expected = <<'END_FOR'; =begin :test This is a test. =end :test END_FOR is( $begin_content->as_pod_string, $begin_content_expected, "Region with content is =begin/=end", ); ### =begin with children (no content) my $begin_children = Pod::Elemental::Element::Pod5::Region->new({ format_name => 'test', is_pod => 1, content => "\n", children => [ Pod::Elemental::Element::Pod5::Ordinary->new({ content => "Ordinary paragraph 1.\n", }), Pod::Elemental::Element::Pod5::Ordinary->new({ content => "Ordinary paragraph 2.\n", }), ], }); my $begin_children_expected = <<'END_FOR'; =begin :test Ordinary paragraph 1. Ordinary paragraph 2. =end :test END_FOR is( $begin_children->as_pod_string, $begin_children_expected, "Region with 2 children is =begin/=end", ); ### =begin nonpod with data para with newlines my $input_pod = <<'END_POD'; =begin foo Data 1 Data 1 =end foo END_POD my $begin_2data = Pod::Elemental->read_string($input_pod); Pod::Elemental::Transformer::Pod5->transform_node($begin_2data); my $begin_2data_expected = <<'END_BEGIN'; =begin foo Data 1 Data 1 =end foo END_BEGIN is( $begin_2data->children->[0]->as_pod_string, $begin_2data_expected, "1 data para w/newlines", ); ### =begin with children and content my $begin_both = Pod::Elemental::Element::Pod5::Region->new({ format_name => 'test', is_pod => 1, content => "This is a test.\n", children => [ Pod::Elemental::Element::Pod5::Ordinary->new({ content => "Ordinary paragraph.\n", }), ], }); my $begin_both_expected = <<'END_FOR'; =begin :test This is a test. Ordinary paragraph. =end :test END_FOR is( $begin_both->as_pod_string, $begin_both_expected, "Region with content & children is =begin/=end", ); ### a region with para with blanks should become =begin, not =for { my $begin_with_content_blanks = Pod::Elemental::Element::Pod5::Region->new({ format_name => 'test', is_pod => 0, content => "\n", children => [ Pod::Elemental::Element::Pod5::Data->new({ content => "Ordinary\n \n paragraph.", }), ], }); my $expected = <<'END_FOR'; =begin test Ordinary paragraph. =end test END_FOR is( $begin_with_content_blanks->as_pod_string, $expected, "region with 1 child that has blanks is =begin", ); } ### =for my $for = Pod::Elemental::Element::Pod5::Region->new({ format_name => 'test', is_pod => 1, content => "\n", children => [ Pod::Elemental::Element::Pod5::Ordinary->new({ content => "Ordinary paragraph.\n", }), ], }); my $for_expected = <<'END_FOR'; =for :test Ordinary paragraph. END_FOR is( $for->as_pod_string, $for_expected, "Region with 1 child and no content is =for", ); ### parse a non-pod =for my $for_np_pod = <<'END_POD'; =pod =for foo This is the content. =cut END_POD my $for_np = Pod::Elemental->read_string($for_np_pod); Pod::Elemental::Transformer::Pod5->new->transform_node($for_np); my $for_np_elem = $for_np->children->[0]; ok( $for_np_elem->isa('Pod::Elemental::Element::Pod5::Region'), "a =for (non-pod) element becomes a region", ); ok( $for_np_elem->children->[0]->isa('Pod::Elemental::Element::Pod5::Data'), "...and its content became a data paragraph", ); my $for_pl_pod = <<'END_POD'; =pod =for :foo This is the content. =cut END_POD ### parse a podlike =for my $for_pl = Pod::Elemental->read_string($for_pl_pod); Pod::Elemental::Transformer::Pod5->new->transform_node($for_pl); my $for_pl_elem = $for_pl->children->[0]; ok( $for_pl_elem->isa('Pod::Elemental::Element::Pod5::Region'), "a =for (pod-like) element becomes a region", ); ok( $for_pl_elem->children->[0]->isa('Pod::Elemental::Element::Pod5::Ordinary'), "...and its content became an ordinary paragraph", ); Pod-Elemental-0.103006/t/pod5/cut.t000644 000765 000024 00000003435 14354124547 016604 0ustar00rjbsstaff000000 000000 #!perl use strict; use warnings; # PURPOSE: # test that we eliminate =cut elements in favor of Pod5::Nonpod use Test::More; use Test::Deep; use Test::Differences; use Pod::Eventual::Simple; use Pod::Elemental::Objectifier; use Pod::Elemental::Transformer::Pod5; use Pod::Elemental::Document; use Pod::Elemental::Selectors '-all'; my $str = do { local $/; }; my $events = Pod::Eventual::Simple->read_string($str); my $elements = Pod::Elemental::Objectifier->objectify_events($events); my $document = Pod::Elemental::Document->new({ children => $elements }); Pod::Elemental::Transformer::Pod5->transform_node($document); is(scalar(grep { s_command('cut', $_) } @{ $document->children }), 0, 'no =cut cmds'); # XXX: HORRIBLE grep predicate -- rjbs, 2009-10-20 my @top_nonpod = grep { ref =~ /Nonpod$/ } @{ $document->children }; is(@top_nonpod, 1, "we have one top-level nonpod element"); ok($top_nonpod[0] == $document->children->[5], "...it's the 6th element"); like($top_nonpod[0]->content, qr{\QNonpod 2.0}, "...and the one we expect"); my $region = $document->children->[2]; isa_ok($region, 'Pod::Elemental::Element::Pod5::Region', '3rd element'); { # XXX: HORRIBLE grep predicate -- rjbs, 2009-10-20 my @reg_nonpod = grep { ref =~ /Nonpod$/ } @{ $region->children }; is(@reg_nonpod, 1, "we have one 2nd-level nonpod element"); ok($reg_nonpod[0] == $region->children->[1], "...it's the 2nd element"); like( $reg_nonpod[0]->content, qr{Nonpod 1.0\n.+Continued}sm, "...and the one we expect", ); } done_testing; __DATA__ =pod =head1 DESCRIPTION Ordinary 1.1 =begin nonpod Data 2.1 =cut Nonpod 1.0 Nonpod 1.0 Continued =head1 Nonpod Header Data 2.2 =end nonpod =head1 Outer Header Ordinary 1.2 =cut Nonpod 2.0 =pod Ordinary 1.3 =head2 Subheader Complete. =cut Pod-Elemental-0.103006/t/pod5/text-type.t000644 000765 000024 00000003035 14354124547 017750 0ustar00rjbsstaff000000 000000 #!perl use strict; use warnings; # PURPOSE: # show that pod-like regions have Ordinary text paragraphs and non-pod-like # regions have data paragraphs use Test::More; use Test::Differences; use Pod::Eventual::Simple; use Pod::Elemental; use Pod::Elemental::Transformer::Pod5; sub _pod5 { "Pod::Elemental::Element::Pod5::$_[0]" } my $str = do { local $/; }; my $document = Pod::Elemental::Transformer::Pod5->transform_node( Pod::Elemental->read_string($str), ); my @children = grep { ! $_->isa('Pod::Elemental::Element::Generic::Blank') } @{ $document->children }; is(@children, 2, "two top-level elements"); isa_ok($children[0], _pod5('Ordinary'), "...first top-level text"); isa_ok($children[1], _pod5('Region'), "...second top-level para"); { # region contents my @children = grep { ! $_->isa('Pod::Elemental::Element::Generic::Blank') } @{ $children[1]->children }; is(@children, 5, "top-level-contained region has five non-blanks"); isa_ok($children[0], _pod5('Ordinary'), "...1st second-level para"); isa_ok($children[1], _pod5('Verbatim'), "...2nd second-level para"); isa_ok($children[2], _pod5('Ordinary'), "...3rd second-level para"); isa_ok($children[3], _pod5('Region'), "...4th second-level para"); isa_ok($children[4], _pod5('Ordinary'), "...5th second-level para"); } done_testing; __DATA__ =pod Ordinary Paragraph =begin :pod_like Ordinary Paragraph Verbatim Paragraph Ordinary Paragraph =begin nonpod Data Paragraph =end nonpod Ordinary Paragraph =end :pod_like Pod-Elemental-0.103006/t/pod5/region.t000644 000765 000024 00000002325 14354124547 017271 0ustar00rjbsstaff000000 000000 #!perl use strict; use warnings; # PURPOSE: # show that begin/end are turned into regions with the correct properties use Test::More; use Pod::Elemental; use Pod::Elemental::Transformer::Pod5; my $content = do { local $/; open my $fh, '<', 't/eg/from-lol.pod' or die "can't read: $!"; <$fh>; }; my $doc = Pod::Elemental->read_string($content); { my @regions = grep { (ref $_) =~ /Region/ } @{ $doc->children }; is(@regions, 0, "there are no regions prior to Pod5 transform"); } Pod::Elemental::Transformer::Pod5->new->transform_node($doc); { my @regions = grep { (ref $_) =~ /Region/ } @{ $doc->children }; is(@regions, 2, "there is one (top-level) region post transformation"); my @subregions = grep { (ref $_) =~ /Region/ } @{ $regions[0]->children }; is(@subregions, 1, "there is one (2nd-level) region post transformation"); my @subsub = grep { (ref $_) =~ /Region/ } @{ $subregions[0]->children }; is(@subsub, 0, "there are no (3rd-level) region post transformation"); is($regions[1]->format_name, 'empty', '2nd top-level region is "empty"'); my @sub2 = grep { (ref $_) =~ /Region/ } @{ $regions[1]->children }; is(@sub2, 0, "there are no children of 2nd top-level region"); } done_testing; Pod-Elemental-0.103006/t/elem/nested.t000644 000765 000024 00000001526 14354124547 017345 0ustar00rjbsstaff000000 000000 #!perl use strict; use warnings; use Test::More tests => 1; use Pod::Elemental::Element::Pod5::Command; use Pod::Elemental::Element::Pod5::Ordinary; use Pod::Elemental::Element::Nested; my $nested = Pod::Elemental::Element::Nested->new({ command => 'head1', content => "Header 1.\n", children => [ Pod::Elemental::Element::Pod5::Command->new({ command => 'head2', content => "Header 2.1.\n", }), Pod::Elemental::Element::Pod5::Ordinary->new({ content => "Ordinary.\n", }), Pod::Elemental::Element::Pod5::Command->new({ command => 'head2', content => "Header 2.2.\n", }), ], }); my $pod_expected = <<'END_FOR'; =head1 Header 1. =head2 Header 2.1. Ordinary. =head2 Header 2.2. END_FOR is( $nested->as_pod_string, $pod_expected, "nested element pod-stringifies as expected", );