https://github.com/aeosynth/ck
a smaller, faster coffeekup
https://github.com/aeosynth/ck
Last synced: 12 months ago
JSON representation
a smaller, faster coffeekup
- Host: GitHub
- URL: https://github.com/aeosynth/ck
- Owner: aeosynth
- License: mit
- Created: 2011-02-06T09:12:56.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2012-12-21T03:02:06.000Z (over 13 years ago)
- Last Synced: 2025-04-13T15:45:41.865Z (over 1 year ago)
- Language: CoffeeScript
- Homepage:
- Size: 135 KB
- Stars: 25
- Watchers: 3
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
a smaller, faster [coffeekup](https://github.com/mauricemach/coffeekup)
$ cake bench
ck: 268ms
ck (format): 316ms
coffeekup: 301ms
coffeekup (format): 974ms
#subtractions
* no cache; manage it on your own.
* must compile templates before rendering them
* no support for browsers, frameworks
* no cli tools
* no `scope` option (use context instead)
#additions
compileFile:
template = ck.compileFile './template.coffee'
html = template context: user: {}
console.log html
correctly handle booleans:
template = -> input autocomplete: off
console.log ck.compile(template)() #
console.log coffeekup.render template #
IE conditionals:
ie 'lt IE8', ->
link href: 'ie.css', rel: 'stylesheet'
#other
ck doesn't add slashes to self closing tags. I'm not actually sure what's right, see [this](http://stackoverflow.com/questions/348736/xhtml-is-writing-self-closing-tags-for-elements-not-traditionally-empty-bad-pra) for some reading....
recently another attempt was made at minimizing the coffeecup engine called [coffee-templates](https://github.com/mikesmullin/coffee-templates). it was inspired by and uses some of the same techniques as ck, so may be worth a look, as well.