.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" 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" '' '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 turned on, 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. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Pod::Checker 3perl" .TH Pod::Checker 3perl "2010-12-30" "perl v5.14.2" "Perl Programmers Reference Guide" .\" 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::Checker, podchecker() \- check pod documents for syntax errors .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Pod::Checker; \& \& $syntax_okay = podchecker($filepath, $outputpath, %options); \& \& my $checker = new Pod::Checker %options; \& $checker\->parse_from_file($filepath, \e*STDERR); .Ve .SH "OPTIONS/ARGUMENTS" .IX Header "OPTIONS/ARGUMENTS" \&\f(CW$filepath\fR is the input \s-1POD\s0 to read and \f(CW$outputpath\fR is where to write \s-1POD\s0 syntax error messages. Either argument may be a scalar indicating a file-path, or else a reference to an open filehandle. If unspecified, the input-file it defaults to \f(CW\*(C`\e*STDIN\*(C'\fR, and the output-file defaults to \f(CW\*(C`\e*STDERR\*(C'\fR. .SS "\fIpodchecker()\fP" .IX Subsection "podchecker()" This function can take a hash of options: .IP "\fB\-warnings\fR => \fIval\fR" 4 .IX Item "-warnings => val" Turn warnings on/off. \fIval\fR is usually 1 for on, but higher values trigger additional warnings. See \*(L"Warnings\*(R". .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBpodchecker\fR will perform syntax checking of Perl5 \s-1POD\s0 format documentation. .PP Curious/ambitious users are welcome to propose additional features they wish to see in \fBPod::Checker\fR and \fBpodchecker\fR and verify that the checks are consistent with perlpod. .PP The following checks are currently performed: .IP "\(bu" 4 Unknown '=xxxx' commands, unknown 'X<...>' interior-sequences, and unterminated interior sequences. .IP "\(bu" 4 Check for proper balancing of \f(CW\*(C`=begin\*(C'\fR and \f(CW\*(C`=end\*(C'\fR. The contents of such a block are generally ignored, i.e. no syntax checks are performed. .IP "\(bu" 4 Check for proper nesting and balancing of \f(CW\*(C`=over\*(C'\fR, \f(CW\*(C`=item\*(C'\fR and \f(CW\*(C`=back\*(C'\fR. .IP "\(bu" 4 Check for same nested interior-sequences (e.g. \&\f(CW\*(C`L<...L<...>...>\*(C'\fR). .IP "\(bu" 4 Check for malformed or non-existing entities \f(CW\*(C`E<...>\*(C'\fR. .IP "\(bu" 4 Check for correct syntax of hyperlinks \f(CW\*(C`L<...>\*(C'\fR. See perlpod for details. .IP "\(bu" 4 Check for unresolved document-internal links. This check may also reveal misspelled links that seem to be internal links but should be links to something else. .SH "DIAGNOSTICS" .IX Header "DIAGNOSTICS" .SS "Errors" .IX Subsection "Errors" .IP "\(bu" 4 empty =headn .Sp A heading (\f(CW\*(C`=head1\*(C'\fR or \f(CW\*(C`=head2\*(C'\fR) without any text? That ain't no heading! .IP "\(bu" 4 =over on line \fIN\fR without closing =back .Sp The \f(CW\*(C`=over\*(C'\fR command does not have a corresponding \f(CW\*(C`=back\*(C'\fR before the next heading (\f(CW\*(C`=head1\*(C'\fR or \f(CW\*(C`=head2\*(C'\fR) or the end of the file. .IP "\(bu" 4 =item without previous =over .IP "\(bu" 4 =back without previous =over .Sp An \f(CW\*(C`=item\*(C'\fR or \f(CW\*(C`=back\*(C'\fR command has been found outside a \&\f(CW\*(C`=over\*(C'\fR/\f(CW\*(C`=back\*(C'\fR block. .IP "\(bu" 4 No argument for =begin .Sp A \f(CW\*(C`=begin\*(C'\fR command was found that is not followed by the formatter specification. .IP "\(bu" 4 =end without =begin .Sp A standalone \f(CW\*(C`=end\*(C'\fR command was found. .IP "\(bu" 4 Nested =begin's .Sp There were at least two consecutive \f(CW\*(C`=begin\*(C'\fR commands without the corresponding \f(CW\*(C`=end\*(C'\fR. Only one \f(CW\*(C`=begin\*(C'\fR may be active at a time. .IP "\(bu" 4 =for without formatter specification .Sp There is no specification of the formatter after the \f(CW\*(C`=for\*(C'\fR command. .IP "\(bu" 4 unresolved internal link \fI\s-1NAME\s0\fR .Sp The given link to \fI\s-1NAME\s0\fR does not have a matching node in the current \&\s-1POD\s0. This also happened when a single word node name is not enclosed in \&\f(CW""\fR. .IP "\(bu" 4 Unknown command "\fI\s-1CMD\s0\fR" .Sp An invalid \s-1POD\s0 command has been found. Valid are \f(CW\*(C`=head1\*(C'\fR, \f(CW\*(C`=head2\*(C'\fR, \&\f(CW\*(C`=head3\*(C'\fR, \f(CW\*(C`=head4\*(C'\fR, \f(CW\*(C`=over\*(C'\fR, \f(CW\*(C`=item\*(C'\fR, \f(CW\*(C`=back\*(C'\fR, \f(CW\*(C`=begin\*(C'\fR, \f(CW\*(C`=end\*(C'\fR, \&\f(CW\*(C`=for\*(C'\fR, \f(CW\*(C`=pod\*(C'\fR, \f(CW\*(C`=cut\*(C'\fR .IP "\(bu" 4 Unknown interior-sequence "\fI\s-1SEQ\s0\fR" .Sp An invalid markup command has been encountered. Valid are: \&\f(CW\*(C`B<>\*(C'\fR, \f(CW\*(C`C<>\*(C'\fR, \f(CW\*(C`E<>\*(C'\fR, \f(CW\*(C`F<>\*(C'\fR, \&\f(CW\*(C`I<>\*(C'\fR, \f(CW\*(C`L<>\*(C'\fR, \f(CW\*(C`S<>\*(C'\fR, \f(CW\*(C`X<>\*(C'\fR, \&\f(CW\*(C`Z<>\*(C'\fR .IP "\(bu" 4 nested commands \fI\s-1CMD\s0\fR<...\fI\s-1CMD\s0\fR<...>...> .Sp Two nested identical markup commands have been found. Generally this does not make sense. .IP "\(bu" 4 garbled entity \fI\s-1STRING\s0\fR .Sp The \fI\s-1STRING\s0\fR found cannot be interpreted as a character entity. .IP "\(bu" 4 Entity number out of range .Sp An entity specified by number (dec, hex, oct) is out of range (1\-255). .IP "\(bu" 4 malformed link L<> .Sp The link found cannot be parsed because it does not conform to the syntax described in perlpod. .IP "\(bu" 4 nonempty Z<> .Sp The \f(CW\*(C`Z<>\*(C'\fR sequence is supposed to be empty. .IP "\(bu" 4 empty X<> .Sp The index entry specified contains nothing but whitespace. .IP "\(bu" 4 Spurious text after =pod / =cut .Sp The commands \f(CW\*(C`=pod\*(C'\fR and \f(CW\*(C`=cut\*(C'\fR do not take any arguments. .IP "\(bu" 4 Spurious character(s) after =back .Sp The \f(CW\*(C`=back\*(C'\fR command does not take any arguments. .SS "Warnings" .IX Subsection "Warnings" These may not necessarily cause trouble, but indicate mediocre style. .IP "\(bu" 4 multiple occurrence of link target \fIname\fR .Sp The \s-1POD\s0 file has some \f(CW\*(C`=item\*(C'\fR and/or \f(CW\*(C`=head\*(C'\fR commands that have the same text. Potential hyperlinks to such a text cannot be unique then. This warning is printed only with warning level greater than one. .IP "\(bu" 4 line containing nothing but whitespace in paragraph .Sp There is some whitespace on a seemingly empty line. \s-1POD\s0 is very sensitive to such things, so this is flagged. \fBvi\fR users switch on the \fBlist\fR option to avoid this problem. .IP "\(bu" 4 previous =item has no contents .Sp There is a list \f(CW\*(C`=item\*(C'\fR right above the flagged line that has no text contents. You probably want to delete empty items. .IP "\(bu" 4 preceding non-item paragraph(s) .Sp A list introduced by \f(CW\*(C`=over\*(C'\fR starts with a text or verbatim paragraph, but continues with \f(CW\*(C`=item\*(C'\fRs. Move the non-item paragraph out of the \&\f(CW\*(C`=over\*(C'\fR/\f(CW\*(C`=back\*(C'\fR block. .IP "\(bu" 4 =item type mismatch (\fIone\fR vs. \fItwo\fR) .Sp A list started with e.g. a bullet-like \f(CW\*(C`=item\*(C'\fR and continued with a numbered one. This is obviously inconsistent. For most translators the type of the \fIfirst\fR \f(CW\*(C`=item\*(C'\fR determines the type of the list. .IP "\(bu" 4 \&\fIN\fR unescaped \f(CW\*(C`<>\*(C'\fR in paragraph .Sp Angle brackets not written as \f(CW\*(C`\*(C'\fR and \f(CW\*(C`\*(C'\fR can potentially cause errors as they could be misinterpreted as markup commands. This is only printed when the \-warnings level is greater than 1. .IP "\(bu" 4 Unknown entity .Sp A character entity was found that does not belong to the standard \&\s-1ISO\s0 set or the \s-1POD\s0 specials \f(CW\*(C`verbar\*(C'\fR and \f(CW\*(C`sol\*(C'\fR. .IP "\(bu" 4 No items in =over .Sp The list opened with \f(CW\*(C`=over\*(C'\fR does not contain any items. .IP "\(bu" 4 No argument for =item .Sp \&\f(CW\*(C`=item\*(C'\fR without any parameters is deprecated. It should either be followed by \f(CW\*(C`*\*(C'\fR to indicate an unordered list, by a number (optionally followed by a dot) to indicate an ordered (numbered) list or simple text for a definition list. .IP "\(bu" 4 empty section in previous paragraph .Sp The previous section (introduced by a \f(CW\*(C`=head\*(C'\fR command) does not contain any text. This usually indicates that something is missing. Note: A \&\f(CW\*(C`=head1\*(C'\fR followed immediately by \f(CW\*(C`=head2\*(C'\fR does not trigger this warning. .IP "\(bu" 4 Verbatim paragraph in \s-1NAME\s0 section .Sp The \s-1NAME\s0 section (\f(CW\*(C`=head1 NAME\*(C'\fR) should consist of a single paragraph with the script/module name, followed by a dash `\-' and a very short description of what the thing is good for. .IP "\(bu" 4 =head\fIn\fR without preceding higher level .Sp For example if there is a \f(CW\*(C`=head2\*(C'\fR in the \s-1POD\s0 file prior to a \&\f(CW\*(C`=head1\*(C'\fR. .SS "Hyperlinks" .IX Subsection "Hyperlinks" There are some warnings with respect to malformed hyperlinks: .IP "\(bu" 4 ignoring leading/trailing whitespace in link .Sp There is whitespace at the beginning or the end of the contents of L<...>. .IP "\(bu" 4 (section) in '$page' deprecated .Sp There is a section detected in the page name of L<...>, e.g. \&\f(CW\*(C`L\*(C'\fR. \s-1POD\s0 hyperlinks may point to \s-1POD\s0 documents only. Please write \f(CW\*(C`C\*(C'\fR instead. Some formatters are able to expand this to appropriate code. For links to (builtin) functions, please say \f(CW\*(C`L\*(C'\fR, without (). .IP "\(bu" 4 alternative text/node '%s' contains non-escaped | or / .Sp The characters \f(CW\*(C`|\*(C'\fR and \f(CW\*(C`/\*(C'\fR are special in the L<...> context. Although the hyperlink parser does its best to determine which \*(L"/\*(R" is text and which is a delimiter in case of doubt, one ought to escape these literal characters like this: .Sp .Vb 2 \& / E \& | E .Ve .SH "RETURN VALUE" .IX Header "RETURN VALUE" \&\fBpodchecker\fR returns the number of \s-1POD\s0 syntax errors found or \-1 if there were no \s-1POD\s0 commands at all found in the file. .SH "EXAMPLES" .IX Header "EXAMPLES" See \*(L"\s-1SYNOPSIS\s0\*(R" .SH "INTERFACE" .IX Header "INTERFACE" While checking, this module collects document properties, e.g. the nodes for hyperlinks (\f(CW\*(C`=headX\*(C'\fR, \f(CW\*(C`=item\*(C'\fR) and index entries (\f(CW\*(C`X<>\*(C'\fR). \&\s-1POD\s0 translators can use this feature to syntax-check and get the nodes in a first pass before actually starting to convert. This is expensive in terms of execution time, but allows for very robust conversions. .PP Since PodParser\-1.24 the \fBPod::Checker\fR module uses only the \fBpoderror\fR method to print errors and warnings. The summary output (e.g. \&\*(L"Pod syntax \s-1OK\s0\*(R") has been dropped from the module and has been included in \&\fBpodchecker\fR (the script). This allows users of \fBPod::Checker\fR to control completely the output behavior. Users of \fBpodchecker\fR (the script) get the well-known behavior. .ie n .IP """Pod::Checker\->new( %options )""" 4 .el .IP "\f(CWPod::Checker\->new( %options )\fR" 4 .IX Item "Pod::Checker->new( %options )" Return a reference to a new Pod::Checker object that inherits from Pod::Parser and is used for calling the required methods later. The following options are recognized: .Sp \&\f(CW\*(C`\-warnings => num\*(C'\fR Print warnings if \f(CW\*(C`num\*(C'\fR is true. The higher the value of \f(CW\*(C`num\*(C'\fR, the more warnings are printed. Currently there are only levels 1 and 2. .Sp \&\f(CW\*(C`\-quiet => num\*(C'\fR If \f(CW\*(C`num\*(C'\fR is true, do not print any errors/warnings. This is useful when Pod::Checker is used to munge \s-1POD\s0 code into plain text from within \&\s-1POD\s0 formatters. .ie n .IP """$checker\->poderror( @args )""" 4 .el .IP "\f(CW$checker\->poderror( @args )\fR" 4 .IX Item "$checker->poderror( @args )" .PD 0 .ie n .IP """$checker\->poderror( {%opts}, @args )""" 4 .el .IP "\f(CW$checker\->poderror( {%opts}, @args )\fR" 4 .IX Item "$checker->poderror( {%opts}, @args )" .PD Internal method for printing errors and warnings. If no options are given, simply prints \*(L"@_\*(R". The following options are recognized and used to form the output: .Sp .Vb 1 \& \-msg .Ve .Sp A message to print prior to \f(CW@args\fR. .Sp .Vb 1 \& \-line .Ve .Sp The line number the error occurred in. .Sp .Vb 1 \& \-file .Ve .Sp The file (name) the error occurred in. .Sp .Vb 1 \& \-severity .Ve .Sp The error level, should be '\s-1WARNING\s0' or '\s-1ERROR\s0'. .ie n .IP """$checker\->num_errors()""" 4 .el .IP "\f(CW$checker\->num_errors()\fR" 4 .IX Item "$checker->num_errors()" Set (if argument specified) and retrieve the number of errors found. .ie n .IP """$checker\->num_warnings()""" 4 .el .IP "\f(CW$checker\->num_warnings()\fR" 4 .IX Item "$checker->num_warnings()" Set (if argument specified) and retrieve the number of warnings found. .ie n .IP """$checker\->name()""" 4 .el .IP "\f(CW$checker\->name()\fR" 4 .IX Item "$checker->name()" Set (if argument specified) and retrieve the canonical name of \s-1POD\s0 as found in the \f(CW\*(C`=head1 NAME\*(C'\fR section. .ie n .IP """$checker\->node()""" 4 .el .IP "\f(CW$checker\->node()\fR" 4 .IX Item "$checker->node()" Add (if argument specified) and retrieve the nodes (as defined by \f(CW\*(C`=headX\*(C'\fR and \f(CW\*(C`=item\*(C'\fR) of the current \s-1POD\s0. The nodes are returned in the order of their occurrence. They consist of plain text, each piece of whitespace is collapsed to a single blank. .ie n .IP """$checker\->idx()""" 4 .el .IP "\f(CW$checker\->idx()\fR" 4 .IX Item "$checker->idx()" Add (if argument specified) and retrieve the index entries (as defined by \&\f(CW\*(C`X<>\*(C'\fR) of the current \s-1POD\s0. They consist of plain text, each piece of whitespace is collapsed to a single blank. .ie n .IP """$checker\->hyperlink()""" 4 .el .IP "\f(CW$checker\->hyperlink()\fR" 4 .IX Item "$checker->hyperlink()" Add (if argument specified) and retrieve the hyperlinks (as defined by \&\f(CW\*(C`L<>\*(C'\fR) of the current \s-1POD\s0. They consist of a 2\-item array: line number and \f(CW\*(C`Pod::Hyperlink\*(C'\fR object. .SH "AUTHOR" .IX Header "AUTHOR" Please report bugs using . .PP Brad Appleton (initial version), Marek Rouchal .PP Based on code for \fB\f(BIPod::Text::pod2text()\fB\fR written by Tom Christiansen