Path

ez components / documentation / api reference / 2009.2.1 / document


eZ Components 2009.2.1

Document: ezcDocumentRstDirective

[ Tutorial ] [ Conversion ] [ Styles ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcDocumentRstDirective

Visitor for RST directives [source]

Descendents

Child Class Description
ezcDocumentRstIncludeDirective Visitor for RST include directives
ezcDocumentRstImageDirective Visitor for RST image directives
ezcDocumentRstNoticeDirective Visitor for RST tip directives
ezcDocumentRstContentsDirective Visitor for RST contents directives
ezcDocumentRstAttentionDirective Visitor for RST important directives
ezcDocumentRstWarningDirective Visitor for RST warning directives
ezcDocumentRstDangerDirective Visitor for RST danger directives
ezcDocumentRstNoteDirective Visitor for RST note 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
ezcDocumentRstIncludeDirective::toDocbook() Transform directive to docbook
ezcDocumentRstImageDirective::toDocbook() Transform directive to docbook
ezcDocumentRstFigureDirective::toDocbook() Transform directive to docbook
ezcDocumentRstNoticeDirective::toDocbook() Transform directive to docbook
ezcDocumentRstContentsDirective::toDocbook() Transform directive to docbook
ezcDocumentRstAttentionDirective::toDocbook() Transform directive to docbook
ezcDocumentRstWarningDirective::toDocbook() Transform directive to docbook
ezcDocumentRstDangerDirective::toDocbook() Transform directive to docbook
ezcDocumentRstNoteDirective::toDocbook() Transform directive to docbook

Last updated: Tue, 23 Mar 2010