steal.generate(path, where, data) -> undefined
{String}
the folder to get templates from
{String}
where to put the results of the rendered templates
{Object}
data to render the templates with. If force is true, it will overwrite everything
{undefined}
The Generate plugin makes building code generators crazy easy. StealJS comes with its own app generator. JavaScriptMVC has more complex generators.
Steal Generators
app- creates an application structure, build and clean scripts.JavaScriptMVC Generators- path/to/app
- The lowercase path you want your application in. Keep application names short because they
are used as namespaces. The last part of the path will be taken to be your application's name.
- App.Controllers.Name
- The namespaced name of your controller. For example, if your controller is named
- App.Models.Name
- The namespaced name of your model. For example, if your model is named
- path/to/app
- The path to your apps folder.
- path/to/page.html
- The path to the page you want to create.
- path/to/plugin
- The path to where you want your plugin. This also should be the namespace and name of
whatever JavaScript object created. Check out mxui for examples.
- App.Models.ModelName
- The model resource you want to add CRUD functionality to.
app- creates a JavaScriptMVC application structure.controller- creates a JavaScriptMVC jQuery.Controller.Cookbook.Controllers.Recipe, the generator will createcookbook/controllers/recipe_controller.js.model- creates a JavaScriptMVC jQuery.Model.Cookbook.Models.Recipe, the generator will createcookbook/models/recipe.js.page- creates a page that loads steal.js and an application.plugin- creates a JavaScriptMVC plugin file and folder structure.scaffold- creates the controllers, models, and fixtures used to provide basic CRUD functionality..The Generator Function
Renders a folders contents with EJS and data and then copies it to another folder.