jinja2modern

0.2.0 BSD License    
  UNRATED

  102 downloads

Jinja2 tags for modern web

description

download

specs

jinja2modern is a project that provides tags for Jinja2, including scss, sass, less, uglify and coffee.

Instalation

pip install jinja2modern

Usage

In your project directory create settings.py, guess you already have it, with settings:

Basic settings:

#home path
JINJA2MODERN_HOME = os.path.realpath(os.path.dirname(__file__))
#engines path, will describe this later
JINJA2MODERN_ENGINES = os.path.join(HOME, 'engines')
#media path relative to home directory
JINJA2MODERN_MEDIA_PATH = 'media'
#media url
JINJA2MODERN_MEDIA_URL = '/media'


Engines

There are several preprocessor engine directories that you will need in your project. Here is how you can get them:

git clone https://github.com/jashkenas/coffee-script.git coffee
git clone https://github.com/mishoo/UglifyJS uglify
git clone https://github.com/cloudhead/less.js less
git clone https://github.com/nex3/sass

Templates

You always can overide basic templates by placing it in tags subdirectory in your jinja2 environment template directory

js.html:

< script src="{{ file_link }}" >< /script >

css.html:

< link rel="stylesheet" type="text/css" href="{{ file_link }}" / >
read more   
Last updated on September 12th, 2012

#Jinja2 tags #modern tags #modern web #Python #Jinja2 #tags #scss

0 User reviews so far.

SUBMIT