vendor/docs/middleware.md in stylus-source-0.22.6 vs vendor/docs/middleware.md in stylus-source-0.23.0

- old
+ new

@@ -1,9 +1,9 @@ ## Connect Middleware - Stylus ships with Connect middleware for auto-compiling Stylus sheets when modified. + Stylus ships with Connect middleware for auto-compiling Stylus sheets whenever they're modified. ## stylus.middleware(options) Return Connect middleware with the given `options`. @@ -24,11 +24,11 @@ #### Examples Here we set up the custom compile function so that we may alter the renderer by providing additional settings. - By default the compile function simply sets the `filename` + By default, the compile function simply sets the `filename` and renders the CSS. function compile(str, path) { return stylus(str) .import(__dirname + '/css/mixins/blueprint') @@ -36,14 +36,14 @@ .set('filename', path) .set('warn', true) .set('compress', true); } - Pass the middleware to Connect, grabbing .styl files from this directory - and saving .css files to _./public_. Also supplying our custom `compile` function. + Pass the middleware to Connect, grabbing `.styl` files from this directory + and saving `.css` files to _./public_. Also supplying our custom `compile` function. - Following that we have a `staticProvider` layer setup to serve the .css + Following that, we have a `staticProvider` layer setup to serve the `.css` files generated by Stylus. var stylus = require('stylus'); var server = connect.createServer( @@ -53,15 +53,14 @@ , compile: compile }) , connect.staticProvider(__dirname + '/public') ); - When `force` is used, the styles will be unconditionally re-compiled, however - even without this option the Stylus middleware is smart enough to detect changes in `@import`ed files. + When `force` is used, the styles will unconditionally be re-compiled. But even without this option, the Stylus middleware is smart enough to detect changes in `@import`ed files. - For development purpose, you can enable the `firebug` option if you want to + For development purposes, you can enable the `firebug` option if you want to use the [FireStylus extension for Firebug](//github.com/LearnBoost/stylus/blob/master/docs/firebug.md) - and/or the `linenos` option to emit debug infos in the generated css. + and/or the `linenos` option to emit debug info in the generated CSS. function compile(str, path) { return stylus(str) .import(__dirname + '/css/mixins/blueprint') .import(__dirname + '/css/mixins/css3')