.\" Automatically generated by Pod::Man 2.1801 (Pod::Simple 3.05) .\" .\" 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::Index 3pm" .TH Pod::Index 3pm "2005-10-16" "perl v5.10.0" "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::Index \- Index and search PODs using X<> entries. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& ### to create an index: \& use Pod::Index::Builder; \& \& my $p = Pod::Index::Builder\->new; \& for my $file (@ARGV) { \& $p\->parse_from_file($file); \& } \& \& $p\->print_index("index.txt"); \& \& \& ### to search for a keyword in the index: \& use Pod::Index::Search; \& \& my $q = Pod::Index::Search\->new( \& filename => \*(Aqindex.txt\*(Aq, \& ); \& \& my @results = $q\->search(\*(Aqgetprotobyname\*(Aq); \& \& for my $r (@results) { \& printf "%s\et%s\en", $r\->podname, $r\->line; \& print $r\->pod; \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The Pod-Index distribution includes various modules for indexing and searching \s-1POD\s0 that is appropriately marked with X<> \s-1POD\s0 codes. .PP \&\f(CW\*(C`Pod::Index\*(C'\fR, as a module, does nothing. Everything is done by Pod::Index::Builder, Pod::Index::Search, and other helper modules. .PP This document discusses some of the general issues with \s-1POD\s0 indexing; specifically, the recommended conventions for the use of X<> codes. .SH "BACKGROUND" .IX Header "BACKGROUND" The little-known (or at least little-used) X<> formatting code is described in perlpod: .PP .Vb 4 \& "X" \-\- an index entry \& This is ignored by most formatters, but some may use it for build\- \& ing indexes. It always renders as empty\-string. Example: "X" .Ve .SH "CONVENTIONS FOR THE USE OF X<> CODES" .IX Header "CONVENTIONS FOR THE USE OF X<> CODES" .SS "Placement of the X<> entries" .IX Subsection "Placement of the X<> entries" First, a definition. By \*(L"scope\*(R", I mean the part of the document that is deemed relevant to an index entry, and that may be extracted and shown in isolation by a processing or display tool. For example, perldoc \-f considers the scope of a function to end at the beginning of the next =item, or at the end of the enclosing =over. .PP The X<> entries should be added at the end of a command or textblock paragraph (verbatim paragraphs are excluded). The scope of the index entry starts at the beginning of the paragraph to which it was attached; the end of the scope depends on the command type: .PP 1) if the X<> is at the end of a textblock, the scope is that paragraph and zero or more verbatim paragraphs immediately following it. .PP 2) if the X<> is at the end of a command paragraph, it depends on the type of command: .IP "=head1, head2, etc." 4 .IX Item "=head1, head2, etc." The scope ends right before the next heading with equal or higher level. That is, a =head1 ends at the next =head1, and a =head2 ends at the next =head2 or =head1. .IP "=item" 4 .IX Item "=item" The scope ends right before the next =item, or the =back that terminates the containing list. Note: \*(L"empty\*(R" items are not counted for terminating scopes, to allow for cases where multiple =items head a block of text. For example, .Sp .Vb 3 \& =item function \& X \& X \& \& =item otherfunction \& \& C and C do the same thing, \& even if they have different names... \& \& =item lemonade .Ve .Sp Here the scope of the X and X entries starts with \*(L"=item function\*(R", and ends right before \*(L"=item lemonade\*(R". .PP 3) other command paragraphs, such as =back, =over, =begin, =end, and =for should not be used for attaching X<> entries. .SS "Content of the X<> entry." .IX Subsection "Content of the X<> entry." .IP "\(bu" 4 It should contain plain text without further formatting codes (with the possible exception of E<>). .IP "\(bu" 4 It should be in lowercase, unless caps are required due to case-sensitivity or correctness. .IP "\(bu" 4 Non-word characters are allowed, so one can list things like operators and special variables. .IP "\(bu" 4 Use of synonyms is encouraged, to make things easier to find. .IP "\(bu" 4 To be consistent, words should be normalized to the singular whenever possible. For example, use X instead of X. .IP "\(bu" 4 The use of a comma in an index entry has a special meaning: it separates levels of hierarchy (or namespaces), as a way of classifying entries in more specific ways. For example, \*(L"X\*(R", or \&\*(L"X\*(R". This information may be used by processing programs to arrange the entries, or for listing results when a user searches for a namespace that contains several entries. .IP "\(bu" 4 There's no limitation as to the number of times that a given entry can appear in a document or collection of documents. That is, it is not an error to have X appear twice in the same file. .SH "VERSION" .IX Header "VERSION" 0.14 .SH "SEE ALSO" .IX Header "SEE ALSO" Pod::Index::Builder, Pod::Index::Search, Pod::Index::Entry, perlpod .SH "AUTHOR" .IX Header "AUTHOR" Ivan Tubert-Brohman .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 2005 Ivan Tubert-Brohman. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.