<commit_before>Twig.js
=======

[![Build Badge]] [Build Status]
[![Scrutinizer Badge]] [Scrutinizer Code Quality]

[Twig.js](http://jmsyst.com/libs/twig.js) is a PHP project that compiles Twig
templates into executable Javascript for client-side execution. It is not to be
confused with [Twig.js](https://github.com/justjohn/twig.js/), which is a pure
Javascript implementation of the Twig templating language.

Twig Compatibility
------------------

Compatibility with vanilla PHP Twig is not yet at 100%. If you need your
templates to work with both Twig.js *and* Twig, stick to the supported filters
and functions described below.

#### Supported Filters

* `abs`
* `capitalize`
* `default`
* `e`
* `escape`
* `first`
* `join`
* `json_encode`
* `keys`
* `length`
* `lower`
* `nl2br`
* `replace`
* `title`
* `trim`
* `upper`
* `url_encode`

#### Supported Functions

* `block`
* `include`
* `max`
* `min`
* `range`

Incompatibilities
-----------------

The following is a list of functionality present in Twig that is not yet
available in Twig.js. There are some really easy pickings in these lists for
anybody hoping to make a contribution to the project.

#### Unsupported Filters

* `batch`
* `convert_encoding`
* `date`
* `date_modify`
* `format`
* `last`
* `number_format`
* `merge`
* `upper`
* `raw`
* `reverse`
* `round`
* `slice`
* `sort`
* `split`
* `striptags`

#### Unsupported Functions

* `attribute`
* `constant`
* `cycle`
* `date`
* `dump`
* `parent`
* `random`
* `source`
* `template_from_string`

Testing
-------

To run the tests, you'll need [Composer], [Node] and [NPM] on your system.

```bash
$ make test
```

License
-------

Twig.js is released under the [Apache License], Version 2.0.

[Apache License]: http://www.apache.org/licenses/LICENSE-2.0
[Composer]: https://getcomposer.org/
[Node]: http://nodejs.org/
[NPM]: https://www.npmjs.org/
[Build Badge]: https://secure.travis-ci.org/schmittjoh/twig.js.png
[Build Status]: http://travis-ci.org/schmittjoh/twig.js
[Scrutinizer Badge]: https://scrutinizer-ci.com/g/h2s/twig.js/badges/quality-score.png?b=master
[Scrutinizer Code Quality]: https://scrutinizer-ci.com/g/h2s/twig.js/?branch=master
<commit_msg>Remove "upper" from the list of unsupported filters<commit_after>Twig.js
=======

[![Build Badge]] [Build Status]
[![Scrutinizer Badge]] [Scrutinizer Code Quality]

[Twig.js](http://jmsyst.com/libs/twig.js) is a PHP project that compiles Twig
templates into executable Javascript for client-side execution. It is not to be
confused with [Twig.js](https://github.com/justjohn/twig.js/), which is a pure
Javascript implementation of the Twig templating language.

Twig Compatibility
------------------

Compatibility with vanilla PHP Twig is not yet at 100%. If you need your
templates to work with both Twig.js *and* Twig, stick to the supported filters
and functions described below.

#### Supported Filters

* `abs`
* `capitalize`
* `default`
* `e`
* `escape`
* `first`
* `join`
* `json_encode`
* `keys`
* `length`
* `lower`
* `nl2br`
* `replace`
* `title`
* `trim`
* `upper`
* `url_encode`

#### Supported Functions

* `block`
* `include`
* `max`
* `min`
* `range`

Incompatibilities
-----------------

The following is a list of functionality present in Twig that is not yet
available in Twig.js. There are some really easy pickings in these lists for
anybody hoping to make a contribution to the project.

#### Unsupported Filters

* `batch`
* `convert_encoding`
* `date`
* `date_modify`
* `format`
* `last`
* `number_format`
* `merge`
* `raw`
* `reverse`
* `round`
* `slice`
* `sort`
* `split`
* `striptags`

#### Unsupported Functions

* `attribute`
* `constant`
* `cycle`
* `date`
* `dump`
* `parent`
* `random`
* `source`
* `template_from_string`

Testing
-------

To run the tests, you'll need [Composer], [Node] and [NPM] on your system.

```bash
$ make test
```

License
-------

Twig.js is released under the [Apache License], Version 2.0.

[Apache License]: http://www.apache.org/licenses/LICENSE-2.0
[Composer]: https://getcomposer.org/
[Node]: http://nodejs.org/
[NPM]: https://www.npmjs.org/
[Build Badge]: https://secure.travis-ci.org/schmittjoh/twig.js.png
[Build Status]: http://travis-ci.org/schmittjoh/twig.js
[Scrutinizer Badge]: https://scrutinizer-ci.com/g/h2s/twig.js/badges/quality-score.png?b=master
[Scrutinizer Code Quality]: https://scrutinizer-ci.com/g/h2s/twig.js/?branch=master

{'fraction_non_alphanumeric': 0.17592171142467, 'fraction_numerical': 0.004551661356395084, 'mean_word_length': 4.051724137931035, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7260679', 'n_tokens_mistral': 1622, 'n_tokens_neox': 1574, 'n_words': 442}