classes/phing/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
subpackage
rST
version
SVN: $Id: rSTTask.php 1277 2011-08-17 17:06:22Z mrook $

\rSTTask

reStructuredText rendering task for Phing, the PHP build tool.

PHP version 5

Extends from
\Task
author
Christian Weiske
category
Tasks
copyright
2001,2002 THYRELL. All rights reserved
license
LGPL v3 or later http://www.gnu.org/licenses/lgpl.html
link
https://gitorious.org/phing/rsttask
package
Phing
subpackage
rST
version
$Revision: 912 $

Properties

Propertyprotectedstring  $destination= 'null'

Output file or directory. May be omitted.

When it ends with a slash, it is considered to be a directory

Default valuenullDetails
Type
string
Propertyprotectedstring  $file= 'null'

Input file in rST format.

Required

Default valuenullDetails
Type
string
Propertyprotected  $filesets= 'array'
Default valuearrayDetails
Type
Propertyprotectedarray  $filterChains= 'array'

all filterchains objects assigned to this task

Default valuearrayDetails
Type
array
Propertyprotectedstring  $format= 'html'

Result format, defaults to "html".

Default valuehtmlDetails
Type
string
see
\$supportedFormats
Propertyprotected  $mapperElement= 'null'
Default valuenullDetails
Type
Propertyprotectedinteger  $mode= '0755'

mode to create directories with

Default value0755Details
Type
integer
Propertyprotectedarray  $supportedFormats= 'array'
static

Array of supported output formats

Default valuearrayDetails
Type
array
see
\$format
see
\$targetExt
Propertyprotectedarray  $targetExt= 'array'
static

Maps formats to file extensions

Default valuearrayDetails
Type
array
Propertyprotectedstring  $taskName= 'rST'

Taskname for logger
Default valuerSTDetails
Type
string
Propertyprotectedstring  $toolParam= 'null'

Additional rst2* tool parameters.

Default valuenullDetails
Type
string
Propertyprotectedstring  $toolPath= 'null'

Full path to the tool, i.e. /usr/local/bin/rst2html

Default valuenullDetails
Type
string
Propertyprotectedboolean  $uptodate= 'false'

Only render files whole source files are newer than the target files

Default valuefalseDetails
Type
boolean

Methods

methodpublic  createFileSet( ) : object
Nested creator, creates a FileSet for this task
Returns
Type Description
object
methodpublic  createFilterChain( ) : \FilterChain
Creates a filterchain, stores and returns it
Returns
Type Description
\FilterChain
methodpublic  createMapper( ) : \Mapper
Nested creator, creates one Mapper for this task
Returns
Type Description
\Mapper
Details
throws
methodpublic  getTargetFile( string $file, string $destination = null ) : string
Determines and returns the target file name from the input file and the configured destination name.
Parameters
Name Type Description
$file string Input file
$destination string Destination file or directory name, may be null
Returns
Type Description
string
Details
uses
\$format
uses
\$targetExt
methodprotected  getToolPath( string $format ) : string
Finds the rst2* binary path
Parameters
Name Type Description
$format string Output format
Returns
Type Description
string
Details
throws
When the tool cannot be found
methodpublic  main( ) : void
The main entry point method.
methodprotected  render( string $tool, string $source, string $targetFile ) : void
Renders a single file and applies filters on it
Parameters
Name Type Description
$tool string conversion tool to use
$source string rST source file
$targetFile string target file name
methodprotected  renderFile( string $tool, string $source, string $targetFile ) : void
Renders a single file with the rST tool.
Parameters
Name Type Description
$tool string conversion tool to use
$source string rST source file
$targetFile string target file name
Details
throws
When the conversion fails
methodpublic  setDestination( string $destination ) : void
The setter for the attribute "destination"
Parameters
Name Type Description
$destination string Output file or directory. When it ends with a slash, it is taken as directory.
methodpublic  setFile( string $file ) : void
The setter for the attribute "file"
Parameters
Name Type Description
$file string Path of file to render
methodpublic  setFormat( string $format ) : void
The setter for the attribute "format"
Parameters
Name Type Description
$format string Output format
Details
throws
When the format is not supported
methodpublic  setToolparam( string $param ) : void
The setter for the attribute "toolparam"
Parameters
Name Type Description
$param string

Additional rst2* tool parameters

methodpublic  setToolpath(  $path ) : void
The setter for the attribute "toolpath"
Parameters
Name Type Description
$path
Details
throws
When the tool does not exist or is not executable
methodpublic  setUptodate( string $uptodate ) : void
The setter for the attribute "uptodate"
Parameters
Name Type Description
$uptodate string

True/false

Documentation was generated by DocBlox 0.13.1.