Zeta Components Manual :: Docs For Class ezcDocumentRstDirective
Document::ezcDocumentRstDirective
Class ezcDocumentRstDirective
Visitor for RST directives
Source for this file: /Document/src/document/rst/directive.php
Version: | //autogen// |
Descendants
Child Class | Description |
---|---|
ezcDocumentRstAttentionDirective | Visitor for RST important directives |
ezcDocumentRstIncludeDirective | Visitor for RST include directives |
ezcDocumentRstWarningDirective | Visitor for RST warning directives |
ezcDocumentRstNoticeDirective | Visitor for RST tip directives |
ezcDocumentRstContentsDirective | Visitor for RST contents directives |
ezcDocumentRstNoteDirective | Visitor for RST note directives |
ezcDocumentRstImageDirective | Visitor for RST image directives |
ezcDocumentRstDangerDirective | Visitor for RST danger directives |
Member Variables
protected ezcDocumentRstDocumentNode |
$ast
Complete RST abstract syntax tree, if this is necessary to render the directive. |
protected ezcDocumentRstDirectiveNode |
$node
Current directive RST AST node. |
protected string |
$path
Current document base path, especially relevant for file inclusions. |
protected ezcDocumentRstVisitor |
$visitor
The calling visitor. |
Method Summary
public void |
__construct(
$ast
, $path
, $node
)
Construct directive from AST and node |
protected DOMDocument |
parseTokens(
$tokens
, $visitor
)
Parse directive token list with RST parser |
public void |
setSourceVisitor(
$visitor
)
Set the calling vaisitor |
public abstract void |
toDocbook(
$document
, $root
)
Transform directive to docbook |
Methods
__construct
void
__construct(
$ast
, string
$path
,
$node
)
Construct directive from AST and node
Parameters:
Name | Type | Description |
---|---|---|
$ast |
ezcDocumentRstDocumentNode | |
$path |
string | |
$node |
ezcDocumentRstDirectiveNode |
parseTokens
DOMDocument
parseTokens(
$tokens
, ezcDocumentRstVisitor
$visitor
)
Parse directive token list with RST parser
This method is intended to parse the token list, provided for the RST contents using the standard RST parser. It will be visited afterwards by the provided RST-visitor implementation.
The method returns the created document as a DOMDocument. You normally need to use DOMDocument::importNode to embed the conatined nodes in your target document.
Parameters:
Name | Type | Description |
---|---|---|
$tokens |
array | |
$visitor |
ezcDocumentRstVisitor |
setSourceVisitor
void
setSourceVisitor(
ezcDocumentRstVisitor
$visitor
)
Set the calling vaisitor
Pass the visitor which called the rendering function on the directive for optional reference.
Parameters:
Name | Type | Description |
---|---|---|
$visitor |
ezcDocumentRstVisitor |
toDocbook
void
toDocbook(
$document
,
$root
)
Transform directive to docbook
Create a docbook XML structure at the directives position in the document.
Parameters:
Name | Type | Description |
---|---|---|
$document |
DOMDocument | |
$root |
DOMElement |
Redefined in descendants as:
Method | Description |
---|---|
ezcDocumentRstAttentionDirective::toDocbook() |
Transform directive to docbook |
ezcDocumentRstIncludeDirective::toDocbook() |
Transform directive to docbook |
ezcDocumentRstWarningDirective::toDocbook() |
Transform directive to docbook |
ezcDocumentRstNoticeDirective::toDocbook() |
Transform directive to docbook |
ezcDocumentRstContentsDirective::toDocbook() |
Transform directive to docbook |
ezcDocumentRstNoteDirective::toDocbook() |
Transform directive to docbook |
ezcDocumentRstImageDirective::toDocbook() |
Transform directive to docbook |
ezcDocumentRstFigureDirective::toDocbook() |
Transform directive to docbook |
ezcDocumentRstDangerDirective::toDocbook() |
Transform directive to docbook |
Documentation generated by phpDocumentor 1.4.3