Commit c25b1b5d by Gong Hao

update README file

parent 891e8e8e
......@@ -13,9 +13,21 @@ Find it on npm: <http://search.npmjs.org/#/node-sass>
## Usage
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.
`include_paths` is an `Array`, you can add a sass import path.
`output_style` is a `String`, its value should be one of `'nested', 'expanded', 'compact', 'compressed'`.
[Important: currently the argument `output_style` has some problem which may cause the output css becomes nothing because of the libsass, so you should not use it now!]
Here is an example:
var sass = require('node-sass');
sass.render('body{background:blue; a{color:black;}}', function(err, css){
console.log(css)
});
}/*, { include_paths: [ 'lib/', 'mod/' ], output_style: 'compressed' }*/);
## Connect/Express middleware
......
......@@ -54,8 +54,8 @@ Handle<Value> Render(const Arguments& args) {
strcpy(ctx->source_string, *astr);
ctx->options.include_paths = new char[strlen(*bstr)+1];
strcpy(ctx->options.include_paths, *bstr);
// ctx->options.output_style = args[3]->Int32Value();
ctx->options.output_style = SASS_STYLE_NESTED;
// ctx->options.output_style = SASS_STYLE_NESTED;
ctx->options.output_style = args[3]->Int32Value();
ctx->callback = Persistent<Function>::New(callback);
ctx->request.data = ctx;
......
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