From 6fcf221193685b42c8d910677006909522544676 Mon Sep 17 00:00:00 2001 From: Jaap Roes Date: Sat, 16 Apr 2011 23:37:55 +0200 Subject: [PATCH 1/3] Expanded and reworded README.rst a bit, nitpick the description in setup.py. --- README.rst | 24 ++++++++++++++++++++---- setup.py | 2 +- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 48034ac..1ccee1c 100644 --- a/README.rst +++ b/README.rst @@ -1,13 +1,29 @@ Django Compressor ================= -Compresses linked and inline JavaCcript or CSS into a single cached file. +Django Compressor can concatenate and then compress linked and inline Javascript +& CSS into cached single static files. -The main website for django-compressor is -`github.com/jezdez/django_compressor`_ where you can also file tickets. +The compress template tag parses all the HTML in between `{% compress js/css %}` +and `{% endcompress %}` and looks for linked stylesheets or JS. It then +concatenates the files and inline styles/scripts and optionally compresses them +using one of the provided or a custom filter. -You can also install the `in-development version`_ of django-compressor with +This process can also be started using the Django management command +`manage.py compress`. + +The `in-development version`_ of django-compressor can be installed with ``pip install django_compressor==dev`` or ``easy_install django_compressor==dev``. +More +---- + +* More documentation about the usage and settings of django-compressor can be found + at `readthedocs.org/docs/django_compressor/en/latest`_. + +* The source code for django-compressor can be found and contributed to on + `github.com/jezdez/django_compressor`_. There you can also file tickets. + +.. _readthedocs.org/docs/django_compressor/en/latest: http://readthedocs.org/docs/django_compressor/en/latest .. _github.com/jezdez/django_compressor: http://github.com/jezdez/django_compressor .. _in-development version: http://github.com/jezdez/django_compressor/tarball/master#egg=django_compressor-dev diff --git a/setup.py b/setup.py index 44fff5f..7c8e868 100644 --- a/setup.py +++ b/setup.py @@ -105,7 +105,7 @@ setup( version = VERSION, url = 'http://django_compressor.readthedocs.org/', license = 'BSD', - description = "Compresses linked and inline JavaScript or CSS into a single cached file.", + description = "Compresses linked and inline JavaScript or CSS into single cached files.", long_description = README, author = 'Jannis Leidel', author_email = 'jannis@leidel.info', From 9137976284f1cdfd6df5171a11396d00c54bcd65 Mon Sep 17 00:00:00 2001 From: Jaap Roes Date: Sun, 17 Apr 2011 01:56:07 +0200 Subject: [PATCH 2/3] Tell more about django-compressor's features, extendibility and configurability. --- README.rst | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index 1ccee1c..2b50f33 100644 --- a/README.rst +++ b/README.rst @@ -6,24 +6,49 @@ Django Compressor can concatenate and then compress linked and inline Javascript The compress template tag parses all the HTML in between `{% compress js/css %}` and `{% endcompress %}` and looks for linked stylesheets or JS. It then -concatenates the files and inline styles/scripts and optionally compresses them -using one of the provided or a custom filter. +concatenates the files and inline styles/scripts and (optionally) compresses them +using one or more of the provided or your own custom filters. -This process can also be started using the Django management command -`manage.py compress`. +The concatenation and compressing process can also be started using the +Django management command `manage.py compress`. -The `in-development version`_ of django-compressor can be installed with -``pip install django_compressor==dev`` or ``easy_install django_compressor==dev``. +HTML Parsing +------------- + +The HTML parsing backend is also configurable and defaults to `BeautifulSoup`. +An abstract base class makes it easy to write a custom parser. An alternative +`lxml` parser already comes with django-compress. + +CSS Compression +--------------- + +By default CSS is concatenated and paths to media are rewritten and fitted with +a cache busting timestamp. + +Django Compressor also comes with a built in support for CSS Tidy, +YUI CSS minification and even a filter to convert (some) images into `data:` +URIs. + +JS Compression +-------------- + +By default Javascript will be concatenated and minified using a port of +Douglas Crockford's jsmin. + +But there's also support for YUI compression and the Google's Closure Compiler. More ---- * More documentation about the usage and settings of django-compressor can be found - at `readthedocs.org/docs/django_compressor/en/latest`_. + on `readthedocs.org/docs/django_compressor/en/latest`_. * The source code for django-compressor can be found and contributed to on `github.com/jezdez/django_compressor`_. There you can also file tickets. +The `in-development version`_ of django-compressor can be installed with +``pip install django_compressor==dev`` or ``easy_install django_compressor==dev``. + .. _readthedocs.org/docs/django_compressor/en/latest: http://readthedocs.org/docs/django_compressor/en/latest .. _github.com/jezdez/django_compressor: http://github.com/jezdez/django_compressor .. _in-development version: http://github.com/jezdez/django_compressor/tarball/master#egg=django_compressor-dev From b7bc622c3545085730f1cda11bfcbfb979a8516c Mon Sep 17 00:00:00 2001 From: Jaap Roes Date: Sun, 17 Apr 2011 03:22:50 +0200 Subject: [PATCH 3/3] Tell even more, but in less words this time. --- README.rst | 66 +++++++++++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/README.rst b/README.rst index 2b50f33..a60c342 100644 --- a/README.rst +++ b/README.rst @@ -1,50 +1,50 @@ Django Compressor ================= -Django Compressor can concatenate and then compress linked and inline Javascript -& CSS into cached single static files. +Django Compressor can combine and compress linked and inline Javascript +or CSS found inside a Django template into cacheable static files. It does so +through use of a template tag called `compress`. -The compress template tag parses all the HTML in between `{% compress js/css %}` -and `{% endcompress %}` and looks for linked stylesheets or JS. It then -concatenates the files and inline styles/scripts and (optionally) compresses them -using one or more of the provided or your own custom filters. +HTML in between `{% compress js/css %}` and `{% endcompress %}` is parsed +and searched for CSS or JS. These styles and scripts are then processed and +concatenated. -The concatenation and compressing process can also be started using the -Django management command `manage.py compress`. +The default action for CSS is to rewrite paths to static files and fit them +with a cache busting timestamp. For Javascript it is to compress it using +`jsmin`. -HTML Parsing -------------- +As the final result the template tag outputs a `