Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

docs - update

  • Loading branch information...
commit ea11b74da5b66868b2a3a0e422325e787d99ff93 1 parent 77e1243
@mklabs authored
View
59 docs/commands.md
@@ -0,0 +1,59 @@
+
+## Creating a new command
+
+The `~/.gimme` folder is the special folder create by gimme, in which
+you put a bunch of stuff, namely command definition.
+
+`gimme` will include any built-in commands (in `lib/gimme/commands`) to
+its command definitions, it then lookup the `~/.gimme/commands`
+directory to include additional command. You may even override a
+built-in command as custom ones take precedence on built-ins.
+
+Commands are simply commonjs module that exposes a function to which are
+attached `usage`, `description` and optional `complete` callback.
+
+The main handler is passed in
+[nopt](https://github.com/isaacs/nopt#readme) parsed arguments, a
+callback to invoke on completion and are executed in the context of
+`gimme`, (eg `gimme === this`, hence you should be able to access the whole api).
+
+
+### Example
+
+ mkdir ~/.gimme/commands
+ touch ~/.gimme/commands/test.js
+
+Add the following to `~/.gimme/commands/hello.js`
+
+ module.exports = hello;
+
+ hello.usage = "gimme hello <pkgname>";
+ hello.description = ['hello <name>', "best command ever"];
+ hello.complete = function() {};
+
+ function hello(opts, cb) {
+ var args = opts.argv.remain.slice(1),
+ app = this;
+
+ app.info('Hello', args.join(' '));
+ cb();
+ }
+
+You should then see the new `hello` command in `gimme help`.
+
+And running `gimme hello --help` should output the following
+
+ hello <name> - best command ever
+ ================================
+
+ gimme hello <pkgname>
+
+*Usage*
+
+ $ gimme hello
+ info - Hello
+
+ $ gimme hello from inside a custom command
+ info - Hello from inside a custom command
+
+
View
6 docs/commands/docs.md
@@ -0,0 +1,6 @@
+gimme-docs(1) - Tries to open package's documentation using default browser
+===========================================================================
+
+ gimme docs <name>
+
+> todo
View
55 docs/commands/help.md
@@ -3,57 +3,16 @@ gimme-help(1)- Shows the appropriate documentation page for the given command
gimme help <topic>
-This command will print to stdout all the packages url with surrounding
-`<script>` tags, unless `--url` was given in which case only the src
-value is displayed.
+The `help` subcommand is the one to use for further information and
+documentation on the appropriate command.
-It can take a list of packages, in which case the return output is
-composed of the guessed url, in the order they were added in the command
-line.
+* **man** (Defaults for Posix) Output the documutentation using man.
- $ gimme html jquery underscore.js backbone.js keymaster
- <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
- <script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.1/underscore-min.js"></script>
- <script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.1/backbone-min.js"></script>
- <script src="https://raw.github.com/madrobby/keymaster/master/keymaster.js"></script>
+* **browser** (Defaults for Windows) Output the documentation as HTML
+ page
-Add a `--clipboard` or `--copy` option somewhere and it'll pipe the
-output to `pbcopy` instead of stdout.
+* **markdown** Simply output the markdown file to stdout.
-## Configuration
+The only available implemented viewer is markdown for now.
-### copy
-
-* Default: false
-* Type: Boolean
-
-When `--copy` is turned on, the output is piped to `pbocpy` instead of
-stdout.
-
-### url
-
-* Default: false
-* Type: Boolean
-
-Show url instead of full `<script src=":src"></script>`.
-
-### defer
-
-* Default: false
-* Type: Boolean
-
-Only relevant when `url` is false. Add a `defer` attribute to the script
-tags. Before using `--defer`, you shoud go on with some good reading on
-why you should do with care:
-
-* https://github.com/h5bp/html5-boilerplate/issues/961
-* https://github.com/paulirish/lazyweb-requests/issues/42
-
-### clipboard
-
-Same as `--copy`
-
-### pbcopy
-
-Same as `--clipboard`
View
37 docs/commands/install.md
@@ -0,0 +1,37 @@
+gimme-install(1) - Installs the lib(s)
+======================================
+
+ gimme install <asset>
+ gimme install <asset> <asset ...>
+
+This command installs a package, or a set of packages in `--output`.
+
+If used in package directory, with no arguments, it then tries to run
+the install command defined in package.json `gimme` property.
+
+
+## Configuration
+
+### base
+
+* Default: `$cwd`
+* Type: String
+
+The base directory to work from.
+
+### output
+
+* Default: `./js/libs`
+* Type: String
+
+When specified, packages get installed to this local file instead of the default `./js/libs`.
+
+### dry
+
+* Default: false
+* Type: Boolean
+
+When turned on, this won't copy the files to `--output`. If this is the
+first install for the given packages, it then just downloads and fetch to
+cache dir. Otherwise, noop.
+
View
6 docs/commands/readme.md
@@ -0,0 +1,6 @@
+gimme-readme(1) - Show the appropriate documentation manpage generated from readme file
+=======================================================================================
+
+ gimme readme <name>
+
+> todo
View
148 readme.md
@@ -1,123 +1,75 @@
-Experimental asset manager, based on [cdnjs](https://github.com/cdnjs/cdnjs) libs.
+Experimental asset manager, based on [cdnjs](http://www.cdnjs.com/) and
+[microjs](http://microjs.com/)libs.
## Description
gimme is a little, experimental tool to manage web assets from the CLI.
-## Usage
-
- Usage:
- gimme [command] [options]
-
- Commands:
- gimme completion Setup tab completion
- gimme list List available packages
- gimme html Show HTML snippets to include package
- gimme readme <name> Show the appropriate documentation manpage generated from readme file
- gimme docs <name> Tries to open package's documentation using default browser
- gimme install <name ...> Installs the lib(s) <name ...>
-
- Options:
-
- -o, --out <dir> output directory defaulting to ./js/libs
- -l, --loglevel <level> What level of logs to report
- -v, --version output program version
- -h, --help display help information
-
-## Synopsis
-
-**install new packages**
-
- $ gimme install underscore.js backbone.js jquery
- log - Installing... underscore.js backbone.js jquery
- log - all done
- debug - install done in 1.348s
-
-**open the package homepage**
-
-using default browser
-
- gimme docs socket.io
-
-**view project's readme as manpage**
-
- gimme readme socket.io
-
-**list all available packages**
+It comes with 250+ available package to install right off the bat, and
+if that's not enough you can create your own package definition.
- gimme list
-
-## commands
-
-### gimme completion
-
- gimme completion
- gimme completion install
-
-Enables tab-completion in gimme commands.
-
-The synopsis above loads the completions and add it to your ~/.bashrc or
-~/.zshrc, making the completions available everywhere. `gimme
-completion` alone output the completion bash script, `gimme completion
-install` is the equivalent of running `gimme completion >> ~/.bashrc
-(or ~/.zshrc)`
-
-### gimme readme
-
- gimme readme <name>
-
-This command tries to guess at the likely location of a repository's
-readme, and then tries to generate a manpage using [ronnjs](https://github.com/kapouer/ronnjs).
-
-
-### gimme docs
-
- gimme docs <name>
-
-This command tries to guess at the likely location of an asset's
-documentation URL, and then tries to open it using the default browser.
-
-### todos
+## Usage
-#### gimme update
- gimme update
+ Experimental asset manager for cdnjs / microjs libs.
-Refresh the data.js cache in `$HOME/.gimme`
+ Usage: gimme <cmd> [options]
-#### gimme uninstall
+ Commands:
+ add Add a new bundle definition
+ bundle Concat and minifiy the given package(s) and local files
+ completion Setup tab completion
+ docs Tries to open package's documentation using default browser
+ help Shows the appropriate documentation page for the given command
+ html Show HTML snippet to include given package(s)
+ install Installs the lib(s) <name ...>
+ list List available packages
+ readme Show the appropriate documentation manpage generated from readme file
- gimme uninstall (with no args in a package dir)
- gimme uninstall <name ...>
+ Options:
+ -l, --loglevel What level of log to report
+ -o, --output Output directory, defaults to ./js/libs
+ -v, --version Output program version
+ -d, --debug Slighly more verbose error output when set to true, defaults false
+ -ll, --limit Maximum number of results to output with paginated list
+ -h, --help Display help information
+ --props Optional list of package properties to output with list
+ --usage Display usage for given subcommand
+ --viewer The program to use to view help content, if `markdown` then output to stdout
+ --bundle When turned on, list will only display added bundles with `gimme add`
+ --url When turned on, html command will output url without surrounding <script>
+ -clipboard, --copy When turned on, html command will pipe the output to pbocpy instead of stdout
+ --nocompress Disable minification for js files with `bundle` command
-Same usage as `gimme install`, but removes the locally installed
-(defaults in `./js/libs`)
+## Documentation
-#### gimme search
+* [Usage](https://github.com/mklabs/gimme-assets/blob/dev/docs/usage.md)
- gimme search
- gimme search <tag ...>
+**Commands**
-Search available assets with optional list of tags.
+* [add](https://github.com/mklabs/gimme-assets/blob/dev/docs/commands/add.md#readme)
+* [bundle](https://github.com/mklabs/gimme-assets/blob/dev/docs/commands/bundle.md#readme)
+* [docs](https://github.com/mklabs/gimme-assets/blob/dev/docs/commands/docs.md#readme)
+* [help](https://github.com/mklabs/gimme-assets/blob/dev/docs/commands/help.md#readme)
+* [html](https://github.com/mklabs/gimme-assets/blob/dev/docs/commands/html.md#readme)
+* [install](https://github.com/mklabs/gimme-assets/blob/dev/docs/commands/install.md#readme)
+* [list](https://github.com/mklabs/gimme-assets/blob/dev/docs/commands/list.md#readme)
+* [readme](https://github.com/mklabs/gimme-assets/blob/dev/docs/commands/readme.md#readme)
-## Creating a new command
+**creating a new command**
-> TODO
+* [commands](https://github.com/mklabs/gimme-assets/blob/dev/docs/commands.md#readme)
-#### gimme html
+## Install
- gimme html <name ...>
+ npm install gimme-assets -g
-Would show the html snippet to include given package. Defaults returns
-the html snippet to include the cdnjs libs with local fallback.
+## Tests [![Build Status](https://secure.travis-ci.org/mklabs/gimme-assets.png?branch=master)](http://travis-ci.org/mklabs/gimme-assets)
-## install
+ npm test
- git clone git://github.com/mklabs/gimme-assets.git
- cd gimme-assets
- npm install && npm link
+Create a new test
-Or
+ node test --create testname
- npm install https://github.com/mklabs/gimme-assets/tarball/master -g
Please sign in to comment.
Something went wrong with that request. Please try again.