Skip to content

Commit

Permalink
works with plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
lancejpollard committed Nov 16, 2011
1 parent c1fc317 commit d30aee5
Showing 1 changed file with 33 additions and 7 deletions.
40 changes: 33 additions & 7 deletions README.md
Expand Up @@ -14,21 +14,36 @@ Here is the [example app](https://github.com/viatropos/design.io-example) for th
npm install design.io
```

## Extensions

- [design.io-stylesheets](https://github.com/viatropos/design.io-stylesheets)
- [design.io-javascripts](https://github.com/viatropos/design.io-javascripts)

## Usage

```
design.io
Add the [design.io.js](https://raw.github.com/viatropos/design.io/master/design.io.js) client to your html head. You also need jQuery, and [Socket.IO](http://socket.io/).

``` html
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script type="text/javascript" src="/javascripts/socket.io.js"></script>
<script type="text/javascript" src="/javascripts/design.io.js"></script>
```

That `design.io -d [directory]` command will watch a directory for changes and inject JavaScripts and StyleSheets into the LIVE example web app whenever you hit save. It does it in a clean an optimized way.
You can just [grab socket.io from here](https://raw.github.com/viatropos/design.io/master/spec/app/javascripts/socket.io.js) as well.

So, edit the files in `./src` and watch the stuff in the page change in real time.
Next, create a file named `Watchfile` at the root of your project, and start the watcher with this command:

```
design.io
```

## Watchfile
## The Watchfile

This is what a blank `watch` task looks like:
This is what a blank `watch` task looks like in a Watchfile:

``` coffeescript
# ./Watchfile

watch /\.(styl|less|sass|scss|css)$/
create: (path) ->
@update(path)
Expand All @@ -40,13 +55,24 @@ watch /\.(styl|less|sass|scss|css)$/
client:
# id, path, body
create: (data) ->

# this is in the browser's context!

update: (data) ->

delete: (data) ->

```

You can update the Watchfile and the changes will be affected in real time by adding this extension:

``` coffeescript
# Watchfile

require('design.io').extension('watchfile')()

# ... more watchers
```

## Using Extensions

Design.io comes with two basic extensions:
Expand Down

0 comments on commit d30aee5

Please sign in to comment.