Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frando/composer
Content Composition for your web application
https://github.com/frando/composer
Last synced: 18 days ago
JSON representation
Content Composition for your web application
- Host: GitHub
- URL: https://github.com/frando/composer
- Owner: Frando
- License: other
- Created: 2012-05-02T23:41:12.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-05-02T04:39:49.000Z (over 12 years ago)
- Last Synced: 2024-10-16T13:07:36.017Z (2 months ago)
- Language: JavaScript
- Homepage: http://composer.substance.io
- Size: 1.84 MB
- Stars: 2
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Substance Composer
=====================The Substance Composer is an open source effort dedicated to the development of a truly flexible editing component to be used by applications such as Substance.io for collaborative content composition. It uses operations to transform documents. By keeping track of atomic document operations, we can replay the complete history and go back and forth in time.
API Appetizer
=====================```js
var op1 = {"_rev": 1, "command": "insert-node", params: {"type": "section", after: "/text/1"}}composer.document.rev // => 1
composer.execute(op1);
composer.document.rev // => 2var op2 = {"command": "insert-comment", params: {
referenced_nodes: ["/text/1", "/section"],
"content": "There's a typo in line 5 at the first paragraph."},
"user": {username: "john", "name": "John Doe"}
};composer.execute(op2);
composer.document.rev // => 3var op3 = {"command": "update-node", "params": {"node": "/text/1", "operation": "ret(15) del('abc') ins('ABC') ret(241)"}}
composer.execute(op3); // just transforms the content of text nodes using OT.
```