.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Pod::Weaver::Plugin::EnsureUniqueSections 3pm" .TH Pod::Weaver::Plugin::EnsureUniqueSections 3pm "2017-01-31" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Pod::Weaver::Plugin::EnsureUniqueSections \- Ensure that POD has no duplicate section headers. .SH "VERSION" .IX Header "VERSION" version 0.163250 .SH "SYNOPSIS" .IX Header "SYNOPSIS" In \fIweaver.ini\fR .PP .Vb 2 \& [\-EnsureUniqueSections] \& strict = 0 ; The default .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This plugin simply ensures that the \s-1POD\s0 after weaving has no duplicate top-level section headers. This can help you if you are converting from writing all your own \s-1POD\s0 to generating it with Pod::Weaver. If you begin generating a section with Pod::Weaver but you forget to delete the manually written section of the same name, this plugin will warn you. .PP By default, this module does some tricks to detect similar headers, such as \f(CW\*(C`AUTHOR\*(C'\fR and \f(CW\*(C`AUTHORS\*(C'\fR. You can turn this off by setting \&\f(CW\*(C`strict = 1\*(C'\fR in \fIweaver.ini\fR, in which case only \fIexactly identical\fR headers will be considered duplicates of each other. .SS "\s-1DIAGNOSTIC MESSAGES\s0" .IX Subsection "DIAGNOSTIC MESSAGES" If any similar (or identical if \f(CW\*(C`strict\*(C'\fR is 1) section headers are found, all of their names will be listed on \s-1STDERR.\s0 Generally, you should take this list of modules and remove each from your \s-1POD.\s0 Then you should ensure that the sections generated by Pod::Weaver are suitable substitutes for those sections. In the case of similar names, only the first instance in each set of similar names will be listed. .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" .SS "strict" .IX Subsection "strict" If set to true (1), section headers will only be considered duplicates if they match exactly. If false (the default), certain similar section headers will be considered equivalent. The following similarities are considered (more may be added later): .IP "All whitespace and punctuation are equivalant" 4 .IX Item "All whitespace and punctuation are equivalant" For example, the following would all be considered duplicates of each other: \f(CW\*(C` SEE ALSO\*(C'\fR, \f(CW\*(C`SEE ALSO\*(C'\fR, \f(CW\*(C`SEE,ALSO:\*(C'\fR. .IP "Case-insensitive" 4 .IX Item "Case-insensitive" For example, \f(CW\*(C`Name\*(C'\fR and \f(CW\*(C`NAME\*(C'\fR would be considered duplicates. .ie n .IP "Sets of words separated by ""\s-1AND"".\s0" 4 .el .IP "Sets of words separated by ``\s-1AND''.\s0" 4 .IX Item "Sets of words separated by AND." For example, \*(L"\s-1COPYRIGHT AND LICENSE\*(R"\s0 would be considered a duplicate of \*(L"\s-1LICENSE AND COPYRIGHT\*(R".\s0 .IP "Plurals" 4 .IX Item "Plurals" A plural noun is considered equivalent to its singular. For example, \&\*(L"\s-1AUTHOR\*(R"\s0 and \*(L"\s-1AUTHORS\*(R"\s0 are the same section. A section header consisting of multiple words, such as \*(L"\s-1DISCLAIMER OF WARRANTY\*(R",\s0 is not affected by this rule. .Sp This rule uses Lingua::EN::Inflect::Number to interconvert between singular and plural forms. Hopefully you don't need to make a section called \f(CW\*(C`OCTOPI\*(C'\fR. .PP Note that these rules apply recursively, so \f(CW\*(C`Authors; and Contributors\*(C'\fR would be a duplicate of \f(CW\*(C` CONTRIBUTORS AND AUTHOR\*(C'\fR. .SH "METHODS" .IX Header "METHODS" .SS "prepare_input" .IX Subsection "prepare_input" This method modifies the weaver object by moving EnsureUniqueSections to the end of the weaver's plugin list to ensure that it gets to look at the final woven \s-1POD.\s0 .PP \&\s-1THIS IS PURE EVIL.\s0 This is a hack to ensure that this plugin gets \*(L"the last word\*(R". Obviously if all plugins used 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. .SS "finalize_document" .IX Subsection "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 \s-1POD\s0 in any way. .SH "BUGS AND LIMITATIONS" .IX Header "BUGS AND LIMITATIONS" .SS "Should also be available as a Dist::Zilla testing plugin" .IX Subsection "Should also be available as a Dist::Zilla testing plugin" I would like to convert this to a Dist::Zilla testing plugin, so that 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 \s-1POD\s0 and extract all their headers. If anyone knows, please tell me. .SS "No recursive duplicate checks" .IX Subsection "No recursive duplicate checks" This module only checks for duplicates in top-level headers (i.e. \&\f(CW\*(C`head1\*(C'\fR). It could be extended to check the \f(CW\*(C`head2\*(C'\fR elements within each \f(CW\*(C`head1\*(C'\fR 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. .PP Please report any bugs or feature requests to \&\f(CW\*(C`rct+perlbug@thompsonclan.org\*(C'\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP "\(bu" 4 Pod::Weaver \- The module that this is a plugin for. .IP "\(bu" 4 Lingua::EN::Inflect::Number \- Used to determine the singular forms of plural nouns. .SH "INSTALLATION" .IX Header "INSTALLATION" See perlmodinstall for information and options on installing Perl modules. .SH "AUTHOR" .IX Header "AUTHOR" Ryan C. Thompson .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2010 by Ryan C. Thompson. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. .SH "DISCLAIMER OF WARRANTY" .IX Header "DISCLAIMER OF WARRANTY" \&\s-1BECAUSE 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 \*(L"AS IS\*(R" 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.\s0 .PP \&\s-1IN 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 \s0(\s-1INCLUDING 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\s0), \s-1EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\s0