Zeke takes the core CoffeeKup template engine and adds a plugin system using Broadway.
Using the plug-in system you can create plug-able modules to inject macros or dependencies into the CoffeeKup template engine.
Using the helpers
object you can add macro functions to the template language:
#plugin
plugin =
attach: (options) ->
@helpers['css'] = (content) ->
text "<style type='text/css'>#{content}</style>"
zeke = require 'zeke'
zeke.use plugin
zeke.init()
# markup
x = zeke.render ->
doctype 5
html ->
head ->
css '''
body: { color: green; }
'''
body ->
h1 'FooBar'
console.log x
You can also add node modules to the coffeeKup template engine for processing special markup functions. For example, check out https://github.com/twilson63/zeke-markdown
exports.attach = ->
@addModule 'markdown', 'github-flavored-markdown'
@helpers['markdown'] = (s) -> text data.markdown.parse(s)
Using the addModule
method, it requires a node module and assigns it to an attribute on the the data object. Then you can use the helpers
object to create
a public function that can be used to call the nodejs module.
Zeke is a fork from of CoffeeKup
It reduces the features to a base html template generator, with a broadway plug-in system.
There are already two plugins in development:
I <3 CoffeeKup
, its just CoffeeScript
, which is just Javascript
, etc. But Zeke adds some awesome broadway
plugin sugar to keep the core super simple and enables anyone to create plugin to optimize
the compiler, or add stylus
or anything you want, and everyone gets the best of both worlds. It is simple to add your own plug-in. Just see one of the examples above.
The goal of this project is to maintain a super simple core CoffeeKup
template engine and add a rich plugin system so it can work for everyone.
CoffeeKup is a markup dsl that was created by Maurice Machado and now is currently maintained by Kris Windham. It is a great markup and was inspired by _why
and created on _whyday
. You get find out more about the template language here: A Beginners Intro
npm install zeke
Adds a plugin to zeke
Inits zeke and confirms all plugins have been loaded
Compiles CoffeeKup
markup to a function.
Generates and returns html from CoffeeKup
npm test
MIT/X11.
everyone is welcome to contribute with patches, bugfixes and new features
- create an issue on github so the community can comment on your idea
- fork
zeke
in github - create a new branch
git checkout -b my_branch
- create tests for the changes you made
- make sure you pass both existing and newly inserted tests
- commit your changes
- push to your branch
git push origin my_branch
- create a pull request
- Nodejitsu - For Broadway!
- Kris Windham - For keeping CoffeeKup alive
- Maurice Machado - For creating CoffeeKup
- Mark Hahn - For putting together solid beginners documentation
- Open Source Community