From 541899b7788f631f3ca71a5153ff6333ce220b76 Mon Sep 17 00:00:00 2001 From: Trevor Burnham Date: Sun, 4 Sep 2011 21:14:05 -0400 Subject: [PATCH] Updating README to describe new Sprockets-like functionality --- README.mdown | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/README.mdown b/README.mdown index 8e3f16c..8421ab2 100644 --- a/README.mdown +++ b/README.mdown @@ -34,7 +34,7 @@ Then add this line to your app's configuration: Create an `assets` directory in your project and throw all your `.coffee` and `.styl` files in there. Bam! Files get served like so: `assets/js/script.coffee` is compiled and served when you go to `http://yourapp/js/script.js`; `assets/css/style.styl` is compiled and served at `http://yourapp/css/style.css`. -### Succinct markup functions +### Markup functions connect-assets provides a couple of helper functions for use in your markup. In a [Jade template](http://jade-lang.com/), for instance, you might write @@ -46,13 +46,22 @@ But with connect-assets, you can just write != css('normalize') != js('jquery') -(where `!= is Jade's syntax for running JS and putting its output directly in the markup). These functions don't do anything special; they just emit the strings +(where `!= is Jade's syntax for running JS and putting its output directly in the markup). The `css` function just emits a string like -and +The `js` function, on the other hand, is more powerful... - +### Sprockets-style concatenation + +You can indicate dependencies in your CoffeeScript files using the Sprockets-style syntax + + #= require dependency + +(or `//= require dependency` in JavaScript). When you do so, and point the `js` function at that file, two things can happen: + +1. By default, you'll get multiple `