NAME
Pod DocTree nodes.
DESCRIPTION
This file implements the various abstract syntax tree nodes for Pod.
Pod;DocTree Node Types
Pod;DocTree;Node
Pod;DocTree;Node
is the base class for all PAST nodes,
and is derived from PCT::Node
.
A node has an array component to hold its children,
and a hash component for its attributes.
However,
we tend to use accessor methods for accessing the node's attributes instead of accessing the hash directly.
Every Pod;DocTree node inherits name
,
source
,
and pos
attributes from PCT::Node
.
The name
attribute is the node's name,
if any,
while source
and pos
are used to identify the location in the original source code for the node.
The source
and pos
values are generally set by the node
method inherited from PCT::Node
.
Other node attributes are generally defined by subclasses of Pod;DocTree;Node
.
Pod;DocTree;File
A Pod;DocTree;File
node represents a file containing Pod.
As such,
it's the root
node of the Pod parse tree.
The name
attribute contains the name of the file.
Pod;DocTree;Heading
Pod;DocTree;Heading
nodes represent heading directives in the Pod document tree.
The name
attribute contains the name of the =headX
tag ('head1',
'head2',
etc).
The level
attribute is the numeric heading level (1,
2,
etc).
The title
attribute is the heading title text.
- level([value]) Get/set the heading level for this node.
- title([value]) Get/set the heading title for this node.
Pod;DocTree;Block
Pod;DocTree;Block
nodes represent block sections in the Pod document tree,
either =begin
/=end
pairs,
or a =for
.
The name
attribute contains the name of the block (the first word after the tag).
The title
attribute is the block title text (any text after the name on the block directive line).
- title([value]) Get/set the block title for this node.
Pod;DocTree;List
Pod;DocTree;List
nodes represent list sections in the Pod document tree,
=over
/=back
pairs.
Lists have multiple children,
all Pod;DocTree;Item
nodes.
The name
attribute may indicate if the list is 'ordered',
'bullet',
or 'named'.
Pod;DocTree;Item
Pod;DocTree;Item
nodes represent list items in the Pod document tree,
corresponding to an =item
tag.
The name
attribute contains the item name,
number,
or bullet.
The type
attribute indicates whether the list item is 'ordered',
'bullet',
or 'named'.
Items have multiple children which may be paragraphs,
literal paragraphs,
or blocks.
- type([value]) Get/set the list item type for this node.
Pod;DocTree;Text
Pod;DocTree;Text
nodes represent a section of plain text (a string of alphabetics,
numbers,
spaces,
and punctuation) containing no formatting codes in the Pod document tree.
The name
attribute contains the text for the node.
Pod;DocTree;Format
Pod;DocTree;Format
nodes represent a format code in the Pod document tree.
The name
attribute contains one of 'bold',
'italic',
'code',
'nonbreaking',
'escape',
'index',
'filename',
'link',
or 'noop'.
The original single character code is stored in the code
attribute.
Format nodes have multiple children,
which may be text sections or format nodes.
- code([value]) Get/set the single character formatting code for this node.
Pod;DocTree;Paragraph
Pod;DocTree;Paragraph
nodes represent paragraph sections in the Pod document tree.
Paragraphs have multiple children,
which may be text sections or format nodes.
Pod;DocTree;Literal
Pod;DocTree;Literal
nodes represent literal paragraph sections in the Pod document tree (those paragraphs indented by some number of spaces in the original Pod).
Literals have multiple children,
which may be text sections or format nodes.
NAME
Pod::HTML::Compiler - Pod AST Compiler
DESCRIPTION
Pod::HTML::Compiler implements a compiler for Pod AST nodes.
METHODS
- html_children(node) Return generated HTML for all of its children.
- html(Any node)
- html(Pod::DocTree::File node)
- html(Pod::DocTree::Heading node)
- html(Pod::DocTree::Text node)