From c0669cb46e7524e0bb8c07443ac0ba21ee244814 Mon Sep 17 00:00:00 2001 From: Neil Craig Date: Thu, 27 Apr 2017 20:19:17 +0100 Subject: [PATCH 1/2] Update touch-bar.md Add a simple example of running the example code as it might not be obvious to people who've not used Electron. Hopefully it makes sense :-) --- docs/api/touch-bar.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/api/touch-bar.md b/docs/api/touch-bar.md index 0a0827a2b2f..371982fc2b4 100644 --- a/docs/api/touch-bar.md +++ b/docs/api/touch-bar.md @@ -138,3 +138,11 @@ app.once('ready', () => { window.setTouchBar(touchBar) }) ``` +### Running the above example +To run the example above, you'll need to (assuming you've got a terminal open in the dirtectory you want to run the example): + +1. Save the above file to your computer, named as touchbar.js +2. Install electron via e.g. `npm install electron` +3. Run the example inside electron: `./node_modules/.bin/electron touchbar.js` + +You should then see a new electron window and the app running in your touchbar (or touchbar emulator). From c26605c384ecc8d2342fe134ed84e5ee006d2ebc Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 27 Apr 2017 14:22:56 -0700 Subject: [PATCH 2/2] Minor edits to example guide --- docs/api/touch-bar.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/api/touch-bar.md b/docs/api/touch-bar.md index 371982fc2b4..8f1b8732f8b 100644 --- a/docs/api/touch-bar.md +++ b/docs/api/touch-bar.md @@ -138,11 +138,13 @@ app.once('ready', () => { window.setTouchBar(touchBar) }) ``` + ### Running the above example + To run the example above, you'll need to (assuming you've got a terminal open in the dirtectory you want to run the example): -1. Save the above file to your computer, named as touchbar.js -2. Install electron via e.g. `npm install electron` -3. Run the example inside electron: `./node_modules/.bin/electron touchbar.js` +1. Save the above file to your computer as `touchbar.js` +2. Install Electron via `npm install electron` +3. Run the example inside Electron: `./node_modules/.bin/electron touchbar.js` -You should then see a new electron window and the app running in your touchbar (or touchbar emulator). +You should then see a new Electron window and the app running in your touch bar (or touch bar emulator).