From 3daff5df2260f43d5199373e280b0a81dee141dc Mon Sep 17 00:00:00 2001 From: Gunnar Lium Date: Tue, 20 Nov 2012 09:52:15 +0100 Subject: [PATCH] Provide info about how the config option works. --- README.markdown | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.markdown b/README.markdown index 240d59a..841cc02 100644 --- a/README.markdown +++ b/README.markdown @@ -81,6 +81,29 @@ Here's a simple example: ## Config Options Here are some of the options you can set in the config. +### Source +`source` Should be either the path to the JSON resource to load, or a JavaScript +object corresponding to the Timeline model. + +Here is an example using a data object: + +```javascript + + var dataObject = {timeline: {headline: "Headline", type: ... }} + createStoryJS({ + type: 'timeline', + width: '800', + height: '600', + source: dataObject, + embed_id: 'my-timeline' + }); +``` + +If source is a string, we will try to automatically recognize resources that are +Twitter searches, Google Spreadsheets or Storify stories. Failing that, we assume +the source is either JSON or JSONP. If string matches on `.jsonp`, we will treat it +as JSONP, otherwise, we will append `?callback=onJSONP_Data`. See more details below. + ### Language `lang` Localization