From ffc392b66b5f11a94cf6586ceae156ffed396aa8 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Mon, 30 Jul 2018 10:45:45 +0200 Subject: [PATCH] docs: link to FPTF 1.1.1, minor fixes :memo: [ci skip] --- docs/departures.md | 2 +- docs/journeys.md | 2 +- docs/nearby.md | 2 +- docs/radar.md | 2 +- docs/refresh-journey.md | 2 +- docs/trip.md | 2 +- docs/writing-a-profile.md | 8 ++++---- p/oebb/readme.md | 2 +- readme.md | 4 ++-- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/departures.md b/docs/departures.md index 33651a1d..7614d7c8 100644 --- a/docs/departures.md +++ b/docs/departures.md @@ -38,7 +38,7 @@ With `opt`, you can override the default options, which look like this: ## Response -*Note:* As stated in the [*Friendly Public Transport Format* `1.0.1`](https://github.com/public-transport/friendly-public-transport-format/tree/1.0.1), the `when` field includes the current delay. The `delay` field, if present, expresses how much the former differs from the schedule. +*Note:* As stated in the [*Friendly Public Transport Format* `1.1.1`](https://github.com/public-transport/friendly-public-transport-format/tree/1.1.1), the `when` field includes the current delay. The `delay` field, if present, expresses how much the former differs from the schedule. You may pass the `tripId` field into [`trip(id, lineName, [opt])`](trip.md) to get details on the vehicle's trip. diff --git a/docs/journeys.md b/docs/journeys.md index f7be35c1..3242eb23 100644 --- a/docs/journeys.md +++ b/docs/journeys.md @@ -74,7 +74,7 @@ With `opt`, you can override the default options, which look like this: ## Response -*Note:* As stated in the [*Friendly Public Transport Format* `1.0.1`](https://github.com/public-transport/friendly-public-transport-format/tree/1.0.1), the returned `departure` and `arrival` times include the current delay. The `departureDelay`/`arrivalDelay` fields express how much they differ from the schedule. +*Note:* As stated in the [*Friendly Public Transport Format* `1.1.1`](https://github.com/public-transport/friendly-public-transport-format/tree/1.1.1), the returned `departure` and `arrival` times include the current delay. The `departureDelay`/`arrivalDelay` fields express how much they differ from the schedule. As an example, we're going to use the [VBB profile](../p/vbb): diff --git a/docs/nearby.md b/docs/nearby.md index 20186c46..21123b8f 100644 --- a/docs/nearby.md +++ b/docs/nearby.md @@ -2,7 +2,7 @@ This method can be used to find stations close to a location. Note that it is not supported by every profile/endpoint. -`location` must be an [*FPTF* `location` object](https://github.com/public-transport/friendly-public-transport-format/blob/1.0.1/spec/readme.md#location-objects). +`location` must be an [*FPTF* `location` object](https://github.com/public-transport/friendly-public-transport-format/blob/1.1.1/spec/readme.md#location-objects). With `opt`, you can override the default options, which look like this: diff --git a/docs/radar.md b/docs/radar.md index f5502308..308f6dce 100644 --- a/docs/radar.md +++ b/docs/radar.md @@ -18,7 +18,7 @@ With `opt`, you can override the default options, which look like this: ## Response -*Note:* As stated in the [*Friendly Public Transport Format* `1.0.1`](https://github.com/public-transport/friendly-public-transport-format/tree/1.0.1), the returned `departure` and `arrival` times include the current delay. The `departureDelay`/`arrivalDelay` fields express how much they differ from the schedule. +*Note:* As stated in the [*Friendly Public Transport Format* `1.1.1`](https://github.com/public-transport/friendly-public-transport-format/tree/1.1.1), the returned `departure` and `arrival` times include the current delay. The `departureDelay`/`arrivalDelay` fields express how much they differ from the schedule. As an example, we're going to use the [VBB profile](../p/vbb): diff --git a/docs/refresh-journey.md b/docs/refresh-journey.md index 94e6025c..1d2da5e6 100644 --- a/docs/refresh-journey.md +++ b/docs/refresh-journey.md @@ -35,4 +35,4 @@ client.journeys('900000003201', '900000100008', {results: 1}) .catch(console.error) ``` -`refreshJourney()` will return a *single* [*Friendly Public Transport Format* `1.0.1`](https://github.com/public-transport/friendly-public-transport-format/tree/1.0.1) `journey`, in the same format as with `journeys()`. +`refreshJourney()` will return a *single* [*Friendly Public Transport Format* `1.1.1`](https://github.com/public-transport/friendly-public-transport-format/tree/1.1.1) `journey`, in the same format as with `journeys()`. diff --git a/docs/trip.md b/docs/trip.md index 9d1b34fe..b4f0976e 100644 --- a/docs/trip.md +++ b/docs/trip.md @@ -36,7 +36,7 @@ With `opt`, you can override the default options, which look like this: ## Response -*Note:* As stated in the [*Friendly Public Transport Format* `1.0.1`](https://github.com/public-transport/friendly-public-transport-format/tree/1.0.1), the returned `departure` and `arrival` times include the current delay. The `departureDelay`/`arrivalDelay` fields express how much they differ from the schedule. +*Note:* As stated in the [*Friendly Public Transport Format* `1.1.1`](https://github.com/public-transport/friendly-public-transport-format/tree/1.1.1), the returned `departure` and `arrival` times include the current delay. The `departureDelay`/`arrivalDelay` fields express how much they differ from the schedule. As an example, we're going to use the [VBB profile](../p/vbb): diff --git a/docs/writing-a-profile.md b/docs/writing-a-profile.md index 01bee324..426dfae2 100644 --- a/docs/writing-a-profile.md +++ b/docs/writing-a-profile.md @@ -84,7 +84,7 @@ You may want to use the [profile boilerplate code](profile-boilerplate.js). In `hafas-client`, there's a difference between the `mode` and the `product` field: -- The `mode` field describes the mode of transport in general. [Standardised by the *Friendly Public Transport Format* `1.0.1`](https://github.com/public-transport/friendly-public-transport-format/blob/1.0.1/spec/readme.md#modes), it is on purpose limited to a very small number of possible values, e.g. `train` or `bus`. +- The `mode` field describes the mode of transport in general. [Standardised by the *Friendly Public Transport Format* `1.1.1`](https://github.com/public-transport/friendly-public-transport-format/blob/1.1.1/spec/readme.md#modes), it is on purpose limited to a very small number of possible values, e.g. `train` or `bus`. - The value for `product` relates to how a means of transport "works" *in local context*. Example: Even though [*S-Bahn*](https://en.wikipedia.org/wiki/Berlin_S-Bahn) and [*U-Bahn*](https://en.wikipedia.org/wiki/Berlin_U-Bahn) in Berlin are both `train`s, they have different operators, service patterns, stations and look different. Therefore, they are two distinct `product`s `subway` and `suburban`. **Specify `product`s that appear in the app** you recorded requests of. For a fictional transit network, this may look like this: @@ -113,13 +113,13 @@ const products = [ Let's break this down: - `id`: A sensible, [camelCased](https://en.wikipedia.org/wiki/Camel_case#Variations_and_synonyms), alphanumeric identifier. Use it for the key in the `products` array as well. -- `mode`: A [valid *Friendly Public Transport Format* `1.0.1` mode](https://github.com/public-transport/friendly-public-transport-format/blob/1.0.1/spec/readme.md#modes). +- `mode`: A [valid *Friendly Public Transport Format* `1.1.1` mode](https://github.com/public-transport/friendly-public-transport-format/blob/1.1.1/spec/readme.md#modes). - `bitmasks`: HAFAS endpoints work with a [bitmask](https://en.wikipedia.org/wiki/Mask_(computing)#Arguments_to_functions) that toggles the individual products. It should be an array of values that toggle the appropriate bit(s) in the bitmask (see below). - `name`: A short, but distinct name for the means of transport, *just precise enough in local context*, and in the local language. In Berlin, `S-Bahn-Schnellzug` would be too much, because everyone knows what `S-Bahn` means. - `short`: The shortest possible symbol that identifies the product. - `default`: Should the product be used for queries (e.g. journeys) by default? -If you want, you can now **verify that the profile works**; We've prepared [a script](https://runkit.com/derhuerst/hafas-client-profile-example/0.2.0) for that. Alternatively, [submit a Pull Request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/) and we will help you out with testing and improvements. +If you want, you can now **verify that the profile works**; We've prepared [a script](https://runkit.com/derhuerst/hafas-client-profile-example/0.2.1) for that. Alternatively, [submit a Pull Request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/) and we will help you out with testing and improvements. ### Finding the right values for the `bitmasks` field @@ -138,7 +138,7 @@ all but product F 30 11110 31 - 2^0 2^0 We consider these improvements to be *optional*: -- **Check if the endpoint supports the journey legs call.** +- **Check if the endpoint supports the trips call.** - In the app, check if you can query details for the status of a single journey leg. It should load realtime delays and the current progress. - If this feature is supported, add `trip: true` to the profile. - **Check if the endpoint supports the live map call.** Does the app have a "live map" showing all vehicles within an area? If so, add `radar: true` to the profile. diff --git a/p/oebb/readme.md b/p/oebb/readme.md index 7a9a6d19..1771c420 100644 --- a/p/oebb/readme.md +++ b/p/oebb/readme.md @@ -16,4 +16,4 @@ const client = createClient(oebbProfile, 'my-awesome-program') ## Customisations - parses *ÖBB*-specific products (such as *RailJet*) -- parses invalid empty stations from the API as [`location`](https://github.com/public-transport/friendly-public-transport-format/blob/1.0.1/spec/readme.md#location-objects)s +- parses invalid empty stations from the API as [`location`](https://github.com/public-transport/friendly-public-transport-format/blob/1.1.1/spec/readme.md#location-objects)s diff --git a/readme.md b/readme.md index e972c704..45e8a331 100644 --- a/readme.md +++ b/readme.md @@ -22,7 +22,7 @@ HAFAS endpoint | wrapper library | docs | example code | source code There's [a company called HaCon](http://hacon.de) that sells [a public transport management system called HAFAS](https://de.wikipedia.org/wiki/HAFAS). It is [used by companies all over Europe](https://gist.github.com/derhuerst/2b7ed83bfa5f115125a5) to serve routing and departure information for apps. All those endpoints are similar, with the same terms and API routes, but have slightly different options, filters and sets of enabled features. -`hafas-client` contains all logic for communicating with these, as well as serialising from and parsing to [*Friendly Public Transport Format (FPTF)* `1.0.1`](https://github.com/public-transport/friendly-public-transport-format/blob/1.0.1/spec/readme.md). Endpoint-specific customisations (called *profiles* here) increase the quality of the returned data. +`hafas-client` contains all logic for communicating with these, as well as serialising from and parsing to [*Friendly Public Transport Format (FPTF)* `1.1.1`](https://github.com/public-transport/friendly-public-transport-format/blob/1.1.1/spec/readme.md). Endpoint-specific customisations (called *profiles* here) increase the quality of the returned data. ## Installing @@ -56,7 +56,7 @@ client.journeys('8011167', '8000261', {results: 1}) .catch(console.error) ``` -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). +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.1.1/spec/readme.md#journey). ```js [ {