Skip to content

Commit 9e51e82

Browse files
fix readme
1 parent baee075 commit 9e51e82

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Readme.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ npm install x-ray
4545

4646
## API
4747

48-
#### Xray(url)
48+
#### `Xray(url)`
4949

5050
Initialize `xray` with a `url`
5151

5252
```js
5353
xray('http://google.com')
5454
```
5555

56-
#### Xray#select(<string|object|array> schema)
56+
#### `Xray#select(<string|object|array> schema)`
5757

5858
The elements you'd like to select. Uses [x-ray-select](https://github.com/lapwinglabs/x-ray-select) for matching the elements on the page.
5959

@@ -155,7 +155,7 @@ xray('http://mat.io')
155155
});
156156
```
157157

158-
#### Xray#use(<function> fn)
158+
#### `Xray#use(<function> fn)`
159159

160160
Add a plugin to augment Xray's current functionality.
161161

@@ -168,7 +168,7 @@ xray('http://google.com')
168168
.use(phantom(options))
169169
```
170170

171-
#### Xray#throws(<boolean> throws)
171+
#### `Xray#throws(<boolean> throws)`
172172

173173
This tells x-ray whether or not to throw if it encounters an error while parsing. Defaults to throwing (`true`).
174174

@@ -177,7 +177,7 @@ xray('https://github.com/')
177177
.throws(false)
178178
```
179179

180-
#### Xray#paginate(<string> selector)
180+
#### `Xray#paginate(<string> selector)`
181181

182182
Crawl the website by passing a selector that contains a URL to the next or previous page:
183183

@@ -193,7 +193,7 @@ xray('https://github.com/')
193193
.paginate('.prev[href]')
194194
```
195195

196-
#### Xray#delay(<number> from, <number:optional> to)
196+
#### `Xray#delay(<number> from, <number:optional> to)`
197197

198198
When paginating, this will delay the next request randomly between `from` and `to` milliseconds.
199199

@@ -214,7 +214,7 @@ xray('http://github.com')
214214
.delay(5000)
215215
```
216216

217-
#### Xray#prepare(<string|object> str, <function> fn)
217+
#### `Xray#prepare(<string|object> str, <function> fn)`
218218

219219
You can prepare the data that you scrape for output
220220

@@ -249,7 +249,7 @@ xray('mat.io')
249249
```
250250

251251

252-
#### Xray#format(<function> fn)
252+
#### `Xray#format(<function> fn)`
253253

254254
Specify a custom formatting function for each selected element.
255255

@@ -270,11 +270,11 @@ xray('https://github.com/stars/matthewmueller')
270270

271271
`TODO`: specify an "end", so you can do `xray.format(html)` and get back html.
272272

273-
#### Xray#limit(<number> limit)
273+
#### `Xray#limit(<number> limit)`
274274

275275
When paginating, this specifies a limit to the number of pages x-ray should crawl. Defaults to no limit (`Infinity`).
276276

277-
#### Xray#run(<function:optional> fn)
277+
#### `Xray#run(<function:optional> fn)`
278278

279279
Start the scraper, calling `fn` when we're done scraping.
280280

@@ -293,7 +293,7 @@ var title = yield xray('http://google.com').select('title').run();
293293
// title is "Google"
294294
```
295295

296-
#### Xray#write(<string|WritableStream> filepath) -> WritableStream
296+
#### `Xray#write(<string|WritableStream> filepath) -> WritableStream`
297297

298298
Start the scraper, streaming each page to `filepath`. Returns a [`WritableStream`](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_writable).
299299

0 commit comments

Comments
 (0)