Debian Codegraph @

README

raw
1 NAME
2 Pod::Spell - a formatter for spellchecking Pod
3
4 VERSION
5 version 1.27
6
7 SYNOPSIS
8 use Pod::Spell;
9 Pod::Spell->new->parse_from_file( 'File.pm' );
10
11 Pod::Spell->new->parse_from_filehandle( $infile, $outfile );
12
13 Also look at podspell
14
15 % perl -MPod::Spell -e "Pod::Spell->new->parse_from_file(shift)" Thing.pm |spell |fmt
16
17 ...or instead of piping to spell or "ispell", use ">temp.txt", and open
18 temp.txt in your word processor for spell-checking.
19
20 DESCRIPTION
21 Pod::Spell is a Pod formatter whose output is good for spellchecking.
22 Pod::Spell is rather like Pod::Text, except that it doesn't put much
23 effort into actual formatting, and it suppresses things that look like
24 Perl symbols or Perl jargon (so that your spellchecking program won't
25 complain about mystery words like "$thing" or ""Foo::Bar"" or
26 "hashref").
27
28 This class works by filtering out words that look like Perl or any form
29 of computerese (like "$thing" or ""N>7"" or ""@{$foo}{'bar','baz'}"",
30 anything in C<...> or F<...> codes, anything in verbatim paragraphs
31 (code blocks), and anything in the stopword list. The default stopword
32 list for a document starts out from the stopword list defined by
33 Pod::Wordlist, and can be supplemented (on a per-document basis) by
34 having "=for stopwords" / "=for :stopwords" region(s) in a document.
35
36 METHODS
37 new
38 Pod::Spell->new(%options)
39
40 Creates a new Pod::Spell instance. Accepts several options:
41
42 debug
43 When set to a true value, will output debugging messages about how
44 the Pod is being processed.
45
46 Defaults to false.
47
48 stopwords
49 Can be specified to use an alternate wordlist instance.
50
51 Defaults to a new Pod::Wordlist instance.
52
53 no_wide_chars
54 Will be passed to Pod::Wordlist when creating a new instance. Causes
55 all words with characters outside the Latin-1 range to be stripped
56 from the output.
57
58 stopwords
59 $self->stopwords->isa('Pod::WordList'); # true
60
61 parse_from_filehandle($in_fh,$out_fh)
62 This method takes an input filehandle (which is assumed to already be
63 opened for reading) and reads the entire input stream looking for blocks
64 (paragraphs) of POD documentation to be processed. If no first argument
65 is given the default input filehandle "STDIN" is used.
66
67 The $in_fh parameter may be any object that provides a getline() method
68 to retrieve a single line of input text (hence, an appropriate wrapper
69 object could be used to parse PODs from a single string or an array of
70 strings).
71
72 parse_from_file($filename,$outfile)
73 This method takes a filename and does the following:
74
75 * opens the input and output files for reading (creating the appropriate
76 filehandles)
77
78 * invokes the parse_from_filehandle() method passing it the
79 corresponding input and output filehandles.
80
81 * closes the input and output files.
82
83 If the special input filename "", "-" or "<&STDIN" is given then the
84 STDIN filehandle is used for input (and no open or close is performed).
85 If no input filename is specified then "-" is implied. Filehandle
86 references, or objects that support the regular IO operations (like
87 "<$fh>" or "$fh-<Egt"getline>) are also accepted; the handles must
88 already be opened.
89
90 If a second argument is given then it should be the name of the desired
91 output file. If the special output filename "-" or ">&STDOUT" is given
92 then the STDOUT filehandle is used for output (and no open or close is
93 performed). If the special output filename ">&STDERR" is given then the
94 STDERR filehandle is used for output (and no open or close is
95 performed). If no output filehandle is currently in use and no output
96 filename is specified, then "-" is implied. Alternatively, filehandle
97 references or objects that support the regular IO operations (like
98 "print", e.g. IO::String) are also accepted; the object must already be
99 opened.
100
101 ENCODINGS
102 If your Pod is encoded in something other than Latin-1, it should
103 declare an encoding using the ""=encoding *encodingname*"" in perlpod
104 directive.
105
106 ADDING STOPWORDS
107 You can add stopwords on a per-document basis with "=for stopwords" /
108 "=for :stopwords" regions, like so:
109
110 =for stopwords plok Pringe zorch snik !qux
111 foo bar baz quux quuux
112
113 This adds every word in that paragraph after "stopwords" to the stopword
114 list, effective for the rest of the document. In such a list, words are
115 whitespace-separated. (The amount of whitespace doesn't matter, as long
116 as there's no blank lines in the middle of the paragraph.) Plural forms
117 are added automatically using Lingua::EN::Inflect. Words beginning with
118 "!" are *deleted* from the stopword list -- so "!qux" deletes "qux" from
119 the stopword list, if it was in there in the first place. Note that if a
120 stopword is all-lowercase, then it means that it's okay in *any* case;
121 but if the word has any capital letters, then it means that it's okay
122 *only* with *that* case. So a Wordlist entry of "perl" would permit
123 "perl", "Perl", and (less interestingly) "PERL", "pERL", "PerL", et
124 cetera. However, a Wordlist entry of "Perl" catches only "Perl", not
125 "perl". So if you wanted to make sure you said only "Perl", never
126 "perl", you could add this to the top of your document:
127
128 =for stopwords !perl Perl
129
130 Then all instances of the word "Perl" would be weeded out of the
131 Pod::Spell-formatted version of your document, but any instances of the
132 word "perl" would be left in (unless they were in a C<...> or F<...>
133 style).
134
135 You can have several "=for stopwords" regions in your document. You can
136 even express them like so:
137
138 =begin stopwords
139
140 plok Pringe zorch
141
142 snik !qux
143
144 foo bar
145 baz quux quuux
146
147 =end stopwords
148
149 If you want to use E<...> sequences in a "stopwords" region, you have to
150 use ":stopwords", as here:
151
152 =for :stopwords
153 virtE<ugrave>
154
155 ...meaning that you're adding a stopword of "virtù". If you left the ":"
156 out, that would mean you were adding a stopword of "virtE<ugrave>" (with
157 a literal E, a literal <, etc), which will have no effect, since any
158 occurrences of virtE<ugrave> don't look like a normal human-language
159 word anyway, and so would be screened out before the stopword list is
160 consulted anyway.
161
162 CAVEATS
163 finding stopwords defined with "=for"
164 Pod::Spell makes a single pass over the POD. Stopwords must be added
165 before they show up in the POD.
166
167 HINT
168 If you feed output of Pod::Spell into your word processor and run a
169 spell-check, make sure you're *not* also running a grammar-check --
170 because Pod::Spell drops words that it thinks are Perl symbols, jargon,
171 or stopwords, this means you'll have ungrammatical sentences, what with
172 words being missing and all. And you don't need a grammar checker to
173 tell you that.
174
175 SEE ALSO
176 * Pod::Wordlist
177
178 * Pod::Simple
179
180 * podchecker also known as Pod::Checker
181
182 * perlpod, perlpodspec
183
184 BUGS
185 Please report any bugs or feature requests on the bugtracker website
186 <https://rt.cpan.org/Public/Dist/Display.html?Name=Pod-Spell> or by
187 email to [email protected] <mailto:[email protected]>.
188
189 When submitting a bug or request, please include a test-file or a patch
190 to an existing test-file that illustrates the bug or desired feature.
191
192 AUTHORS
193 * Sean M. Burke <[email protected]>
194
195 * Caleb Cushing <[email protected]>
196
197 CONTRIBUTORS
198 * David Golden <[email protected]>
199
200 * Graham Knop <[email protected]>
201
202 * Kent Fredric <[email protected]>
203
204 * Mohammad S Anwar <[email protected]>
205
206 * Olivier Mengué <[email protected]>
207
208 * Paulo Custodio <[email protected]>
209
210 COPYRIGHT AND LICENSE
211 This software is Copyright (c) 2024 by Olivier Mengué.
212
213 This is free software, licensed under:
214
215 The Artistic License 2.0 (GPL Compatible)
216