more docs improvements 📝

This commit is contained in:
Jannis R 2018-01-05 21:33:03 +01:00
parent d7eca5b4d1
commit 95151ccd0e
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
2 changed files with 18 additions and 11 deletions

View file

@ -65,13 +65,13 @@ The response may look like this:
longitude: 13.303846 longitude: 13.303846
}, },
products: { products: {
suburban: true, suburban: true,
subway: false, subway: false,
tram: false, tram: false,
bus: true, bus: true,
ferry: false, ferry: false,
express: false, express: false,
regional: true regional: true
} }
}, },
when: '2017-12-17T19:32:00.000+01:00', when: '2017-12-17T19:32:00.000+01:00',

View file

@ -2,8 +2,10 @@
**A client for HAFAS public transport APIs**. Sort of like [public-transport-enabler](https://github.com/schildbach/public-transport-enabler), but with a smaller scope. It also [contains customisations](p) for the following transport networks: **A client for HAFAS public transport APIs**. Sort of like [public-transport-enabler](https://github.com/schildbach/public-transport-enabler), but with a smaller scope. It also [contains customisations](p) for the following transport networks:
- [Deutsche Bahn](https://en.wikipedia.org/wiki/Deutsche_Bahn) [docs](p/db/readme.md) [usage example](p/db/example.js) [src](p/db/index.js) HAFAS endpoint | wrapper library? | docs | example code | source code
- [Berlin public transport](https://en.wikipedia.org/wiki/Verkehrsverbund_Berlin-Brandenburg) [docs](p/vbb/readme.md) [usage example](p/vbb/example.js) [src](p/vbb/index.js) ---------------|------------------|------|---------|------------
[Deutsche Bahn](https://en.wikipedia.org/wiki/Deutsche_Bahn) | [`vbb-hafas`](https://github.com/derhuerst/vbb-hafas), which has additional features | [docs](p/db/readme.md) | [example code](p/db/example.js) | [src](p/db/index.js)
[Berlin & Brandenburg public transport](https://en.wikipedia.org/wiki/Verkehrsverbund_Berlin-Brandenburg) | [`db-hafas`](https://github.com/derhuerst/db-hafas), which has additional features | [docs](p/vbb/readme.md) | [example code](p/vbb/example.js) | [src](p/vbb/index.js)
[![npm version](https://img.shields.io/npm/v/hafas-client.svg)](https://www.npmjs.com/package/hafas-client) [![npm version](https://img.shields.io/npm/v/hafas-client.svg)](https://www.npmjs.com/package/hafas-client)
[![build status](https://img.shields.io/travis/derhuerst/hafas-client.svg)](https://travis-ci.org/derhuerst/hafas-client) [![build status](https://img.shields.io/travis/derhuerst/hafas-client.svg)](https://travis-ci.org/derhuerst/hafas-client)
@ -50,7 +52,7 @@ client.journeys('8011167', '8000261', {results: 1})
.catch(console.error) .catch(console.error)
``` ```
The returned [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/promise) will resolved with an array of one `journey` in the [*FPTF* `1.0.1`](https://github.com/public-transport/friendly-public-transport-format/blob/1.0.1/spec/readme.md). The returned [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/promise) will resolve with an array of one [*FPTF* `journey`](https://github.com/public-transport/friendly-public-transport-format/blob/1.0.1/spec/readme.md#journey).
```js ```js
[ { [ {
@ -86,7 +88,12 @@ The returned [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript
mode: 'train', mode: 'train',
product: 'suburban', product: 'suburban',
class: 16, class: 16,
productCode: 4 productCode: 4,
operator: {
type: 'operator',
id: 's-bahn-berlin-gmbh',
name: 'S-Bahn Berlin GmbH'
}
}, },
direction: 'Ringbahn ->' direction: 'Ringbahn ->'
}, /* … */ { }, /* … */ {