socketstream / ss-jade

Jade (HTML) code wrapper for SocketStream 0.3
10 stars 2 forks source link

Allow compile options for ss-jade #4

Closed arxpoetica closed 9 years ago

arxpoetica commented 12 years ago

Not sure this is the best way to do it, but I often like to see "pretty html" when I'm doing development, and since I started a new project using Jade, I threw this together and included it in my project like such:

"ss-jade": "https://github.com/americanyak/ss-jade/tarball/master",

To add options to the compile settings in ss-jade, require the file first, call the "addCompileOptions" function, and then add the ssJade object to the SocketStream client formatters, like so:

var ssJade = require('ss-jade');
ssJade.addCompileOptions({ pretty: true });
ss.client.formatters.add(ssJade);

You might want to pull this into ss-jade a different way, but I needed to be able to add to the options, and this was my method. :)

arxpoetica commented 12 years ago

Note to self, to check: ss.client.formatters.add(ssJade, {prettyHTML: true});

arxpoetica commented 12 years ago

Hey Owen, I can confirm that ss.client.formatters.add(ssJade, { prettyHTML: true }); is not working (I actually think it's supposed to be ss.client.formatters.add(ssJade, { pretty: true });, but I've tried both, and they both don't work.) I'm continuing in dev with my patch, but giving this a bump to look at when you have a chance.)

helozjisky commented 11 years ago

Another way to pass variables(https://github.com/socketstream/ss-jade) ss.client.formatters.add(require('ss-jade'), {locals: {countries: {}}});

hope ss.serveCleint('', counties)

paulbjensen commented 10 years ago

Hi,

I'll take a look into this tonight.

Regards,

Paul Jensen

arxpoetica commented 9 years ago

This PR is no longer my favored approach. I have created a new pull request w/ Jade API options. See https://github.com/socketstream/ss-jade/pull/9