standardize all javascript blocks in English docs

This commit is contained in:
Zeke Sikelianos 2016-07-25 18:39:25 -07:00
parent dd9935a9d7
commit 06a354a2eb
37 changed files with 567 additions and 445 deletions

View file

@ -5,16 +5,17 @@
The following example shows how to write a string to the clipboard:
```javascript
const {clipboard} = require('electron');
clipboard.writeText('Example String');
const {clipboard} = require('electron')
clipboard.writeText('Example String')
```
On X Window systems, there is also a selection clipboard. To manipulate it
you need to pass `selection` to each method:
```javascript
clipboard.writeText('Example String', 'selection');
console.log(clipboard.readText('selection'));
const {clipboard} = require('electron')
clipboard.writeText('Example String', 'selection')
console.log(clipboard.readText('selection'))
```
## Methods
@ -109,7 +110,8 @@ Returns an array of supported formats for the clipboard `type`.
Returns whether the clipboard supports the format of specified `data`.
```javascript
console.log(clipboard.has('<p>selection</p>'));
const {clipboard} = require('electron')
console.log(clipboard.has('<p>selection</p>'))
```
### `clipboard.read(data[, type])` _Experimental_
@ -130,6 +132,7 @@ Reads `data` from the clipboard.
* `type` String (optional)
```javascript
clipboard.write({text: 'test', html: "<b>test</b>"});
const {clipboard} = require('electron')
clipboard.write({text: 'test', html: '<b>test</b>'})
```
Writes `data` to the clipboard.