Skip to content
This repository has been archived by the owner on Feb 14, 2018. It is now read-only.

Story JSON

donpdonp edited this page Aug 22, 2011 · 2 revisions

Example story JSON, from file data/pages/welcome-visitors

{
    "title": "Welcome Visitors",
    "synopsys": "The first federated wiki page written and often first page viewed.",
    "story": [
        {
            "id": "7b56f22a4b9ee974",
            "type": "paragraph",
            "text": "Welcome to the federated wiki. This page was first drafted 
                     Sunday, June 26th, 2011, at [[indie-web-camp]]. You are welcome 
                     to copy this page to any server you own and revise its welcoming
                     message as you see fit. You can assume this has happened many 
                     times already."
        },
        {
             "id": "8d8a6cf94b72e848",
             "type": "image",
             "width": "300px",
             "height": "200px",
             "caption": "Ward's Lighted Electric Bike at [http://www.shift2bikes.org
                         /cal/viewpp2011.php#24-2144 Pedalpalooza]",
             "url": "/lit-and-loud.jpg"
        }
    ],
    "trail": [
                "http://fw.indiewebcamp",
                "http://c2.com/~ward/fw"
    ],
    "journal": [
                  {"type":   "edit",
                   "id":     "15411293042b2735",
                   "text":   "the paragraph now says this"}
    ]
}

The welcome-visitors page above was the first ever written. It would be poetic if all future versions of this wiki can read and render this simplest of pages. (Kinda like browsers supporting HTTP 0.9)

The `synopsys' binding is not yet used. This is an example of suggesting functionality through sample data. What would you do with a synopsys? Label search results? Add alt-text to hyperlinks?

It would be good to document all keys, their purpose, and where (if) they are used.

Story Items

  • paragraph
  • image
  • chart

Trail

Journal

  • type:edit
  • type:move

Issues

  • id = "[http|localstorage]://localhost/page-name"
  • revision = "contents hash"
  • story.items.id = Story.id+"/<uuid>"
  • story.items.revision = "contents hash"
  • trail = array of entries. entry = [Page.revision, source URL]
  • The trail should serialize a directed acyclic graph (allows for branches)
Clone this wiki locally