Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Improve shipyard.registerExts to allow other templating engines #29

seanmonstar opened this Issue · 0 comments

1 participant

Sean McArthur
Sean McArthur

Shipyard currently cheats a little, so that 0.1 could get out the door. It should provide a system for applications to declare other templating languages to use if they so desire.

Example using Handlebars:

// myapp/lib/handlebars.js
var HB = module.exports = new Class({
    Extends: Template,
    compile: function compile() {
        return this.compiled = handlebars.compile(this.text);

require.extensions['.handlebars'] = function(module, filename) {
    var tpl = new HB(require._load(filename));
    module.exports = tpl.compile();

Then an application's package.json could declare them so Shipyard knows:

    "name": "myapp",
    "shipyard": {
        "templates": [ "./lib/handlebars" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.