Path

ez components / documentation / api reference / latest / document


eZ Components latest

Document: ezcDocumentRst

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

Class: ezcDocumentRst

Document handler for RST text documents. [source]

Implemented Interfaces

Parents

ezcDocument
   |
   --ezcDocumentRst

Member Variables

protected ezcDocumentRstDocumentNode $ast
Asbtract syntax tree.

The internal representation of RST documents.
protected string $contents
Plain RST contents as a string
protected array $directives = array(
'include' => 'ezcDocumentRstIncludeDirective',
'contents' => 'ezcDocumentRstContentsDirective',
'image' => 'ezcDocumentRstImageDirective',
'figure' => 'ezcDocumentRstFigureDirective',
'attention' => 'ezcDocumentRstAttentionDirective',
'warning' => 'ezcDocumentRstWarningDirective',
'danger' => 'ezcDocumentRstDangerDirective',
'notice' => 'ezcDocumentRstNoticeDirective',
'note' => 'ezcDocumentRstNoteDirective',
)

Registered directives

Directives are special RST element, which are documented at: http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#directives
Directives are the best entry point for custom rules, and you may register custom directive classes using the class method registerDirective().

Inherited Member Variables

From ezcDocument:
protected  ezcDocument::$options
protected  ezcDocument::$path

Method Summary

public void createFromDocbook( $document )
Create document from docbook document
public ezcDocumentDocbook getAsDocbook( )
Return document compiled to the docbook format
public ezcDocumentXhtml getAsXhtml( )
Return document compiled to the HTML format
public string getDirectiveHandler( $name )
Get directive handler
public void loadString( $string )
Create document from input string
public void registerDirective( $name, $class )
Register directive handler
public string save( )
Return document as string
public mixed validateFile( $file )
Validate the input file
public mixed validateString( $string )
Validate the input string

Inherited Methods

From ezcDocument :
public ezcDocument ezcDocument::__construct()
Construct new document
public abstract void ezcDocument::createFromDocbook()
Create document from docbook document
public abstract ezcDocumentDocbook ezcDocument::getAsDocbook()
Return document compiled to the docbook format
public void ezcDocument::loadFile()
Create document from file
public abstract void ezcDocument::loadString()
Create document from input string
public abstract string ezcDocument::save()
Return document as string

Methods

createFromDocbook

void createFromDocbook( ezcDocumentDocbook $document )
Create document from docbook document
A document of the docbook format is provided and the internal document structure should be created out of this.
This method is required for all formats to have one central format, so that each format can be compiled into each other format using docbook as an intermediate format.
You may of course just call an existing converter for this conversion.

Parameters

Name Type Description
$document ezcDocumentDocbook  

Redefinition of

Method Description
ezcDocument::createFromDocbook() Create document from docbook document

getAsDocbook

ezcDocumentDocbook getAsDocbook( )
Return document compiled to the docbook format
The internal document structure is compiled to the docbook format and the resulting docbook document is returned.
This method is required for all formats to have one central format, so that each format can be compiled into each other format using docbook as an intermediate format.
You may of course just call an existing converter for this conversion.

Redefinition of

Method Description
ezcDocument::getAsDocbook() Return document compiled to the docbook format

getAsXhtml

ezcDocumentXhtml getAsXhtml( )
Return document compiled to the HTML format
The internal document structure is compiled to the HTML format and the resulting HTML document is returned.
This is an optional interface for document markup languages which support a direct transformation to HTML as a shortcut.

getDirectiveHandler

string getDirectiveHandler( string $name )
Get directive handler
Get directive handler class name for the specified name.

Parameters

Name Type Description
$name string  

loadString

void loadString( string $string )
Create document from input string
Create a document of the current type handler class and parse it into a usable internal structure.

Parameters

Name Type Description
$string string  

Redefinition of

Method Description
ezcDocument::loadString() Create document from input string

registerDirective

void registerDirective( string $name, string $class )
Register directive handler
Register a custom directive handler for special directives or overwrite existing directive handlers. The directives are specified by its (lowercase) name and the class name, which should handle the directive and extend from ezcDocumentRstDirective.

Parameters

Name Type Description
$name string  
$class string  

save

string save( )
Return document as string
Serialize the document to a string an return it.

Redefinition of

Method Description
ezcDocument::save() Return document as string

validateFile

mixed validateFile( string $file )
Validate the input file
Validate the input file against the specification of the current document format.
Returns true, if the validation succeded, and an array with ezcDocumentValidationError objects otherwise.

Parameters

Name Type Description
$file string  

validateString

mixed validateString( string $string )
Validate the input string
Validate the input string against the specification of the current document format.
Returns true, if the validation succeded, and an array with ezcDocumentValidationError objects otherwise.

Parameters

Name Type Description
$string string  

Last updated: Tue, 02 Dec 2008