Pod::W...ections(3pm)
Pod::Weaver::Plugin::EnsureUniqueSections π
okay bestie, gather round, because this is a Perl module and its whole entire job is making sure your POD doesn't have two sections with the same name. that's it. that's the vibe. it lives in the Pod::Weaver::Plugin::EnsureUniqueSections namespace and it is version 0.163250 β¨
πΈ NAME πΈ
Pod::Weaver::Plugin::EnsureUniqueSections β make sure your POD has no duplicate section headers, periodt. no cap. π
π¦ VERSION π¦
version 0.163250
β¨ SYNOPSIS β¨
so in your weaver.ini you just drop this in:
[-EnsureUniqueSections]
strict = 0 ; The default
and boom, you're protected. π«Ά
π DESCRIPTION π
this plugin literally just makes sure that the POD you get after weaving has zero duplicate top-level section headers. that's the whole thing. π
ngl it's a lifesaver if you're in your "converting from writing all my own POD by hand to generating it with Pod::Weaver" era. like, imagine you start generating a section with Pod::Weaver but you forget to delete the manually-written section with the same name β now you've got two of the same thing and it's giving chaos. this plugin will warn you about it. it's the friend who texts you "bestie you posted that twice." π
by default this module does some little tricks to catch similar headers, like "AUTHOR" and "AUTHORS". if that's too much for you, set strict = 1 in weaver.ini and then only headers that are exactly identical count as duplicates. simple as that.
π DIAGNOSTIC MESSAGES π
if any similar (or identical, when strict is 1) section headers get found, all of their names get listed on STDERR. π’
generally you should take this list of modules and remove each one from your POD. then you should make sure the sections generated by Pod::Weaver are suitable substitutes for those sections. and in the case of similar names, only the first instance in each set of similar names will be listed. iykyk.
π ATTRIBUTES π
π§ strict
if it's set to true (1), section headers only count as duplicates if they match exactly. if it's false (which is the default), certain similar section headers get considered equivalent. here's what similarities are considered (and more may be added later, so stay tuned bestie):
- all whitespace and punctuation are equivalant β for example, the following would all be considered duplicates of each other:
" SEE ALSO","SEE ALSO","SEE,ALSO:". π - case-insensitive β for example,
"Name"and"NAME"would be considered duplicates. π€ - sets of words separated by
"AND"β for example,"COPYRIGHT AND LICENSE"would be considered a duplicate of"LICENSE AND COPYRIGHT". π - plurals β a plural noun is considered equivalent to its singular. for example,
"AUTHOR"and"AUTHORS"are the same section. but heads up: a section header consisting of multiple words, such as"DISCLAIMER OF WARRANTY", is not affected by this rule. π¨- this rule uses
Lingua::EN::Inflect::Numberto interconvert between singular and plural forms. hopefully you don't need to make a section called"OCTOPI". ππ
- this rule uses
note that these rules apply recursively, so"Authors; and Contributors"would be a duplicate of" CONTRIBUTORS AND AUTHOR". the recursion is recursive. we love to see it. π
π₯ METHODS π₯
π prepare_input
this method modifies the weaver object by moving EnsureUniqueSections to the end of the weaver's plugin list, so it gets to look at the final woven POD. it simply must be the last one to speak.
THIS IS PURE EVIL. π
this is a hack to ensure that this plugin gets "the last word". obviously if all plugins did this it would be total chaos. i welcome alternative suggestions. the main issue is that when other Finalizers, such as Section::Leftovers (which happens to be the most likely plugin to create duplicate sections), produce sections, this plugin will only see those sections if it runs after those Finalizers. hence the need to be the last plugin on the list. main character energy, honestly. β¨
π¦ finalize_document
this method checks the document for duplicate headers and throws an error if any are found. if no duplicates are found, it simply does nothing. it does not modify the POD in any way. truly a "if you have nothing to say, say nothing" icon. π
π BUGS AND LIMITATIONS π
π«Ά should also be available as a Dist::Zilla testing plugin
i would like to convert this to a Dist::Zilla testing plugin, so you can use it without enabling Pod::Weaver if you don't want to. but i haven't yet figured out how to find all files in a dist with POD and extract all their headers. if anyone knows, please tell me. π
π no recursive duplicate checks
this module only checks for duplicates in top-level headers (i.e. "head1"). it could be extended to check the "head2" elements within each "head1" section and so on, but generally Pod::Weaver is not called upon to generate subsections, so you are unlikely to end up with duplicates at any level other than the first. however, if there is demand for recursive duplicate detection, i will add it. pinky promise. π
please report any bugs or feature requests to rct+perlbug@thompsonclan.org. π¬
π SEE ALSO π
Pod::Weaverβ the module that this is a plugin for.Lingua::EN::Inflect::Numberβ used to determine the singular forms of plural nouns.
πΈ INSTALLATION πΈ
see perlmodinstall for information and options on installing Perl modules. it's giving "read the docs" but in the nicest way. π
π AUTHOR π
Ryan C. Thompson <rct@thompsonclan.org>
β COPYRIGHT AND LICENSE β
this software is copyright (c) 2010 by Ryan C. Thompson.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay. π«Ά
π¨ DISCLAIMER OF WARRANTY π¨
okay bestie this next part is the legal bit so we're keeping it word for word, no edits, no vibes, just facts. read it. it matters. π
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
and that's the whole page, bestie π
this fine piece of documentation was generated by perl v5.34.0 on 2022-06-16, so go forth and let no section header ever be duplicated again. mwah. πβ¨π
π¦ where this page comes from
- debian bookworm: libpod-weaver-plugin-ensureuniquesections-perl 0.163250-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libpod-weaver-plugin-ensureuniquesections-perl 0.163250-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libpod-weaver-plugin-ensureuniquesections-perl 0.163250-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libpod-weaver-plugin-ensureuniquesections-perl 0.163250-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libpod-weaver-plugin-ensureuniquesections-perl 0.163250-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms