Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install collective.recipe.minify

How to install collective.recipe.minify

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install collective.recipe.minify
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.0 Available View build log
Windows (64-bit)
1.0 Available View build log
Mac OS X (10.5+)
1.0 Available View build log
Linux (32-bit)
1.0 Available View build log
Linux (64-bit)
1.0 Available View build log
 
Author
License
ZPL
Lastest release
version 1.0 on Jan 5th, 2011

Detailed Documentation

Supported options

The recipe supports the following options:

css-command The script to be used for css minification. The YUI compressor is a good choice here. This option is not required. If it is omitted, a very simple whitespace stripping is done [' '.join(RESOURCE.split())]. The command must write its result to the standard output.

js-command Same as css-command but used for JavaScript resources.

ignore A list of fnmatch-patters. If a filename matches one of these expressions, it is omitted from the minifying process.

paths A list of paths, which contains JavaScript and CSS resources. All files ending with '.js' and '.css' are considered, except those which are ignored explicitly (see ignore option).

suffix Filename suffix that is used for the copy of the original file. The default is -full. If the orignal filename is style.css the minified version will be style.css and the original development version will be style-full.css.

include-devel Include all packages listed in the devel-section of the buildout. This option is turned OFF per default.

verbose Set verbosity for minify runs. The allowed values are true and false and the default is false.

Example usage

A simple buildout that uses the recipe looks like this:

>>> write('buildout.cfg',

System Message: ERROR/3 (<string>, line 56)

Inconsistent literal block quoting.

... """ ... [buildout] ... parts = minify ... ... [minify] ... recipe = collective.recipe.minify ... paths = ... ${buildout:directory}/src/foo ... ignore = ... firm* ... include-devel = false ... """)

Running the buildout gives us:

>>> print system(buildout)

System Message: ERROR/3 (<string>, line 72)

Inconsistent literal block quoting.

Installing minify. Generated script '/sample-buildout/bin/minify'. <BLANKLINE>

Running this script minifies all JavaScript and CSS resources found in the specfied locations. It walks all the paths specified ignoring all files matching one of the patterns specified in ignore.

Contributors

Tom Gross, Author

Change history

1.0 (2010-01-05)
  • initial release

System Message: WARNING/2 (<string>, line 93)

Bullet list ends without a blank line; unexpected unindent.

[Tom Gross]

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.