{ "info": { "author": "Dave Dash, James Socol", "author_email": "dd@mozilla.com, james@mozilla.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Environment :: Web Environment :: Mozilla", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "============\nJingo Minify\n============\n\nJingo Minify is DEPRECATED\n--------------------------\n\nIn version 1.8, Django added support for multiple template engines, and provided\na Jinja2 backend. The django-jinja_ project leverages that to support Jinja2,\nwhile Jingo does not.\n\n**django-jinja is recommended for new projects.** Jingo >=0.8 supports Django\n1.8, but it will not be maintained beyond version 0.9, and **will not** support\nDjango 1.9 or above. If you're already using Jingo, and not ready to make `the\nswitch`_, Jingo should continue to work for now, though not without some effort.\n\n0.9_ will be the last release of Jingo, unless a new maintainer comes along with\na new direction.\n\nSince Jingo is no longer maintained, Jingo Minify is also deprecated.\n\nAs of 0.9, Jingo's built-in helpers are provided via a `Jinja2 extension`_ to\nsimplify moving away from Jingo. The entire ``jingo/ext.py`` file can be copied\ninto another project, or referenced as ``'jingo.ext.JingoExtension'``. Used in\nthis way, Jingo plays nicely with django-jinja (and theoretically Django's\nbuilt-in Jinja2 backend).\n\n.. _django-jinja: https://github.com/niwinz/django-jinja\n.. _the switch: http://bluesock.org/~willkg/blog/mozilla/input_django_1_8_upgrade.html#switching-from-jingo-to-django-jinja\n.. _Jinja2: http://jinja.pocoo.org/2/\n.. _0.9: https://https://pypi.python.org/pypi/jingo/0.9.0\n.. _Jinja2 extension: https://github.com/jbalogh/jingo/blob/master/jingo/ext.py\n\n\nJingo Minify is an CSS/JS bundler and minifier for use with Jingo_, a connector\nto use Jinja2_ templates with Django_.\n\n.. image:: https://api.travis-ci.org/jsocol/jingo-minify.png\n\n\nInstalling Jingo Minify\n=======================\n\n\nRequirements\n------------\n\n* **Django 1.4**\n\n* **Jingo and Jinja2**. Jingo Minify is not designed for Django templates.\n\nOne of the following:\n\n* **Java**. If you want to use YUI Compressor.\n\n* **NodeJS**. If you want to use UglifyJS_ and clean-css_.\n\nOptionally:\n\n* **less**. Jingo Minify supports less_, if you have ``lessc`` available.\n* **sass**. Jingo Minify supports sass_, if you have ``sass`` available.\n* **stylus**. Jingo Minify supports stylus_, if you have ``stylus`` available.\n\n\nInstallation\n------------\n\nConfigure the following settings::\n\n # Jingo Minify uses the YUICompressor internally, so needs Java.\n JAVA_BIN = '/path/to/java'\n\n # If you want to use less, set this:\n LESS_BIN = '/path/to/lessc' # Probably just 'lessc'\n\n # If you want to use sass, set this:\n SASS_BIN = '/path/to/sass'\n\n # If you want to use node-based minifiers, set these:\n UGLIFY_BIN = '/path/to/uglifyjs' # Probably just 'uglify'\n CLEANCSS_BIN = '/path/to/cleancss' # Probably just 'cleancss'\n\n\t# If you want to use a specific git executable, set this:\n\tGIT_BIN = '/path/to/git' # Default to 'git'\n\n\t# If you use a different git root for assets\n\tJINGO_MINIFY_ASSETS_GIT_ROOT = '.'\n\n\t# If you want a different JINGO_MINIFY_ROOT than static\n\tJINGO_MINIFY_ROOT = '/var/www/example.com/static/'\n\n # Add jingo_minify to INSTALLED_APPS\n INSTALLED_APPS = (\n # ...\n 'jingo_minify',\n # ...\n )\n\n # This is the important part.\n MINIFY_BUNDLES = {\n 'css': {},\n 'js': {},\n }\n\n\nNote: If you're using Django 1.4, but want to use MEDIA_ROOT and MEDIA_URL\nfor static assets instead of conventional Django 1.4 STATIC_ROOT and\nSTATIC_URL, you should also set::\n\n JINGO_MINIFY_USE_STATIC = False\n\n\nConfiguring\n===========\n\nJingo Minify deals with *bundles*, which lets you organize your code into\nmultiple files but combine them into very few groups for your users to\ndownload.\n\nBundles are set up in the ``MINIFY_BUNDLES`` setting. For example::\n\n MINIFY_BUNDLES = {\n 'css': {\n 'common': (\n 'css/reset.css',\n 'css/layout.css',\n ),\n },\n 'js': {\n 'common': (\n 'js/lib/jquery.js',\n 'js/common.js',\n ),\n },\n }\n\nThis creates one CSS bundle and one JS bundle, both called ``common``. The file\npaths are relative to the ``MEDIA_ROOT`` setting.\n\nYou can create any number or combination of CSS and JS bundles, and include any\nnumber of files in each, but **do not create empty bundles**.\n\nUsing Bundled Files\n-------------------\n\nFor development, you probably don't want to rebundle the files all the time.\nJust set\n\n::\n\n TEMPLATE_DEBUG = True\n\nin your settings, and Jingo Minify will automatically use the uncompressed\nfiles. Set ``TEMPLATE_DEBUG`` to ``False`` to use the bundled versions.\n\nIn Templates\n============\n\nTo include a bundle in a template, use either the ``css`` or ``js`` functions.\nFor example::\n\n {# My Jinja2 Template #}\n \n \n My Page\n {{ css('common') }}\n \n \n

My page

\n {{ js('common') }}\n \n \n\nThis will include the code (```` and ``