PHP Class Tale\Jade\Filter

Show file Open project: talesoft/tale-jade

Public Methods

Method Description
filterCode ( Node $node, string $indent, string $newLine ) : string Wraps the content in PHP-compiler tags and corrects indentation and new-lines.
filterCoffeeScript ( Node $node, string $indent, string $newLine ) : string Compiles the CoffeeScript content to JavaScript
filterLess ( Node $node, string $indent, string $newLine ) : string Compiles the LESS content to CSS
filterMarkdown ( Node $node, string $indent, string $newLine ) : string Compiles the markdown content to HTML.
filterPlain ( Node $node, string $indent, string $newLine ) : string A plain-text filter that just corrects indentation and new-lines.
filterSass ( Node $node, string $indent, string $newLine ) : string Compiles the SASS content to CSS
filterScript ( Node $node, string $indent, string $newLine ) : string Wraps the content in tags and corrects indentation and new-lines.
filterStyle ( Node $node, string $indent, string $newLine ) : string Wraps the content in tags and corrects indentation and new-lines.
filterStylus ( Node $node, string $indent, string $newLine ) : string Compiles the Stylus content to CSS
wrapCode ( Node $node, string $indent, string $newLine ) : string Similar to wrapTag, but rather puts PHP-instruction-tags around the text.
wrapTag ( string $tag, Node $node, string $indent, string $newLine ) : string Wraps a node $node in tags using $tag.

Method Details

filterCode() public static method

Wraps the content in PHP-compiler tags and corrects indentation and new-lines.
public static filterCode ( Node $node, string $indent, string $newLine ) : string
$node Tale\Jade\Parser\Node the node to be wrapped
$indent string the indentation to use on each child
$newLine string the new-line to append after each line
return string the wrapped PHP-string

filterCoffeeScript() public static method

Compiles the CoffeeScript content to JavaScript
public static filterCoffeeScript ( Node $node, string $indent, string $newLine ) : string
$node Tale\Jade\Parser\Node the node to be compiled
$indent string the indentation to use on each child
$newLine string the new-line to append after each line
return string the wrapped JavaScript-HTML-string

filterLess() public static method

Compiles the LESS content to CSS
public static filterLess ( Node $node, string $indent, string $newLine ) : string
$node Tale\Jade\Parser\Node the node to be compiled
$indent string the indentation to use on each child
$newLine string the new-line to append after each line
return string the wrapped Less-CSS-string

filterMarkdown() public static method

Compiles the markdown content to HTML.
public static filterMarkdown ( Node $node, string $indent, string $newLine ) : string
$node Tale\Jade\Parser\Node the node to be compiled
$indent string the indentation to use on each child
$newLine string the new-line to append after each line
return string the wrapped HTML-string

filterPlain() public static method

A plain-text filter that just corrects indentation and new-lines.
public static filterPlain ( Node $node, string $indent, string $newLine ) : string
$node Tale\Jade\Parser\Node the node to be wrapped
$indent string the indentation to use on each child
$newLine string the new-line to append after each line
return string the wrapped PTHML-string

filterSass() public static method

Compiles the SASS content to CSS
public static filterSass ( Node $node, string $indent, string $newLine ) : string
$node Tale\Jade\Parser\Node the node to be compiled
$indent string the indentation to use on each child
$newLine string the new-line to append after each line
return string the wrapped SASS-CSS-string

filterScript() public static method

Wraps the content in tags and corrects indentation and new-lines.
public static filterScript ( Node $node, string $indent, string $newLine ) : string
$node Tale\Jade\Parser\Node the node to be wrapped
$indent string the indentation to use on each child
$newLine string the new-line to append after each line
return string the wrapped PTHML-string

filterStyle() public static method

Wraps the content in tags and corrects indentation and new-lines.
public static filterStyle ( Node $node, string $indent, string $newLine ) : string
$node Tale\Jade\Parser\Node the node to be wrapped
$indent string the indentation to use on each child
$newLine string the new-line to append after each line
return string The wrapped PTHML-string

filterStylus() public static method

Compiles the Stylus content to CSS
public static filterStylus ( Node $node, string $indent, string $newLine ) : string
$node Tale\Jade\Parser\Node the node to be compiled
$indent string the indentation to use on each child
$newLine string the new-line to append after each line
return string the wrapped Stylus-CSS-string

wrapCode() public static method

This will create working PHP expressions. If are already found, they will be trimmed and re-appended correctly to avoid failing nested expressions (
public static wrapCode ( Node $node, string $indent, string $newLine ) : string
$node Tale\Jade\Parser\Node the node to be wrapped
$indent string the indentation to use on each child
$newLine string the new-line to append after each line
return string the wrapped PHP-string

wrapTag() public static method

Respects indentation and new-lines based on $indent and $newLine
public static wrapTag ( string $tag, Node $node, string $indent, string $newLine ) : string
$tag string the tag to wrap the node in
$node Tale\Jade\Parser\Node the node to be wrapped
$indent string the indentation to use on each child
$newLine string the new-line to append after each line
return string the wrapped PTHML-string