.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" 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 .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Pod::Tree 3pm" .TH Pod::Tree 3pm "2019-02-25" "perl v5.28.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::Tree \- Create a static syntax tree for a POD .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Pod::Tree; \& \& $tree = Pod::Tree\->new; \& $tree\->load_file ( $file, %options) \& $tree\->load_fh ( $fh , %options); \& $tree\->load_string ( $pod , %options); \& $tree\->load_paragraphs(\e@pod , %options); \& \& $loaded = $tree\->loaded; \& \& $node = $tree\->get_root; \& $tree\->set_root ($node); \& $node = $tree\->pop; \& $tree\->push(@nodes); \& \& $tree\->walk(\e&sub); \& $tree\->has_pod and ... \& print $tree\->dump; .Ve .SH "EXPORTS" .IX Header "EXPORTS" Nothing .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`Pod::Tree\*(C'\fR parses a \s-1POD\s0 into a static syntax tree. Applications walk the tree to recover the structure and content of the \s-1POD.\s0 See \f(CW\*(C`Pod::Tree::Node\*(C'\fR for a description of the tree. .SH "METHODS" .IX Header "METHODS" .ie n .IP "\fI\f(CI$tree\fI\fR = ""Pod::Tree""\->""new""" 4 .el .IP "\fI\f(CI$tree\fI\fR = \f(CWPod::Tree\fR\->\f(CWnew\fR" 4 .IX Item "$tree = Pod::Tree->new" Creates a new \f(CW\*(C`Pod::Tree\*(C'\fR object. The syntax tree is initially empty. .ie n .IP "\fI\f(CI$ok\fI\fR = \fI\f(CI$tree\fI\fR\->""load_file""(\fI\f(CI$file\fI\fR, \fI\f(CI%options\fI\fR)" 4 .el .IP "\fI\f(CI$ok\fI\fR = \fI\f(CI$tree\fI\fR\->\f(CWload_file\fR(\fI\f(CI$file\fI\fR, \fI\f(CI%options\fI\fR)" 4 .IX Item "$ok = $tree->load_file($file, %options)" Parses a \s-1POD\s0 and creates a syntax tree for it. \&\fI\f(CI$file\fI\fR is the name of a file containing the \s-1POD.\s0 Returns null iff it can't open \fI\f(CI$file\fI\fR. .Sp See \*(L"\s-1OPTIONS\*(R"\s0 for a description of \fI\f(CI%options\fI\fR .ie n .IP "\fI\f(CI$tree\fI\fR\->""load_fh""(\fI\f(CI$fh\fI\fR, \fI\f(CI%options\fI\fR)" 4 .el .IP "\fI\f(CI$tree\fI\fR\->\f(CWload_fh\fR(\fI\f(CI$fh\fI\fR, \fI\f(CI%options\fI\fR)" 4 .IX Item "$tree->load_fh($fh, %options)" Parses a \s-1POD\s0 and creates a syntax tree for it. \&\fI\f(CI$fh\fI\fR is an \f(CW\*(C`IO::File\*(C'\fR object that is open on a file containing the \s-1POD.\s0 .Sp See \*(L"\s-1OPTIONS\*(R"\s0 for a description of \fI\f(CI%options\fI\fR .ie n .IP "\fI\f(CI$tree\fI\fR\->""load_string""(\fI\f(CI$pod\fI\fR, \fI\f(CI%options\fI\fR)" 4 .el .IP "\fI\f(CI$tree\fI\fR\->\f(CWload_string\fR(\fI\f(CI$pod\fI\fR, \fI\f(CI%options\fI\fR)" 4 .IX Item "$tree->load_string($pod, %options)" Parses a \s-1POD\s0 and creates a syntax tree for it. \&\fI\f(CI$pod\fI\fR is a single string containing the \s-1POD.\s0 .Sp See \*(L"\s-1OPTIONS\*(R"\s0 for a description of \fI\f(CI%options\fI\fR .ie n .IP "\fI\f(CI$tree\fI\fR\->""load_paragraphs""(\e\fI\f(CI@pod\fI\fR, \fI\f(CI%options\fI\fR)" 4 .el .IP "\fI\f(CI$tree\fI\fR\->\f(CWload_paragraphs\fR(\e\fI\f(CI@pod\fI\fR, \fI\f(CI%options\fI\fR)" 4 .IX Item "$tree->load_paragraphs(@pod, %options)" Parses a \s-1POD\s0 and creates a syntax tree for it. \&\fI\e@pod\fR is a reference to an array of strings. Each string is one paragraph of the \s-1POD.\s0 .Sp See \*(L"\s-1OPTIONS\*(R"\s0 for a description of \fI\f(CI%options\fI\fR .ie n .IP "\fI\f(CI$loaded\fI\fR = \fI\f(CI$tree\fI\fR\->""loaded""" 4 .el .IP "\fI\f(CI$loaded\fI\fR = \fI\f(CI$tree\fI\fR\->\f(CWloaded\fR" 4 .IX Item "$loaded = $tree->loaded" Returns true iff one of the \f(CW\*(C`load_\*(C'\fR* methods has been called on \fI\f(CI$tree\fI\fR. .ie n .IP "\fI\f(CI$node\fI\fR = \fI\f(CI$tree\fI\fR\->""get_root""" 4 .el .IP "\fI\f(CI$node\fI\fR = \fI\f(CI$tree\fI\fR\->\f(CWget_root\fR" 4 .IX Item "$node = $tree->get_root" Returns the root node of the syntax tree. See Pod::Tree::Node for a description of the syntax tree. .ie n .IP "\fI\f(CI$tree\fI\fR\->""set_root""(\fI\f(CI$node\fI\fR)" 4 .el .IP "\fI\f(CI$tree\fI\fR\->\f(CWset_root\fR(\fI\f(CI$node\fI\fR)" 4 .IX Item "$tree->set_root($node)" Sets the root of the syntax tree to \fI\f(CI$node\fI\fR. .ie n .IP "\fI\f(CI$tree\fI\fR\->""push""(\fI\f(CI@nodes\fI\fR)" 4 .el .IP "\fI\f(CI$tree\fI\fR\->\f(CWpush\fR(\fI\f(CI@nodes\fI\fR)" 4 .IX Item "$tree->push(@nodes)" Pushes \fI\f(CI@nodes\fI\fR onto the end of the top-level list of nodes in \fI\f(CI$tree\fI\fR. .ie n .IP "\fI\f(CI$node\fI\fR = \fI\f(CI$tree\fI\fR\->""pop""" 4 .el .IP "\fI\f(CI$node\fI\fR = \fI\f(CI$tree\fI\fR\->\f(CWpop\fR" 4 .IX Item "$node = $tree->pop" Pops \fI\f(CI$node\fI\fR off of the end of the top-level list of nodes in \fI\f(CI$tree\fI\fR. .ie n .IP "\fI\f(CI$tree\fI\fR\->""walk""(\fI\e&sub\fR)" 4 .el .IP "\fI\f(CI$tree\fI\fR\->\f(CWwalk\fR(\fI\e&sub\fR)" 4 .IX Item "$tree->walk(&sub)" Walks the syntax tree, depth first. Calls \fIsub\fR once for each node in the tree. The current node is passed as the first argument to \fIsub\fR. .Sp \&\f(CW\*(C`walk\*(C'\fR descends to the children and siblings of \fI\f(CI$node\fI\fR iff \&\fI\f(BIsub()\fI\fR returns true. .ie n .IP "\fI\f(CI$tree\fI\fR\->""has_pod""" 4 .el .IP "\fI\f(CI$tree\fI\fR\->\f(CWhas_pod\fR" 4 .IX Item "$tree->has_pod" Returns true iff \fI\f(CI$tree\fI\fR contains \s-1POD\s0 paragraphs. .ie n .IP "\fI\f(CI$tree\fI\fR\->""dump""" 4 .el .IP "\fI\f(CI$tree\fI\fR\->\f(CWdump\fR" 4 .IX Item "$tree->dump" Pretty prints the syntax tree. This will show you how \f(CW\*(C`Pod::Tree\*(C'\fR interpreted your \s-1POD.\s0 .SH "OPTIONS" .IX Header "OPTIONS" These options may be passed in the \fI\f(CI%options\fI\fR hash to the \f(CW\*(C`load_\*(C'\fR* methods. .ie n .IP """in_pod => 0""" 4 .el .IP "\f(CWin_pod => 0\fR" 4 .IX Item "in_pod => 0" .PD 0 .ie n .IP """in_pod => 1""" 4 .el .IP "\f(CWin_pod => 1\fR" 4 .IX Item "in_pod => 1" .PD Sets the initial value of \f(CW\*(C`in_pod\*(C'\fR. When \f(CW\*(C`in_pod\*(C'\fR is false, the parser ignores all text until the next =command paragraph. .Sp The initial value of \f(CW\*(C`in_pod\*(C'\fR defaults to false for \f(CW\*(C`load_file()\*(C'\fR and \f(CW\*(C`load_fh()\*(C'\fR calls and true for \f(CW\*(C`load_string()\*(C'\fR and \f(CW\*(C`load_paragraphs()\*(C'\fR calls. This is usually what you want, unless you want consistency. If this isn't what you want, pass different initial values in the \fI\f(CI%options\fI\fR hash. .ie n .IP """limit"" => \fIn\fR" 4 .el .IP "\f(CWlimit\fR => \fIn\fR" 4 .IX Item "limit => n" Only parse the first \fIn\fR paragraphs in the \s-1POD.\s0 .SH "DIAGNOSTICS" .IX Header "DIAGNOSTICS" .ie n .IP """load_file""(\fI\f(CI$file\fI\fR)" 4 .el .IP "\f(CWload_file\fR(\fI\f(CI$file\fI\fR)" 4 .IX Item "load_file($file)" Returns null iff it can't open \fI\f(CI$file\fI\fR. .SH "NOTES" .IX Header "NOTES" .SS "No round-tripping" .IX Subsection "No round-tripping" Currently, \f(CW\*(C`Pod::Tree\*(C'\fR does not provide a complete, exact representation of its input. For example, it doesn't distingish between .PP .Vb 1 \& C<$foo\-Ebar> .Ve .PP and .PP .Vb 1 \& C<< $foo\->bar >> .Ve .PP As a result, it is not guaranteed that a file can be exactly reconstructed from its \f(CW\*(C`Pod::Tree\*(C'\fR representation. .SS "L<> markups" .IX Subsection "L<> markups" In the documentation of the .PP .Vb 1 \& L<"sec"> section in this manual page .Ve .PP markup, \f(CW\*(C`perlpod\*(C'\fR has always claimed .PP .Vb 1 \& (the quotes are optional) .Ve .PP However, there is no way to decide from the syntax alone whether .PP .Vb 1 \& L .Ve .PP is a link to the \fIfoo\fR man page or a link to the \f(CW\*(C`foo\*(C'\fR section of this man page. .PP \&\f(CW\*(C`Pod::Tree\*(C'\fR parses \f(CW\*(C`L\*(C'\fR as a link to a section if \&\f(CW\*(C`foo\*(C'\fR looks like a section name (e.g. contains whitespace), and as a link to a man page otherswise. .PP In practice, this tends to break links to sections. If you want your section links to work reliably, write them as \f(CW\*(C`L<"foo">\*(C'\fR or \f(CW\*(C`L\*(C'\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBperl\fR\|(1), \f(CW\*(C`Pod::Tree::Node\*(C'\fR, \f(CW\*(C`Pod::Tree::HTML\*(C'\fR .SH "ACKNOWLEDGMENTS" .IX Header "ACKNOWLEDGMENTS" .IP "\(bu" 4 .IP "\(bu" 4 .IP "\(bu" 4 Paul Bettinger .IP "\(bu" 4 Sean M. Burke .IP "\(bu" 4 Brad Choate .IP "\(bu" 4 Havard Eidnes .IP "\(bu" 4 Rudi Farkas .IP "\(bu" 4 Paul Gibeault .IP "\(bu" 4 Jay Hannah .IP "\(bu" 4 Paul Hawkins .IP "\(bu" 4 Jost Krieger .IP "\(bu" 4 Marc A. Lehmann .IP "\(bu" 4 Jonas Liljegren .IP "\(bu" 4 Thomas Linden .IP "\(bu" 4 Johan Lindstrom .IP "\(bu" 4 Terry Luedtke .IP "\(bu" 4 Rob Napier .IP "\(bu" 4 Kate L Pugh .IP "\(bu" 4 Christopher Shalah .IP "\(bu" 4 Johan Vromans .SH "AUTHOR" .IX Header "AUTHOR" Steven McDougall Currently maintained by Mohammad S Anwar .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 1999\-2009 by Steven McDougall. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.