diff --git a/docs/journeys.md b/docs/journeys.md index 32168610..ea6c7c79 100644 --- a/docs/journeys.md +++ b/docs/journeys.md @@ -334,7 +334,7 @@ departure of first (later) journey 2017-12-17T19:19:00+01:00 If you pass `polylines: true`, each journey leg will have a `polyline` field. Refer to [the section in the `trip()` docs](trip.md#polyline-option) for details. -If you pass `scheduledDays: true`, each journey will have a `scheduledDays` field looking like this: +If you pass `scheduledDays: true`, each journey will have a `scheduledDays` object looking like this: ```js { diff --git a/docs/radar.md b/docs/radar.md index 6e94c423..6de41264 100644 --- a/docs/radar.md +++ b/docs/radar.md @@ -47,6 +47,7 @@ The response may look like this: latitude: 52.521508, longitude: 13.411267 }, + line: { type: 'line', id: 's9', @@ -68,6 +69,7 @@ The response may look like this: }, direction: 'S Flughafen Berlin-Schönefeld', trip: 31463, + nextStopovers: [ { stop: { type: 'stop', diff --git a/docs/trip.md b/docs/trip.md index e1545f30..135fb9ea 100644 --- a/docs/trip.md +++ b/docs/trip.md @@ -55,6 +55,7 @@ The response looked like this: ```js { id: '1|31431|28|86|17122017', + origin: { type: 'station', id: '900000260005', diff --git a/docs/writing-a-profile.md b/docs/writing-a-profile.md index cd06fac2..cfacca40 100644 --- a/docs/writing-a-profile.md +++ b/docs/writing-a-profile.md @@ -1,14 +1,14 @@ # Writing a profile -**Per HAFAS endpoint, `hafas-client` has an endpoint-specific customisation called *profile***, which may for example do the following: +**Per HAFAS endpoint, `hafas-client` has an endpoint-specific customisation called *profile*.** A profile may, for example, do the following: - handle the additional requirements of the endpoint (e.g. authentication), - extract additional information from the data provided by the endpoint, - guard against triggering bugs of certain endpoints (e.g. time limits). -This guide is about writing such a profile. If you just want to use an already supported endpoint, refer to the [API documentation](readme.md) instead. +This guide is about writing such a profile. If you just want to use an already supported endpoint, refer to the [main readme](../readme.md) instead. -*Note*: **If you get stuck, ask for help by [creating an issue](https://github.com/public-transport/hafas-client/issues/new)!** We want to help people expand the scope of this library. +*Note*: **If you get stuck, ask for help by [creating an issue](https://github.com/public-transport/hafas-client/issues/new)**; We're happy to help you expand the scope of this library! ## 0. How do the profiles work? @@ -21,7 +21,7 @@ A profile may consist of three things: - **flags indicating which features are supported by the endpoint** – e.g. `trip` - **methods overriding the [default profile](../lib/default-profile.js)** -As an example, let's say we have an [Austrian](https://en.wikipedia.org/wiki/Austria) endpoint: +Let's use a fictional endpoint for [Austria](https://en.wikipedia.org/wiki/Austria) as an example: ```js const myProfile = { @@ -31,7 +31,7 @@ const myProfile = { } ``` -Assuming their HAFAS endpoint returns all lines names prefixed with `foo `, We can strip them like this: +Assuming their HAFAS endpoint returns all line names prefixed with `foo `, we can adapt our profile to clean them: ```js // get the default line parser