Skip to content

Commit

Permalink
Documentation updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
unscriptable committed Aug 23, 2013
1 parent 543418b commit 52b0add
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
7 changes: 7 additions & 0 deletions README.md
Expand Up @@ -131,6 +131,8 @@ as defined in the CommonJS Modules 1.1 proposal.
recommended. "Named modules" are typically only created by build tools
and AMD bundlers.

----------------------------------------

```javascript
define(function (require, exports, module) {
var dep1 = require('app/foo');
Expand All @@ -143,6 +145,8 @@ has parameters, but the dependency list is missing, this format is assumed.
The `exports` and `module` parameters are optional, but when specified, must
be in this exact order.

----------------------------------------

```javascript
define(function (require) {
var dep1 = require('app/foo');
Expand All @@ -153,6 +157,8 @@ define(function (require) {
Another variation on AMD-wrapped-CommonJS that uses `require()` in the
tidy CommonJS manner, but returns the exports as per typical AMD.

----------------------------------------

```javascript
define(['require', 'exports', 'module'], function (require, exports, module) {
var dep1 = require('app/foo');
Expand All @@ -164,6 +170,7 @@ Another way to gain access to the CommonJS-like variables, `require`,
`exports`, `module`. When specified in the dependency list, these
"pseudo-modules" are provided as arguments to the factory function.

----------------------------------------

```javascript
var dep1 = require('app/foo');
Expand Down
29 changes: 20 additions & 9 deletions dist/README.md
Expand Up @@ -23,17 +23,18 @@ Use curl-with-js-and-domReady/curl.js if you wish to use non-AMD javascript
files and don't have an alternative domReady implementation handy.

Use curl-for-jQuery for a version of curl that has instructions for
jQuery 1.7 to register as an AMD module and has the js! and link! plugins
built in. This is an adequate configuration for many simple jQuery projects
(and some sophisticated ones, too).
jQuery 1.7+ to register as an AMD module and has the js! and link! plugins
built in. This is an adequate configuration for many simple jQuery projects.

curl-for-dojo1.6 has the domReady! plugin built in as well as some
compatibility shims for dojo 1.6 and dojo 1.7.
curl-for-dojo1.8 has the domReady! plugin built in as well as a
compatibility shim for dojo 1.8 and dojo 1.9.

You can build your own custom version of curl.js by using the `make.sh` script
in the /bin/ folder. You must run it from the /bin/ folder. Syntax:

./make.sh destination/curl.js ../src/curl.js [files to concat into curl.js]
```
./make.sh destination/curl.js ../src/curl.js [files to concat into curl.js]
```

The following files can be concatenated into curl.js using make.sh:

Expand All @@ -45,13 +46,23 @@ The following files can be concatenated into curl.js using make.sh:
* ../src/curl/plugin/domReady.js (the domReady plugin)
* ../src/curl/domReady.js (the domReady module)
* ../src/curl/shim/dojo16.js (the dojo 1.6 compatibility shim / module)
* ../src/curl/loader/cjsm11.js (the CommonJS Modules/1.1 compatibility shim / module)
* ../src/curl/shim/dojo18.js (the dojo 1.6 compatibility shim / module)
* ../src/curl/loader/cjsm11.js (a CommonJS Modules/1.1 and node.js loader)
* ../src/curl/loader/ssjs.js (a shim that allows curl.js to run in node.js)
* ../src/curl/loader/legacy.js (a better alternative to the js! plugin)
* Any named AMD module (does not support anonymous modules, yet!)
* Any non-AMD javascript file

For example, to make a version of curl with the js! and text! plugins built-in:
For example, to make a version of curl with the js! and css! plugins built-in:

./make.sh destination/curl.js ../src/curl.js ../src/curl/plugin/js.js ../src/curl/plugin/text.js
```
./make.sh destination/curl.js ../src/curl.js ../src/curl/plugin/js.js ../src/curl/plugin/css.js
```

Note: The make.sh bash script is not smart. You must tell it to concat
dependencies -- and in the right order. For instance, to use the text!
and json! plugins, you must also include the _fetchText.js module (in the
same folder).

Note: you will need a fairly recent version of `curl` (the unix utility, not
curl.js!) to run `make.sh`. Version 7.18 or later is fine.

0 comments on commit 52b0add

Please sign in to comment.