Commit 34194da4 by Andrew Nesbitt

It works!

parent e36a80f3
...@@ -6,13 +6,12 @@ using namespace v8; ...@@ -6,13 +6,12 @@ using namespace v8;
Handle<Value> Render(const Arguments& args) { Handle<Value> Render(const Arguments& args) {
HandleScope scope; HandleScope scope;
struct sass_context* ctx = sass_new_context(); struct sass_context* ctx = sass_new_context();
String::AsciiValue astr(args[0]); String::AsciiValue astr(args[0]);
char * cs = *astr; char * cs = *astr;
ctx->input_string = cs; ctx->input_string = cs;
ctx->options.include_paths = 0;
ctx->options.output_style = SASS_STYLE_NESTED; ctx->options.output_style = SASS_STYLE_NESTED;
sass_compile(ctx); sass_compile(ctx);
...@@ -24,4 +23,4 @@ void RegisterModule(v8::Handle<v8::Object> target) { ...@@ -24,4 +23,4 @@ void RegisterModule(v8::Handle<v8::Object> target) {
NODE_SET_METHOD(target, "render", Render); NODE_SET_METHOD(target, "render", Render);
} }
NODE_MODULE(binding, RegisterModule); NODE_MODULE(binding, RegisterModule);
\ No newline at end of file
...@@ -11,7 +11,7 @@ CPP_FILES = \ ...@@ -11,7 +11,7 @@ CPP_FILES = \
prelexer.cpp prelexer.cpp
libsass: libsass_objs libsass: libsass_objs
ar rvs libsass.a \ ar rs libsass.a \
sass_interface.o \ sass_interface.o \
context.o \ context.o \
functions.o \ functions.o \
......
var sass = require('./sass') var sass = require('./sass');
sass.render('something') console.log(sass.render('#navbar {\
\ No newline at end of file width: 80%;\
height: 23px; }\
#navbar ul {\
list-style-type: none; }\
#navbar li {\
float: left;\
a {\
font-weight: bold; }}'))
\ No newline at end of file
...@@ -12,9 +12,12 @@ def set_options(opt): ...@@ -12,9 +12,12 @@ def set_options(opt):
def configure(conf): def configure(conf):
conf.check_tool("compiler_cxx") conf.check_tool("compiler_cxx")
conf.check_tool("node_addon") conf.check_tool("node_addon")
conf.check(staticlib='sass', uselib_store='LIB_SASS', cpppath='./libsass/')
def build(bld): def build(bld):
obj = bld.new_task_gen("cxx", "shlib", "node_addon") obj = bld.new_task_gen("cxx", "shlib", "node_addon")
obj.uselib = "sass" obj.uselib = "sass"
obj.target = "binding" obj.target = "binding"
obj.source = "binding.cpp " obj.source = "binding.cpp "
obj.use = ['LIB_SASS']
obj.add_obj_file("./libsass/libsass.a")
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