Browse Source

Merge pull request #290 from gunnarlium/add-source-info-to-readme

Provide info about how the  config option works.
pull/246/merge
Zach Wise 12 years ago
parent
commit
ecc75c295f
  1. 23
      README.markdown

23
README.markdown

@ -107,6 +107,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

Loading…
Cancel
Save