{
"info": {
"author": "Daniel Quinn",
"author_email": "code@danielquinn.org",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Operating System :: POSIX",
"Operating System :: Unix",
"Programming Language :: Python",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content"
],
"description": "# django-crocodile\n\nA simple CSS and Javascript aggregator for django\n\nIf you're looking for a simple way to aggregate all of your various style\nsheets into a single download, and do the same for your JavaScript files, this\nis a good start. Here's how it works:\n\nThis is what you probably have on your site. If you don't, then you probably\ndon't need an aggregator:\n\n``` xml\n{% block css %}\n \n \n \n \n{% endblock css %}\n\n{% block js %}\n \n \n \n \n{% endblock js %}\n```\n\nThis isn't ideal, since you're left with multiple server hits, sometimes to\nremote servers. In some of the more complex setups, your site could have 10 or\neven 20 CSS and/or JS files. What's more, you probably have `{% block css %}`\nand `{% block js %}` subclassed elsewhere on your site, so this list of files\nis variable.\n\nCrocodile is setup with a simple template tag:\n\n``` xml\n{% aggregate_css %}\n {% block css %}\n \n \n \n \n {% endblock css %}\n{% endaggregate_css %}\n\n{% aggregate_js %}\n {% block js %}\n \n \n \n \n {% endblock js %}\n{% endaggregate_js %}\n```\n\nAnd the output looks something like this:\n\n``` xml\n\n\n```\n\nThe contents of `file.css` and `file.js` are the combined payloads of every\nfile listed between the `{% aggregate_* %} and {% endaggregate_* %}` tags.\nThis will even include remote files and literal blocks if you put them in\nthere.\n\n\n## But What if I Don't Want to Aggregate Everything?\n\nIt's entirely possible that you may not want all of these files to be loaded at\nonce, as in cases where you may want to force the remote loading of some files.\nTo do that, you just keep those definitions out of the aggregate block:\n\n``` xml\n{% aggregate_css %}\n {% block css %}\n \n \n \n {% endblock css %}\n{% endaggregate_css %}\n\n{% block my_special_case_css %}\n \n{% endblock my_special_case_css %}\n```\n\nEverything outside of the aggregation block is left alone.\n\n\n## Setup & Installation\n\nTo install it into your project, just use `pip`. Either using pypi:\n\n``` bash\n$ pip install django-crocodile\n```\n\nOr you can grab the development version through GitHub:\n\n``` bash\n$ pip install git+git://github.com/danielquinn/django-crocodile.git#egg=django-crocodile\n```\n\nOnce you've got it, you'll need to add it to your `INSTALLED_APPS` in your\n`settings.py` file. Some additional values you might want to tinker with are:\n\n* `RELEASE`\n * This is the release version of your project. `django-crocodile` will\n append this value in the form of `?release=RELEASE` so you don't have to\n worry about users caching your old CSS values.\n* `CROCODILE_ENABLE`\n * If this is set to `True`, aggregation will occur even when `DEBUG = True`.\n* `CROCODILE_ENABLE_COMPRESSION`\n * CSS compression is enabled by default. Setting this value to `False`\n will disable it.\n\nAnd that's it, now go about wrapping your markup and see what happens!\n\n\n## TODO\n\n* A management script to blow away the cache files. Just to make things a\n little cleaner than forcing you to run `rm /path/to/media/root/cache/{css,js}/*`\n* Medium-aware CSS is still sketchy. Basically it currently grabs all CSS\n files that aren't set to `media=\"print\"` and dumps them into the aggregated\n `.css` file. If you have a printable .css file, it's best to keep it out of\n your aggregation block for this reason.\n * Other media types are just rolled into the aggregated file, so that may\n cause some headaches.\n* Exploder-specific CSS tags (`