tgext.coffeescript is based on tgext.scss by Alessandro Molina and is under the same license (MIT).
tgext.coffeescript can be installed both from pypi or from bitbucket:
You will also need to install the CoffeeScript compiler, for instructions on this check their website.
Using tgext.coffeescript is really simple, you edit your config/middeware.py and just after the #Wrap your base TurboGears 2 application with custom middleware here comment wrap app with CoffeeScriptMiddleware:
from tgext.coffeescript import CoffeeScriptMiddleware make_base_app = base_config.setup_tg_wsgi_app(load_environment) def make_app(global_conf, full_stack=True, **app_conf): app = make_base_app(global_conf, full_stack=True, **app_conf) # Wrap your base TurboGears 2 application with custom middleware here app = CoffeeScriptMiddleware(app) return app
app = CoffeeScriptMiddleware(app, bare=False)
This will disable the bare options for all files served with tgext.coffeescript, more granular control of this option may be available later depending on the need for it.