Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A home for Substance documents. Think of it as a database for digital documents.
JavaScript
Branch: master
Pull request Compare This branch is 12 commits behind michael:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
data
lib
src
.gitignore
.gitmodules
README.md
config.json
package.json
server.js

README.md

This document is best viewed in Prose.

Library

The Substance Library is different from traditional libraries, in that there are no books stored but digital documents that are always up-to-date. Everyone with permission can read and write documents at any time. Open 24/7.

API

It's fairly easy to use.

Write Document

$ curl -XPOST http://localhost:7007/write -d '{
    "id": the-substance-composer,
    "created_at": "2012-04-10T15:17:28.946Z",
    "updated_at": "2012-04-10T15:17:28.946Z",
    "head": "/cover/1",
    "tail": "/section/2",
    "rev": 2,
    "nodes": {
      "/cover/1": {
        "type": ["/type/node", "/type/cover"],
        "title": "The Substance Composer",
        "abstract": "Building an editor for everyone is impossible. Go create your own.",
        "next": "/section/2",
        "prev": null
      },
      "/section/2": {
        "type": ["/type/node", "/type/section"],
        "name": "Start typing today.",
        "prev": "/cover/1",
        "next": null
      }
    },
    "operations": [
      {"command": "node:insert", "params": {"user": "michael", "type": "cover", "attributes": {"title": "The Substance Composer" }}},
      {"command": "node:insert", "params": {"user": "michael", "type": "section", "attributes": {"name": "Start typing today."}}}
    ]
}'

Read Document

$ curl -XGET http://localhost:7007/read/the-substance-composer

Update a document incrementally

$ curl -XPUT http://localhost:7007/update -d '{
   "id": "the-substance-composer",
   "operations": [
      {"command": "node:insert", "params": {"user": "michael", "type": "text", "attributes": {"content": "some text."}}},
    ]
}'

Search for Documents

To be implemented.

Something went wrong with that request. Please try again.