nyc-bookstores/node_modules/tabletop/package.json

34 lines
15 KiB
JSON
Raw Normal View History

2013-05-27 20:45:59 +00:00
{
"name": "tabletop",
"version": "1.3.1",
"description": "**Tabletop.js** takes a Google Spreadsheet and makes it easily accessible through JavaScript. With zero dependencies!",
"main": "src/tabletop.js",
"directories": {
"example": "examples"
},
"scripts": {
"test": "node examples/nodejs/test.js"
},
"repository": {
"type": "git",
"url": "https://github.com/jsoma/tabletop.git"
},
"author": "",
"license": "BSD",
"readmeFilename": "README.md",
"gitHead": "fdb1c3ee3bc0f7f3be6ab223a56f9f050fe32496",
"dependencies": {
"request": "~2.16.6"
},
"engines": {
"node": ">=0.10.0"
},
"readme": "# **Tabletop.js** (gives spreadsheets legs)\n\n**Tabletop.js** takes a Google Spreadsheet and makes it easily accessible through JavaScript. With zero dependencies!\n\nTabletop.js easily integrates Google Spreadsheets with Backbone.js, Handlebars, and anything else that is hip and cool. It will also help you make new friends and play jazz piano.\n\n### Like how easy?\n\n function init() {\n Tabletop.init( { key: '0AmYzu_s7QHsmdDNZUzRlYldnWTZCLXdrMXlYQzVxSFE',\n callback: function(data, tabletop) { console.log(data) },\n simpleSheet: true } )\n }\n\nWill give you\n\n [ { name: \"Carrot\", category: \"Vegetable\", healthiness: \"Adequate\" }, \n { name: \"Pork Shoulder\", category: \"Meat\", healthiness: \"Questionable\" }, \n { name: \"Bubblegum\", category: \"Candy\", healthiness: \"Super High\"} ]\n\nYes, that easy.\n\n## Notes\n\n## Getting Started\n\nYou might have seen some instructions on [http://builtbybalance.com/Tabletop/](http://builtbybalance.com/Tabletop/), but please ignore them, because they're *super super out of date*. Probably don't *break* anything, but they sure ain't current (not my domain, can't take them down). These docs here are the most up-to-date, so treat them as the gospel truth!\n\n### 1) Getting your data out there\n\n_The first step is to get your data out into a form Tabletop can digest_\n\nTake a Google Spreadsheet. Give it some column headers, give it some content.\n\n Name Category Healthiness\n Carrot Vegetable Adequate\n Pork Shoulder Meat Questionable\n Bubblegum Candy Super High\n \nIn Google Docs, then go up to the `File` menu and pick `Publish to the web`. Fiddle with whatever you want, then click `Start publishing`. A URL will appear, something like `https://docs.google.com/spreadsheet/pub?hl=en_US&hl=en_US&key=0AmYzu_s7QHsmdDNZUzRlYldnWTZCLXdrMXlYQzVxSFE&output=html`\n\nCopy that! In theory you're interested in the part between `key=` and `&` but you can use the whole thing if you want.\n\n### 2) Setting up Tabletop\n\n_Now you're going to feed your spreadsheet into Tabletop_\n\nInclude Tabletop in your HTML, then try the following, substituting your URL for `public_spreadsheet_url`\n\n <script type=\"text/javascript\">\n window.onload = function() { init() };\n \n var public_spreadsheet_url = 'https://docs.google.com/spreadsheet/pub?hl=en_US&hl=en_US&key=0AmYzu_s7QHsmdDNZUzRlYldnWTZCLXdrMXlYQzVxSFE&output=html';\n\n function init() {\n Tabletop.init( { key: public_spreadsheet_url,\n callback: showInfo,\n simpleSheet: true } )\n }\n\n function showInfo(data, tabletop) {\n alert(\"Successfully processed!\")\n console.log(data);\n }\n </script>\n\nOpen up your console and check out the data that you got. All of those rows were turned right into objects! **See how easy that was?** \n\nPlease don't hold`window.onload` against me, you're free to use `$(document).ready` and all of that jQuery jazz.\n\n### 3) Honestly, that's it.\n\nCheck out the reference and the examples, but basically you're set. The only thing to think about right _now_ is if you want to deal with multiple sheets you can get rid of `simpleSheet: true` (more on that later).\n\nYou might also be interested in the publishing/republishing/publish-as-it-changes aspects of Google Spreadsheets, but you'll need to google that for any specifics.\n\n# Reference\n\n## The Moving Parts\n\n### Tabletop initialization\n\nThe simplest Tabletop initialization works like this\n\n var tabletop = Tabletop.init( { key: public_spreadsheet_url, callback: showInfo } )\n \nWith a function living somewhere else called `showInfo`.\n\nYou pass in either `key` as the actual spreadsheet key, or just the full published-spreadsheet URL. It calls showInfo when done, passing an array of models. Options in general are\n\n`key` is the key of the published spreadsheet or the URL of the published spreadsheet
"_id": "tabletop@1.3.1",
"dist": {
"shasum": "dd3b4b394a92799a74a12686883ef6119fe1ec81"
},
"_from": "tabletop@1.3.1",
"_resolved": "https://registry.npmjs.org/tabletop/-/tabletop-1.3.1.tgz"
}