{ "info": { "author": "Thomas Khyn", "author_email": "thomas@ksytek.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Plugins", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing", "Topic :: Utilities" ], "description": "django-jsdir\n============\n\n|copyright| 2014-2015 Thomas Khyn, MIT License\n\n\nAbout\n-----\n\nWhen your project tightly depends on a relatively large amount of JavaScript\ncode, the natural way of dealing with it is to break the JavaScript code down\ninto several sub-scripts. This both improves readability and ease of debugging.\n\nHowever, there are times when you would be happy to only have one - possibly\ncompressed - file (in production for example) or to not have to link every\nsingle standalone js file in your template in development.\n\n``django-jsdir`` aims at solving this issue by providing a way to automatically\nlink the js files in a directory tree with a single template tag and inclusion,\nexclusion or sorting rules. In this regard it is significantly more flexible\nthan django-pipeline_.\n\n``django-jsdir`` has been tested with Django 1.8+ and latest compatible minor\nPyhton versions (2.7 and 3.5). It may work - without guarantee - for earlier\nDjango versions.\n\nIf you like ``django-jsdir`` and are looking for a way to thank me and/or\nencourage future development, you can send a few mBTC at this Bitcoin address:\n``1EwENyR8RV6tMc1hsLTkPURtn5wJgaBfG9``.\n\n\nSetup\n-----\n\n1. Install using your prefered method, e.g ``pip install django-jsdir``\n2. You will need both ``'jsdir'`` and ``'django.contrib.staticfiles'`` in your\n ``INSTALLED_APPS``. Make sure that ``'jsdir'`` is placed `before`\n ``'django.contrib.staticfiles'``.\n3. If you are using Jinja2, add ``'jsdir.jinja2.ext'`` to your Jinja2\n extensions list\n\n\nHow it works\n------------\n\nDirectory concatenation\n.......................\n\nA short real-life example is better than long boring explanations. Suppose you\nhave the following JS files layout::\n\n static/js/\n big_script/\n 00_init.js\n 10_helpers.js\n 50_core.js\n 99_onload.js\n\nAll the files in big_script are nicely formatted and commented javascript\nfiles, perfect for debugging. But you have to include each js file from\nbig_script in your template. And even worse, when deploying your application,\nyou need to concatenate/compress the big_script directory and update your\ntemplate accordingly. All that entirely manually.\n\nUntil now.\n\nWith ``django-jsdir`` and a few minimal changes, you will not have to worry\nabout that anymore. The only thing to do is to get rid of all the ``