Comparing version 0.1.15 to 0.1.17
58
index.js
'use strict'; | ||
var binding, SASS_OUTPUT_STYLE, path; | ||
var binding, SASS_OUTPUT_STYLE, SASS_SOURCE_COMMENTS, path; | ||
@@ -20,23 +20,15 @@ path = require('path'); | ||
function prepareOptions( options ) { | ||
var paths, style, comments; | ||
SASS_SOURCE_COMMENTS = { | ||
none: 0, | ||
normal: 1, | ||
'default': 1, | ||
map: 2 | ||
}; | ||
options = typeof options !== 'object' ? {} : options; | ||
paths = options.include_paths || options.includePaths || []; | ||
style = SASS_OUTPUT_STYLE[options.output_style || options.outputStyle] || 0; | ||
return { | ||
paths: paths, | ||
style: style | ||
}; | ||
}; | ||
function prepareOptions( options ) { | ||
var paths, style, sourceComments; | ||
var sass2scss = exports.sass2scss = function( input ) { | ||
return binding.sass2scss( input ); | ||
}; | ||
options = options || {}; | ||
// 暂只支持options.data用法,因为fis中只会这么用。 | ||
exports.renderSync = function( options ) { | ||
var newOptions; | ||
if ( options.file ) { | ||
@@ -46,10 +38,32 @@ throw new Error('options.file is not supported!'); | ||
newOptions = prepareOptions( options ); | ||
sourceComments = options.source_comments || options.sourceComments; | ||
if (options.sourceMap && !sourceComments) { | ||
sourceComments = 'map'; | ||
} | ||
paths = options.include_paths || options.includePaths || []; | ||
if ( options.sass2scss ) { | ||
options.data = sass2scss( options.data ); | ||
if (options.sassSyntax) { | ||
options.data = sass2scss(options.data); | ||
} | ||
return binding.renderSync(options.data, newOptions.paths.join( path.delimiter ), newOptions.style ); | ||
return { | ||
data: options.data, | ||
paths: paths.join(path.delimiter), | ||
imagePath: options.image_path || options.imagePath || '', | ||
style: SASS_OUTPUT_STYLE[options.output_style || options.outputStyle] || 0, | ||
comments: SASS_SOURCE_COMMENTS[sourceComments] || 0, | ||
precision: parseInt(options.precision) || 5 | ||
}; | ||
}; | ||
var sass2scss = exports.sass2scss = function(input) { | ||
return binding.sass2scss(input); | ||
} | ||
// 暂只支持options.data用法,因为fis中只会这么用。 | ||
exports.renderSync = function( options ) { | ||
return binding.renderSync(prepareOptions(options)); | ||
} | ||
Libsass | ||
======= | ||
by Aaron Leung and Hampton Catlin (@hcatlin) | ||
by Aaron Leung ([@akhleung]) and Hampton Catlin ([@hcatlin]) | ||
[![Build Status](https://travis-ci.org/hcatlin/libsass.png?branch=master)](https://travis-ci.org/hcatlin/libsass) | ||
http://github.com/hcatlin/libsass | ||
http://github.com/sass/libsass | ||
Libsass is just a library, but if you want to RUN libsass, | ||
then go to http://github.com/hcatlin/sassc or | ||
http://github.com/hcatlin/sassruby or find your local | ||
implementer. | ||
http://github.com/hcatlin/sassruby or | ||
[find your local implementer](https://github.com/hcatlin/libsass/wiki/Implementations). | ||
@@ -25,6 +25,6 @@ About | ||
As you may have noticed, the libsass repo itself has | ||
As you may have noticed, the libsass repo itself has | ||
no executables and no tests. Oh noes! How can you develop??? | ||
Well, luckily, SassC is the official binary wrapper for | ||
Well, luckily, SassC is the official binary wrapper for | ||
libsass and is *always* kept in sync. SassC uses a git submodule | ||
@@ -42,12 +42,4 @@ to include libsass. When developing libsass, its best to actually | ||
To run tests against libsass while developing, please ensure you have the latest version of the above projects cloned, and then define the following environment variables: | ||
export SASS_SPEC_PATH=~/path/sass-spec | ||
export SASS_SASSC_PATH=~/path/sassc | ||
export SASS_LIBSASS_PATH=~/path/libsass | ||
To run tests against libsass while developing, you can run `./script/spec`. This will clone SassC and Sass-Spec under the project folder and then run the Sass-Spec test suite. You may want to update the clones to ensure you have the latest version. | ||
Obviously, update them to your local environment. Then, its just a matter of running... | ||
make test | ||
Usage | ||
@@ -61,8 +53,10 @@ ----- | ||
First, you create a sass context struct. We use these objects to define | ||
different execution parameters for the library. There are three | ||
different context types. | ||
different execution parameters for the library. There are three | ||
different context types. | ||
sass_context // string-in-string-out compilation | ||
sass_file_context // file-based compilation | ||
sass_folder_context // full-folder multi-file | ||
```c | ||
sass_context(); // string-in-string-out compilation | ||
sass_file_context(); // file-based compilation | ||
sass_folder_context(); // full-folder multi-file | ||
``` | ||
@@ -74,3 +68,3 @@ Each of the contexts have slightly different behavior and are | ||
AND "input_file"... what do we do? This would introduce bugs into | ||
wrapper libraries that would be difficult to debug. | ||
wrapper libraries that would be difficult to debug. | ||
@@ -84,7 +78,9 @@ We anticipate that most adapters in most languages will define | ||
sass_new_context() | ||
sass_new_file_context() | ||
sass_new_folder_context() | ||
```c | ||
sass_new_context(); | ||
sass_new_file_context(); | ||
sass_new_folder_context(); | ||
``` | ||
Again, please see the sass_interface.h for more information. | ||
Again, please see the [sass_interface.h] for more information. | ||
@@ -97,10 +93,10 @@ And, to get even more information, then please see the implementations | ||
Sass is a CSS pre-processor language to add on exciting, new, | ||
Sass is a CSS pre-processor language to add on exciting, new, | ||
awesome features to CSS. Sass was the first language of its kind | ||
and by far the most mature and up to date codebase. | ||
Sass was originally created by the co-creator of this library, | ||
Hampton Catlin (@hcatlin). The extension and continuing evolution | ||
Sass was originally created by the co-creator of this library, | ||
Hampton Catlin ([@hcatlin]). The extension and continuing evolution | ||
of the language has all been the result of years of work by Nathan | ||
Weizenbaum (@nex3) and Chris Eppstein (@chriseppstein). | ||
Weizenbaum ([@nex3]) and Chris Eppstein ([@chriseppstein]). | ||
@@ -113,8 +109,13 @@ For more information about Sass itself, please visit http://sass-lang.com | ||
Any contribution to the project are seen as copyright assigned to Hampton Catlin, a | ||
human on the planet earth. Your contribution warrants that you have the right to | ||
human on the planet earth. Your contribution warrants that you have the right to | ||
assign copyright on your work. The intention here is to ensure that the project | ||
remains totally free (liberal, like). | ||
remains totally free (liberal, like). | ||
Our MIT license is designed to be as simple, and liberal as possible. | ||
[@hcatlin]: http://github.com/hcatlin | ||
[@akhleung]: http://github.com/akhleung | ||
[@chriseppstein]: http://github.com/chriseppstein | ||
[@nex3]: http://github.com/nex3 | ||
[sass_interface.h]: sass_interface.h |
{ | ||
"name": "fis-sass", | ||
"version": "0.1.15", | ||
"version": "0.1.17", | ||
"description": "Anothor libsass wrapper for node. Support sass syntax.", | ||
@@ -20,3 +20,3 @@ "main": "index.js", | ||
"author": "2betop", | ||
"license": "ISC", | ||
"license": "MIT", | ||
"gypfile": true, | ||
@@ -28,5 +28,6 @@ "bugs": { | ||
"dependencies": { | ||
"step": "0.0.5" | ||
"step": "0.0.5", | ||
"nan": "~1.2.0" | ||
}, | ||
"bindingsCDN": "http://git.oschina.net/2betop/static/raw/master/fis-sass/bindings/" | ||
"bindingsCDN": "http://fisstatic.duapp.com/addons/fis-sass/0.1.17/" | ||
} |
@@ -17,3 +17,3 @@ // simple test | ||
expect = fs.readFileSync('expect.css', 'utf-8'); | ||
if ( sass.renderSync({ data: source, sass2scss: true }) === expect ) { | ||
if ( sass.renderSync({ data: source, sassSyntax: true }) === expect ) { | ||
console.log( 'Sass syntax supported.'); | ||
@@ -20,0 +20,0 @@ } else { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
542845
119
314
2
+ Addednan@~1.2.0
+ Addednan@1.2.0(transitive)