Skip to content

Instantly share code, notes, and snippets.

@balupton
Last active December 15, 2015 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save balupton/5289056 to your computer and use it in GitHub Desktop.
Save balupton/5289056 to your computer and use it in GitHub Desktop.
Blog: Inline Pre-Processors

Inline Pre-Processors

How long until we can do this?

/* coffee
multiply = (x,y,next) -> next(null,x*y)
*/

multiply(2,5,function(err,result){
	if(err) throw err;
	alert(result);  // 10
});

Actually, turns out with DocPad and the DocPad Text Plugin you can:

<t render="js.coffee">
multiply = (x,y,next) -> next(null,x*y)
</t>

multiply(2,5,function(err,result){
	if(err) throw err;
	alert(result);  // 10
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment