Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/derbyjs/d-codemirror

derby component for live-bound CodeMirror
https://github.com/derbyjs/d-codemirror

Last synced: 7 days ago
JSON representation

derby component for live-bound CodeMirror

Awesome Lists containing this project

README

        

d-codemirror
==================

Example CodeMirror Derby component.

# Usage
[Example usage](http://github.com/derbyjs/derby-examples/tree/master/codemirror)

## In your template
```


```

## Your data
```
model.set("_page.text", "Hello World");
```

## Your CodeMirror

You can serve the CodeMirror files from your public folder. If you install them through NPM
you will have to add an extra static route to your Express app:

````
var expressApp = express()
(…)
.use('/cm', serveStatic(process.cwd() + '/node_modules/d-codemirror/node_modules/codemirror/'))
(…)
````

See the [derby-examples](http://github.com/derbyjs/derby-examples/tree/master/codemirror)
repo for an example using real-time data subscriptions to power multi-player editing.