Skip to content

Instantly share code, notes, and snippets.

@rikyperdana
Last active January 10, 2017 11:54
Show Gist options
  • Save rikyperdana/391bb7a0b458b4cb61de7ca9f22fa652 to your computer and use it in GitHub Desktop.
Save rikyperdana/391bb7a0b458b4cb61de7ca9f22fa652 to your computer and use it in GitHub Desktop.
Kitchen Plugin Template
# Any plugin we create has to be in it's own folder ~/.meteor-kitcen/plugins/plugin_name
# And has to contain plugin.js and plugin.json
# Content of plugin.js
var kitchen = require('meteor-kitchen');
var component = kitchen.getInput();
var prop1 = component.properties.prop1;
var prop2 = component.properties.prop2;
if (prop1 === undefined) {var prop1 = value1;}
if (prop2 === undefined) {var prop2 = value2;}
component.html = '';
component.html += '<template name="TEMPLATE_NAME">';
component.html += 'put your content' + prop1 + prop2;
component.html += '</template>';
component.js = '';
component.js += 'add your coding' + prop1 + prop2;
component.js += 'Template.TEMPLATE_NAME.rendered = function() {}';
component.js += 'Template.TEMPLATE_NAME.helpers({});';
component.js += 'Template.TEMPLATE_NAME.events({});'
kitchen.setOutput(component);
# Content of plugin.json
{
"packages" : {
"meteor": ["reactive-dict"],
"mrt": []
}
}
# Then write you recipe like this
components:
- name: any_name
type: plugin_name
properties:
prop1: value1
prop2: value2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment