tasks/ext/rSTTask.php
reStructuredText rendering task for Phing, the PHP build tool.
PHP version 5
- Author
- Christian Weiske
- Category
- Tasks
- License
- LGPL v3 or later http://www.gnu.org/licenses/lgpl.html
- Link
- https://gitorious.org/phing/rsttask
- Package
- phing.tasks.ext
- Version
- SVN: $Id: rSTTask.php 1401 2011-12-28 16:48:57Z mrook $
\rSTTask
reStructuredText rendering task for Phing, the PHP build tool.
PHP version 5
- Parent(s)
- \Task < \ProjectComponent
- Author
- Christian Weiske
- Category
- Tasks
- License
- LGPL v3 or later http://www.gnu.org/licenses/lgpl.html
- Link
- https://gitorious.org/phing/rsttask
Properties

string
$destination= 'null'
Output file or directory. May be omitted.
When it ends with a slash, it is considered to be a directory
nullDetails- Type
- string

array
$filterChains= 'array()'
all filterchains objects assigned to this task
array()Details- Type
- array

string
$format= ''html''
Result format, defaults to "html".
'html'Details- Type
- string
- See
- \$supportedFormats

array
$supportedFormats= 'array(
'html''
Array of supported output formats
array(
'html'Details- Type
- array
- See
- \$format
- See
- \$targetExt

array
$targetExt= 'array(
'html' => 'html''
Maps formats to file extensions
array(
'html' => 'html'Details- Type
- array

string
$toolPath= 'null'
Full path to the tool, i.e. /usr/local/bin/rst2html
nullDetails- Type
- string
Methods

createFileSet(
)
:
objectNested creator, creates a FileSet for this task
| Type | Description |
|---|---|
| object | The created fileset object |

createFilterChain(
)
:
\FilterChainCreates a filterchain, stores and returns it
| Type | Description |
|---|---|
| \FilterChain | The created filterchain object |

createMapper(
)
:
\MapperNested creator, creates one Mapper for this task
| Type | Description |
|---|---|
| \Mapper | The created Mapper type object |
| Exception | Description |
|---|---|
| \BuildException |

getTargetFile(
string $file, string $destination
=
null
)
:
stringDetermines and returns the target file name from the input file and the configured destination name.
| Name | Type | Description |
|---|---|---|
| $file | string | Input file |
| $destination | string | Destination file or directory name, may be null |
| Type | Description |
|---|---|
| string | Target file name |
- Uses
- \$format
- Uses
- \$targetExt

getToolPath(
string $format
)
:
stringFinds the rst2* binary path
| Name | Type | Description |
|---|---|---|
| $format | string | Output format |
| Type | Description |
|---|---|
| string | Full path to rst2$format |
| Exception | Description |
|---|---|
| \BuildException | When the tool cannot be found |

render(
string $tool, string $source, string $targetFile
)
:
voidRenders a single file and applies filters on it
| Name | Type | Description |
|---|---|---|
| $tool | string | conversion tool to use |
| $source | string | rST source file |
| $targetFile | string | target file name |

renderFile(
string $tool, string $source, string $targetFile
)
:
voidRenders a single file with the rST tool.
| Name | Type | Description |
|---|---|---|
| $tool | string | conversion tool to use |
| $source | string | rST source file |
| $targetFile | string | target file name |
| Exception | Description |
|---|---|
| \BuildException | When the conversion fails |

setDestination(
string $destination
)
:
voidThe setter for the attribute "destination"
| Name | Type | Description |
|---|---|---|
| $destination | string | Output file or directory. When it ends with a slash, it is taken as directory. |

setFile(
string $file
)
:
voidThe setter for the attribute "file"
| Name | Type | Description |
|---|---|---|
| $file | string | Path of file to render |

setFormat(
string $format
)
:
voidThe setter for the attribute "format"
| Name | Type | Description |
|---|---|---|
| $format | string | Output format |
| Exception | Description |
|---|---|
| \BuildException | When the format is not supported |

setToolparam(
string $param
)
:
voidThe setter for the attribute "toolparam"
| Name | Type | Description |
|---|---|---|
| $param | string | Additional rst2* tool parameters |

setToolpath(
$path
)
:
voidThe setter for the attribute "toolpath"
| Name | Type | Description |
|---|---|---|
| $path |
| Exception | Description |
|---|---|
| \BuildException | When the tool does not exist or is not executable |