mauricemach / coffeekup Goto Github PK
View Code? Open in Web Editor NEWMarkup as CoffeeScript.
Home Page: coffeekup.org
License: MIT License
Markup as CoffeeScript.
Home Page: coffeekup.org
License: MIT License
The reference to coffeekup.js, in the "/examples/browser/creme" folder, points back to /lib, and the file does not exist there.
I have pulled the latest JS from the repo history (https://github.com/mauricemach/coffeekup/blob/c514d9b26bdc6e44709f624df00aff2275e60882/lib/coffeekup.js) and will try to use that, but just wanted to give a heads up that the ref is gone.
How do I include partials within coffeekup views?
h2 ->
h3 -> 'foo'
'bar'
correctly gives:
<h2>
<h3>
foo
</h3>
bar
</h2>
but when the text is placed first:
h2 ->
'bar'
h3 -> 'foo'
it does not appear in the output:
<h2>
<h3>
foo
</h3>
</h2>
If I create a file, templates.coffee, that contains this gist: https://gist.github.com/743651 and I compile it using
coffeekup templates.coffee
then I get a file, templates.html that contains a single space chacter. My understanding is that I could compile to JS and get a templates.js file out. Is this incorrect?
In my coffeescript code, within my coffeekup template, => does not generate the __bind function within the script tag.
For example:
coffeescript ->
foo = ->
bar = 1
baz = =>
console.log bar
foo().baz()
Exception thrown is Uncaught ReferenceError: __bind is not defined
The output is
;(function () {
var foo;
foo = function() {
var bar, baz;
bar = 1;
return baz = __bind(function() {
return console.log(bar);
}, this);
};
return foo().baz();
})();
Hi,
first of all, thanks for coffeekup!
I created a small express project with coffeekup templates. It works fine, except that @Body is always undefined in the layout.coffee context.
I'm using express 1.0.7, coffeescript 1.0.1 and coffeekup 0.2.2
Hi,
Do you think it is possible to have coffekup compile automatically like coffee -cw ?
I also would like to know if it is possible in this way to render template in a template ?
e.g :
html ->
head ->
@render 'mytemplate.coffee'
Many thanks for coffeekup
Samuel
The code to allow partial 'view'
instead of requiring text @partial 'view'
overwrites the options.hardcode
hash, so if you have other helpers that you want to pass in from express/zappa then you can't.
Patch coming.
I think I had to use dynamic_locals to get locals to work correctly with recursion. Does this ring a bell?
Anyways, I found a nifty option parameter that did the trick, so I figured this would be nice in the docs.
I'm compiling coffee on the server side (@1.0.0) and running CK on the client.
Hey guys
this might be an issue with me not knowing coffeescript syntax properly yet (or coffeekup), but here's my question:
I'm playing with html5 forms (http://diveintohtml5.org/forms.html), and want to play with features like "required" in
input id: 'q' #works fine
but how do I add a value-less parameter like "required"?
I've tried:
input id: 'q', required: '' # <- with an empty string
But coffeekup ignores the required parameter
Thanks for the help & coffeekup, coffeescript, mongoose, express, node are all blowing my mind!
h2 -> "Spinning the #{span -> 'Real-time'} Web"
currently compiles to
<h2><span>Real-time</span>Spinning the null Web</h2>
It would be nice to support this as I often find myself wanting to "span" things up within long paragraphs without breaking it up too much.
The site http://coffeekup.org/ doesn't work on opera 10.53. Wonder if this will work on this browser at all....
I don't see any coffeekup specific syntax highlighters for any editor. Are their any available? Sorry if this is wrong place to post this, didn't see anywhere else more appropriate.
Thanks
I couldn't figure out an elegant way to pull this off. Is there a better way?
My goal is to create rows. I'm doing this within a larger for loop, looping over an array of objects.
for item in items
i++
if i is 1
text "<div class='row'>"
div ".item #{sizeClass}" + (if i % itemsPerRow is 0 then ".last" else ""), ->
a href:"#", class: "bigButton", -> item.name
if i % itemsPerRow is 0
text "</div><div class='row'>"
else if items.length is i
text "</div>"
hello, I'm playing around with a ck rewrite, and I wanted to get everything correct this time so I went looking at the official sources. my results:
area base br col command embed hr img input keygen link meta param source track wbr
complete set of elements, minus self closing
a abbr address article aside audio b bdi bdo blockquote body button canvas caption cite code colgroup datalist dd del details dfn div dl dt em fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header hgroup html i iframe ins kbd label legend li map mark menu meter nav noscript object ol optgroup option output p pre progress q rp rt ruby s samp script section select small span strong style sub summary sup table tbody td textarea tfoot th thead time title tr u ul var video
applet acronym bgsound dir frame frameset noframes isindex listing nextid noembed plaintext rb strike xmp basefont big blink center font marquee multicol nobr spacer tt
Provide a sort of plugin system so that people can develop extensions that can be distributed and consumed easily.
Are you planning on adding hash (#) and dot (.) as id / class shortcuts? Although hash might not work since that's coffeescript's comment character.
Please, replace 'noWrap' with wrap: false to obey the recent changes to coffeescript
Error: EBADF, Bad file descriptor '/Users/tyler/instantcoffee/views/layout.coffee'
why is it asking for layout.coffee?
looks like expressjs is caching incorrectly -- it won't re-render the page with new data.
Hi,
If i write
p ->
"You can redistribute it and/or modify it under the terms of the "
a href: "http://www.gnu.org/licenses/agpl-3.0.html", rel: "license", -> "GNU Affero General Public License"
"."
I get
<p><a href="http://www.gnu.org/licenses/agpl-3.0.html" rel="license">GNU Affero General Public License</a>.</p>
As you can see, the first string gets lost somewhere. As inline links are a quite common thing, i wonder if there is a way to do this in coffescript?
thanks
I bitched in an earlier thread that I couldn't find any docs to learn CoffeeKup. I offered to write some docs if anyone helped. Well I've decided to go ahead and write something and hope some of you help as I go along.
I've finished the first section. Please check it out at https://github.com/mark-hahn/coffeekup-intro. I am writing this as I figure out CoffeeKup so what you see is what I've learned so far. I will announce here when each section is finished unless someone objects. I will probably have a new section every couple of days
Please post your comments as issues on that project or as replies here and I will copy the reply comment over. Please be brutal in your comments. If you think it is boring, wrong, etc. just say so. Compliments will also be accepted.
there's any way that use Express's helpers int coffekup?
Because of the eval-ing going on, I don't think dynamic view helpers can access stuff they'd normally be able to access, preventing me from using the default CSRF express tools w/ Coffeekup.
I'm going to probably write my own middleware as a result.
don't you think so? can't we a) use indentation and b) use some other symbol when we can't get by with indentation alone?
How should I write coffeekup scripts to render unusual html entities, such as the Facebook Connect button?
fb:login-button/fb:login-button
Check helper in IE. As far as I can remember Array(count).join(string)
different in different browsers:
ck_repeat = function(string, count) { return Array(count + 1).join(string); };
It would be cool to use Coffeekup also for XML files (e.g. RSS or ATOM).
Because of the tag checking, this currently does not work:
doctype 'xml'
rss(version: '2.0') ->
channel ->
title 'Title'
link 'URL'
description '…'
item ->
title '…'
link '…'
CK looks nice. I'd really like to try it but I can't find docs anywhere. My google searches reached some discussion that mentions the docs.
Some help?
Running coffeekup -w temp.coffee
doesn't compile the template right away, it only gets compiled after a change is made.
If the word "input" is used anywhere in a template, rendering any passed variables (local or context) fail.
I believe this stems from this commit, where you changed the word "data" to "input".
previously:
So I have a var called @person with a bunch of details, like "firstname" for instance.
If I use this code:
p @person.firstname
The text correctly outputs the firstname. If I add a form in, like this:
p @person.firstname
form name: "input"
then I get an error:
TypeError: Cannot read property 'firstname' of undefined
at Function. (eval at (/home/hosting/checkoutly/code/node_modules/coffeekup/lib/coffeekup.js:303:12))
at Object.anonymous (eval at (/home/hosting/checkoutly/code/node_modules/coffeekup/lib/coffeekup.js:303:12))
Hi, I think CoffeeKup would make a nice addition to middlemanapp.com
I asked @middlemanapp and he said they support all languages supported by Tilt:
https://github.com/rtomayko/tilt
this invocation should report the error and then go back into the watching state instead of bailing out completely. Some of us make syntax errors occasionally :)
Correct me if I'm wrong.
As far as I can tell CoffeeKup will never be able to stream the template results because to be able to return the results the top level function must return, and that happens only when all the template finished computing.
Is there anything that can be done to enable streaming support? Will CoffeeKup ever be able to stream results?
Uncaught Error: When creating object "editor", there is no factory called "text_editor" available."
BespinEmbedded.js:7875
UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.28 Safari/534.10
Hope that helps
The code below only produces the second HR element.
hr
hr width:'100%'
Tried on fresh ubuntu 10.10 using node.js 0.4.0, installed with npm.
Running $coffeekup fails with this:
Error: Cannot find module 'coffeekup'
at Function._resolveFilename (module.js:289:11)
at Function._load (module.js:241:25)
at require (module.js:317:19)
at Object. (/usr/local/lib/node/.npm/coffeekup/0.2.2/package/bin/coffeekup.coffee:3:15)
at Object. (/usr/local/lib/node/.npm/coffeekup/0.2.2/package/bin/coffeekup.coffee:76:4)
at Module._compile (module.js:373:26)
at Object.run (/usr/local/lib/node/.npm/coffee-script/1.0.1/package/lib/coffee-script.js:55:19)
at /usr/local/lib/node/.npm/coffee-script/1.0.1/package/lib/command.js:115:29
at /usr/local/lib/node/.npm/coffee-script/1.0.1/package/lib/command.js:85:26
at [object Object]. (fs.js:86:5)
Trying to require it as module gives similar output.
I cannot get layouts to render. It finds the views/layout.coffee file, but errors with:
TypeError: string is not a function
at String.CALL_NON_FUNCTION (native)
at Object.anonymous (eval at (/usr/local/lib/node/.npm/coffeekup/0.1.7/package/lib/coffeekup.js:139:25))
at Object.render (/usr/local/lib/node/.npm/coffeekup/0.1.7/package/lib/coffeekup.js:144:21)
at ServerResponse.render (/usr/local/lib/node/.npm/express/1.0.0rc4/package/lib/express/view.js:293:26)
at ServerResponse.render (/usr/local/lib/node/.npm/express/1.0.0rc4/package/lib/express/view.js:303:14)
at Object. (server.coffee (compiled):33:16)
at pass (/usr/local/lib/node/.npm/connect/0.2.7/package/lib/connect/middleware/router.js:72:27)
at Object.router as handle
at next (/usr/local/lib/node/.npm/connect/0.2.7/package/lib/connect/index.js:264:23)
at /usr/local/lib/node/.npm/connect/0.2.7/package/lib/connect/middleware/session.js:140:15
Works fine when changing process.argv to process.argv.slice 2 in coffeekup.coffee on line 39.
Hi! Good work. I like this philosophy.
I would like to use Coffeekup on clientside with Sammy framework, but precompiling coffekup templates on server to pure functions like in haml-js:
Haml(haml) -> template(locals) -> html.
Is it possible?
The ace editors at coffeekup.org are not being rendered in Opera 11.50 (OS X), but http://ajaxorg.github.com/ace/ is.
What's the difference between the two save that context vars are referenced by @'s ?
I want to do something like this ...
labelAndInput = (lbl) ->
div lbl
input type:text
template = ->
div ->
labelAndInput "hello"
labelAndInput "world"
Everything I try is failing because of the lack of closure. Maybe I've just gotten so used to closures I've forgotten how to program without them. How do others accomplish this?
Hi there,
Can a template be named and used inside another template as a tag?
Thanks.
/&(?!\w+;)/g should be replaced with /&/g in the 'h' function.
the current implementation will lead to strange bugs and possibly fringe security issues.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.