I finally have time to play with it. Unfortunately I fail to make it work.
Let’s say I use your package as follows:
'xiphy:jade-coffee@0.1.1',
I get the following error:
error: No plugin known to handle file 'showWebsite/showWebsite.coffee.tpl.jade'. If you want this file to be a
static asset, use addAssets instead of addFiles; eg, api.addAssets('showWebsite/showWebsite.coffee.tpl.jade',
'client').
It seems I’ve got no package to handle Jade (even if yours is a fork of one). So I add some:
'xiphy:jade-coffee@0.1.1',
'dalgard:jade@0.5.0',
I don’t see the previous error anymore. But the following line:
p #{Websites.find({}).count()}
which is based on your example:
h1 Todo List (#{Tasks.find({checked: $ne: true}).count()})
Thanks for the testing!
I added some dependencies so that now I have a good build for Linux as well, I hope.
xiphy:jade-coffee@0.1.4 is the new package, which depends on xiphy:jade-compiler@0.5.1, but it’s incompatible with dalgard:jade and mquandalle:jade (I should probably mark this incompatibility somehow, but I’m new to Meteor packages).
Could you please try it?
Thanks! Yeah I will in few hours, as it’s an important evening here in Poland because of parliament elections.
Too bad it’s a fork of mquandelle:jade instead of dalgard:jade as the latter has few very good advantages over mquandelle’s version, especially the features that were introduced to Blaze with Meteor 1.2.
Yes, my testing environment is Meteor 1.2 on Linux.
The problem is that dalgard added other features as well, like bindings that make it harder to integrate generic coffeescript/javascript, as there are more conflicts between the syntaxes. Still, if there’s enough interest, I may port nice features in the future (and accept pull requests).
What is interesting is that this is a completely different direction from what dalgard is doing, I got rid of helpers and prefer global functions (that is similar to the early Meteor days).
I created some general form processing functions today:
@processForm = (event)->
r={}
event.preventDefault()
_.each event.target, (target)->
if target.name
r[target.name]=target.value
return r
@clearForm = (event)->
r={}
event.preventDefault()
_.each event.target, (target)->
if target.name
r[target.name]=target.value
target.value=''
return r
With the helper code I am able to simplify form creation to this
:
form.new-contract(
mt-submit="Tasks.insert clearForm(event)")
input(type="text" name="text"
placeholder="Type to add new tasks!")