<commit_before># Jade.php
[![Build Status](https://travis-ci.org/kylekatarnls/jade-php.svg?branch=master)](https://travis-ci.org/kylekatarnls/jade-php)

Jade.php adds inline PHP scripting support to the [Jade](http://jade-lang.com) template compiler.

##### [The Jade Syntax Reference](https://github.com/visionmedia/jade#readme)

## Implementation details

The fork is a complete rewrite, all the code is ported from the original jade project.

All the features from the original are supported but undertested, including inheritance
and mixins.

### Install using composer
[kylekatarnls/jade-php on packagist.org](https://packagist.org/packages/kylekatarnls/jade-php)

## What's new ?

#### Jade options

Jade options should be passed to the Jade construction

```php
$jade = new Jade(array(
	'prettyprint' => true,
	'extension' => '.jade',
	'cache' => 'pathto/writable/cachefolder/'
);
```

#### Supports for local variables

```php
$data['title'] = 'Hello World';
$jade = new Jade();
$output = $jade->render('file', $data);
``` 

#### Supports for custom filters

Filters must be callable: It can be a class that implements the __invoke() method, or an anonymous function.

```php
$jade->filter('escaped', 'My\Callable\Class');

// or

$jade->filter('escaped', function($node, $compiler){
	foreach ($node->block->nodes as $line) {
		$output[] = $compiler->interpolate($line->value);<commit_msg>Add visual informations<commit_after># Jade.php
[![Latest Stable Version](https://poser.pugx.org/kylekatarnls/jade-php/v/stable.png)](https://packagist.org/packages/kylekatarnls/jade-php)
[![Total Downloads](https://poser.pugx.org/kylekatarnls/jade-php/downloads.png)](https://packagist.org/packages/kylekatarnls/jade-php)
[![Build Status](https://travis-ci.org/kylekatarnls/jade-php.svg?branch=master)](https://travis-ci.org/kylekatarnls/jade-php)
[![codecov.io](https://codecov.io/github/kylekatarnls/jade-php/coverage.svg?branch=master)](https://codecov.io/github/kylekatarnls/jade-php?branch=master)

Jade.php adds inline PHP scripting support to the [Jade](http://jade-lang.com) template compiler.

##### [The Jade Syntax Reference](https://github.com/visionmedia/jade#readme)

## Implementation details

The fork is a complete rewrite, all the code is ported from the original jade project.

All the features from the original are supported but undertested, including inheritance
and mixins.

### Install using composer
[kylekatarnls/jade-php on packagist.org](https://packagist.org/packages/kylekatarnls/jade-php)

## What's new ?

#### Jade options

Jade options should be passed to the Jade construction

```php
$jade = new Jade(array(
	'prettyprint' => true,
	'extension' => '.jade',
	'cache' => 'pathto/writable/cachefolder/'
);
```

#### Supports for local variables

```php
$data['title'] = 'Hello World';
$jade = new Jade();
$output = $jade->render('file', $data);
```

#### Supports for custom filters

Filters must be callable: It can be a class that implements the __invoke() method, or an anonymous function.

```php
$jade->filter('escaped', 'My\Callable\Class');

// or

$jade->filter('escaped', function($node, $compiler){
	foreach ($node->block->nodes as $line) {
		$output[] = $compiler->interpolate($line->value);
{'fraction_non_alphanumeric': 0.16548097742035262, 'fraction_numerical': 0.0, 'mean_word_length': 5.291828793774319, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6996707', 'n_tokens_mistral': 1120, 'n_tokens_neox': 1089, 'n_words': 265}