Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
I used and heavily modified django-compress for a while, but needed something else when the project stalled. Django_compressor offered some continuity (filters/extensibility) and some very welcome differences (parsing blocks from the code). I would like to see django_compressor be the basis for a full modern web asset handling package, that works well with modern best practises (e.g. asynchronous asset loaders, css sprites, etc). To that end, my plan is to start with django_compressor's extensibility, enhance it a little bit, then build some useful stuff on top of it (e.g. filters/compilers for images). The first step, however is just adding a little more flexibility and standardization to the template tag
What's in this pull request
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:
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
Here's the big one. 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 (as discussed in #30)