Update README.md

This commit is contained in:
keegan-lillo
2016-06-08 18:49:55 -07:00
parent f62f960433
commit 19ad09eb66
+8 -6
View File
@@ -21,28 +21,30 @@ Clay will eventually be built into the Pebble SDK. However, while it is still in
var clay = new Clay(clayConfig); var clay = new Clay(clayConfig);
``` ```
6. Add `configurable` to the `capabilities` array in your `appinfo.json`. 6. Add `configurable` to the `capabilities` array in your `appinfo.json`.
7. Next is the fun part - creating your config page. Edit your `config.js` file to build a layout of elements as described in the sections below. 7. Ensure `enableMultiJS` is set to true in your `appinfo.json`.
8. Next is the fun part - creating your config page. Edit your `config.js` file to build a layout of elements as described in the sections below.
# Getting Started (CloudPebble) # Getting Started (CloudPebble)
Clay will eventually be built into CloudPebble. However while it is still in beta, you will need to follow some steps. Clay will eventually be built into CloudPebble. However while it is still in beta, you will need to follow some steps.
NOTE these are similar to using the SDK but instead of a data file called config.json, a javascript file config.js is required. NOTE these are similar to using the SDK but instead of a data file called config.json, a javascript file config.js is required.
1. Create a new JavaScript file called `clay.js`. 1. Ensure `JS Handling` is set to `CommonJS-style` in your project settings.
2. Copy the contents from the **clay.js** distribution file found in the [latest release](https://github.com/pebble/clay/releases/latest) into your newly created `clay.js` file. 2. Create a new JavaScript file called `clay.js`.
3. Create another JavaScript file called `config.js` with the following content. This will act as your config's root array element, from which the rest of the page is built up: 3. Copy the contents from the **clay.js** distribution file found in the [latest release](https://github.com/pebble/clay/releases/latest) into your newly created `clay.js` file.
4. Create another JavaScript file called `config.js` with the following content. This will act as your config's root array element, from which the rest of the page is built up:
```javascript ```javascript
module.exports = []; module.exports = [];
``` ```
4. Your `app.js` file needs to `require` clay and your config file, then be initialized. Clay will by default automatically handle the 'showConfiguration' and 'webviewclosed' events. Copy and paste the following into the top of your `app.js` file: 5. Your `app.js` file needs to `require` clay and your config file, then be initialized. Clay will by default automatically handle the 'showConfiguration' and 'webviewclosed' events. Copy and paste the following into the top of your `app.js` file:
```javascript ```javascript
var Clay = require('clay'); var Clay = require('clay');
var clayConfig = require('config'); var clayConfig = require('config');
var clay = new Clay(clayConfig); var clay = new Clay(clayConfig);
``` ```
5. Next is the fun part - creating your config page. Edit your `config.js` file to build a layout of elements as described in the sections below. 6. Next is the fun part - creating your config page. Edit your `config.js` file to build a layout of elements as described in the sections below.
# Creating Your Config File # Creating Your Config File