Skip to main content

django_compressor filter to compile coffee-script

Project description

Coffee Compressor Compiler
=========================

[![Build Status](https://travis-ci.org/Juvenal1228/coffee-compressor-compiler.png?branch=master)](https://travis-ci.org/Juvenal1228/coffee-compressor-compiler)

Purpose
-------

This tool is meant to be used as an extension to [django-compressor](https://github.com/jezdez/django_compressor)

It precompiles [coffee-script](http://coffeescript.org/)


Features
--------

- platform independent
- no need to install node.js packages
- 100% test coverage
- [PEP 8](http://www.python.org/dev/peps/pep-0008/) compliance
- [semver](http://semver.org/) compliance


Installing
----------

Install with pip/easy_install from the pypi

`pip install coffee-compressor-compiler`

or clone the latest source

git clone https://github.com/Juvenal1228/coffee-compressor-compiler.git
cd coffee-compressor-compiler
python setup.py install

You must also install [node.js](http://nodejs.org/) or [PyV8](https://code.google.com/p/pyv8/)

The latest versions of node.js can be found [here](http://nodejs.org/download/)

Using
-----

Using this tool is as simple as installing it and adding it to the `COMPRESS_PRECOMPILERS` django setting

```python
COMPRESS_PRECOMPILERS = (
('text/coffeescript', 'coffeecompressorcompiler.filter.CoffeeScriptCompiler'),
)
```

Then, in your django templates you can embed coffee-script templates like so
```html+django
{% load staticfiles %}
{% load compress %}

{% compress js %}
<script type="text/coffeescript" src="{% static 'app/main.coffee' %}" ></script>
<script type="text/coffeescript">
console.log 'Hello!'
alert 'Hello!'
</script>
{% endcompress %}
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coffee-compressor-compiler-0.1.0.zip (8.2 kB view details)

Uploaded Source

File details

Details for the file coffee-compressor-compiler-0.1.0.zip.

File metadata

File hashes

Hashes for coffee-compressor-compiler-0.1.0.zip
Algorithm Hash digest
SHA256 41862c0280dc67ec544473dd2e4a86b6af5d84cdc135b06e23b9103c490c572f
MD5 a9bd857cd9fe8c6c3c71889e18e52536
BLAKE2b-256 757c50081bdc0825d5b5866f1c8a681e8b3c5ff6d9241d2c10f131755023014f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page