Canhaz is a project bootstrapping tool for generating stub files, similar to generator tools found in frameworks such as Ruby on Rails. The main difference is that canhaz is completely framework-independent, and highly-extensible through plugin generators.
Boilerplate sucks. Unfortunately, it is also necessary
Boilerplate steals minutes of your day, but does almost nothing for your project.
It's time to stop typing it, and to canhaz it instead.
NOTE: Installation creates a symlink at /usr/local/bin/canhaz by default, so you may need to sudo to install.
The superfast do-you-trust-briancavalier install:
curl 'https://github.com/briancavalier/canhaz/raw/master/install.sh' | sh
Or, if you prefer, clone it and run the
canhaz jquery.widget js/ui.myWidget
Creates the directory js, if necessary, and generates:
- ui.myWidget.js - jQuery widget skeleton, fill in your code!
- ui.myWidget.css - CSS skeleton for your widget
canhaz [--force] module_type module_path [generators]
Force overwriting an existing dir. By default canhaz will not overwrite
an existing leaf dir, and it will warn you if you try to do so. If you
really want to overwrite it, use the --force :)
Type of "thing" to generate. Use --help, or look in the generators
directory to see what things canhaz knows about.
Path of the thing to generate. You can think of this as an AMD
module id, or as a relative filesystem path. The last part of the
path will be the name of the thing. Different generators may use
this information in slightly different ways.
You can list a subset of the components you'd like to generate. For
example, when generating a view, if you don't need a strings file, you
could do: canhaz my/view/MyView js scss css html test (i.e. leaving
These are what you care about. Generators generate (duh) boilerplate for you. Here's what you get out of the box:
Makes it easy to start a new HTML5 project with HTML5 Boilerplate. Use it like this:
canhaz html.boilerplate myNewProject cd myNewProject ## edit index.html... canhaz html.page anotherPage ## edit anotherPage.html... canhaz html.page sub/Page ## edit sub/Page.html... profit
html.boilerplate - Fetches html5boilerplate from github, creates a new project dir, and injects your project name into the index.html file.
html.page - Fetches html5boilerplate's index.html from github, names it with the name you specify, and again injects that name into the HTML.
Generate stub JS for jQuery plugins, and JS and CSS for jQuery UI widgets. Use it like this:
canhaz jquery.plugin myPlugin ## edit js/myPlugin.js ## add myWidget.js to your build process canhaz jquery.widget myWidget ## edit myWidget.js ## edit myWidget.css ## add myWidget.js and myWidget.css to your build process profit
jquery.plugin - Generates a JS skeleton for a simple jQuery plugin.
jquery.widget - Generates a JS and CSS skeleton for a jQuery UI widget.
Canhaz is available under the MIT license. See LICENSE.txt for details.