Git Product home page Git Product logo

canhaz's Introduction

Please Note: this project has moved from briancavalier/canhaz to cujojs/canhaz. Any existing forks have been automatically moved to cujojs/cram. However, you'll need to update your clone and submodule remotes manually.

Update the url in your .git/config, and also .gitmodules for submodules:

git://github.com/cujojs/canhaz.git
https://[email protected]/cujojs/canhaz.git

Helpful link for updating submodules: Git Submodules: Adding, Using, Removing, Updating


canhaz

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 is all that stuff you have to type before you can write the code you actually care about. It's your company copyright. It's your Javascript module wrapper, be it plain Javascript or AMD, or your Java package statement and class declaration wrapper. It's also all the stuff you might need to start a project, like much of the stuff that is provided by HTML 5 Boilerplate, for example, for an HTML site.

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.

Quick Start

Install it

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 install.sh script.

Run it

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

Usage

canhaz [--force] module_type module_path [generators]

Options

--force 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 :)

module_type Type of "thing" to generate. Use --help, or look in the generators directory to see what things canhaz knows about.

module_path 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.

generators (optional) 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 out strings)

Generators

These are what you care about. Generators generate (duh) boilerplate for you. Here's what you get out of the box:

HTML5 Boilerplate

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.

jQuery

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.

License

Canhaz is available under the MIT license. See LICENSE.txt for details.

canhaz's People

Contributors

briancavalier avatar edfuh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.