webhelpers.pylonslib.minify

Minification helpers.

This module provides enhanced versions of the javascript_link and stylesheet_link helpers in webhelpers.html.tags. These versions add three additional arguments:

  • minified: If true, reduce the file size by squeezing out whitespace and other characters insignificant to the Javascript or CSS syntax.
  • combined: If true, concatenate the specified files into one file to reduce page load time.
  • beaker_kwargs (dict): arguments to pass to beaker_cache.

Dependencies: Pylons, Beaker, jsmin, and cssutils (all available in PyPI). If “jsmin” is not installed, the helper issues a warning and passes Javascript through unchanged. (Changed in WebHelpers 1.1: removed built-in “_jsmin” package due to licensing issues; details in webhelpers/pylonslib/_jsmin.py .)

PYRAMID USERS: this implementation is incompatible with Pyramid. No Pyramid-compatible implementation is currently known.

Contributed by Pedro Algarvio and Domen Kozar <ufs@ufsoft.org>. URL: http://docs.fubar.si/minwebhelpers/

Previous topic

webhelpers.pylonslib.grid

Next topic

webhelpers.pylonslib.secure_form