jezdez/django_compressor — pull request #289 by jannon (2012-07-17 19:30:34+00:00)
Title: Adding option to concatenate files before processing

### What's in this pull request

* Let tag arguments after kind (css|js) be specified in any order
* Use more standard 'as ' syntax to name the code block
* Add ability to specify options in the tag
* 'group_first' option to allow files to be concatenated before processing

There are tests and documentation updates as well as the code changes

#### Tag Argument Order

There's not really any need to enforce a certain arrangement of arguments in the tag so let's just let people specify them however they want after the kind parameter. So now all of these are valid:

{% compress js inline as main %}

{% compress js as main file %}

{% compress css group_first=true as base %}

#### Using 'as <name>'

Lots of things in python and django use this syntax, so it would be nice to do so as well

#### Specifying options in the tag

Just like the ```with``` tag in django, you can specify an arbitrary number of keyword/value arguments to the tag. These will get put into a dictionary and passed to the Compressor classes. Also, the default compressors, add these to the options that they pass the precompilers and filters. One of the main motivations for this was to prepare for being able to specify that files should be grouped first before, say, lessc precompilation, which leads to...

#### 'group_first' option

Setting the option ```group_first=true``` in the ```compress``` template tag will cause files of the same type to be concatenated before being handed to precompilers/filters. This will allow people to do standard code decomposition with things like .less files (having a mixins file separate from page-specific files)

For example:

{% compress css group_first=true %}

{% endcompress %}

Will concatenate the .less files so the less precompiler will properly process all the files
This provides a fix for #30