Commit 8916ec1f by Andrew Nesbitt

Added syntax highlighting to readme

parent 7aa70541
...@@ -14,8 +14,10 @@ Find it on npm: <https://npmjs.org/package/node-sass> ...@@ -14,8 +14,10 @@ Find it on npm: <https://npmjs.org/package/node-sass>
## Usage ## Usage
var sass = require('node-sass'); ```javascript
sass.render(scss_content, callback [, options]); var sass = require('node-sass');
sass.render(scss_content, callback [, options]);
```
Especially, the options argument is optional. It support two attribute: `include_paths` and `output_style`, both of them are optional. Especially, the options argument is optional. It support two attribute: `include_paths` and `output_style`, both of them are optional.
...@@ -26,23 +28,27 @@ Especially, the options argument is optional. It support two attribute: `include ...@@ -26,23 +28,27 @@ Especially, the options argument is optional. It support two attribute: `include
Here is an example: Here is an example:
var sass = require('node-sass'); ```javascript
sass.render('body{background:blue; a{color:black;}}', function(err, css){ var sass = require('node-sass');
console.log(css) sass.render('body{background:blue; a{color:black;}}', function(err, css){
}/*, { include_paths: [ 'lib/', 'mod/' ], output_style: 'compressed' }*/); console.log(css)
}/*, { include_paths: [ 'lib/', 'mod/' ], output_style: 'compressed' }*/);
```
## Connect/Express middleware ## Connect/Express middleware
Recompile `.scss` files automatically for connect and express based http servers Recompile `.scss` files automatically for connect and express based http servers
var server = connect.createServer( ```javascript
sass.middleware({ var server = connect.createServer(
src: __dirname sass.middleware({
, dest: __dirname + '/public' src: __dirname
, debug: true , dest: __dirname + '/public'
}), , debug: true
connect.static(__dirname + '/public') }),
); connect.static(__dirname + '/public')
);
```
Heavily inspired by <https://github.com/LearnBoost/stylus> Heavily inspired by <https://github.com/LearnBoost/stylus>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment