GithubHelp home page GithubHelp logo

coffeekup's People

Contributors

aeosynth avatar benekastah avatar brandonbloom avatar colinta avatar dvv avatar esamattis avatar mauricemach avatar mwl avatar rachel-carvalho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coffeekup's Issues

Parsing error

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>

__bind not generated in coffeescript

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();
})();

@body undefined in context

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

Compile on the fly

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

`hardcode` option masked in express adapter

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.

dynamic_locals not documented

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.

html5 input required syntax

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!

Support interpolated CoffeeKup

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.

CoffeeKup Syntax Highlighting

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

Nesting divs on occasion?

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>"

self closing / obsolete tags

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:

void (self closing)

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

obsolete

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

Extension mechanism

Provide a sort of plugin system so that people can develop extensions that can be distributed and consumed easily.

class / id shortcuts

Are you planning on adding hash (#) and dot (.) as id / class shortcuts? Although hash might not work since that's coffeescript's comment character.

noWrap

Please, replace 'noWrap' with wrap: false to obey the recent changes to coffeescript

layout.coffee?

Error: EBADF, Bad file descriptor '/Users/tyler/instantcoffee/views/layout.coffee'

why is it asking for layout.coffee?

caching.

looks like expressjs is caching incorrectly -- it won't re-render the page with new data.

Howto mix tags and text?

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

Beginner's Introduction To CoffeeKup

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.

Dynamic view helpers from express

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.

-> everywhere is ugly

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?

Helper bug: ck_repeat

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);
}; 

Allow parsing of XML files

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 '…'

Where are the docs?

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?

Word "input" prevents rendering.

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".

03d0155

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))

"coffeekup -w" quits on syntax error

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 :)

Streaming able ?

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?

JS error on coffeekup.org

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

Not working on 0.4.0

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.

cannot render layouts

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

precompilation to function: (locals) -> html

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?

How to do subroutines?

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?

the 'h' function

/&(?!\w+;)/g should be replaced with /&/g in the 'h' function.

the current implementation will lead to strange bugs and possibly fringe security issues.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.