diff --git a/docs/departures.md b/docs/departures.md index 9620331d..b0217f14 100644 --- a/docs/departures.md +++ b/docs/departures.md @@ -31,7 +31,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` include 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.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. You may pass the `journeyId` field into [`journeyLeg(ref, lineName, [opt])`](journey-leg.md) to get details on the vehicle's journey. diff --git a/docs/journeys.md b/docs/journeys.md index 98cca95e..47ec0c9e 100644 --- a/docs/journeys.md +++ b/docs/journeys.md @@ -199,7 +199,7 @@ The response may look like this: } ] ``` -If you pass `tickets: true`, each `journey` will have a tickets array that looks like this: +Some [profiles](../p) are able to parse the ticket information, if returned by the API. For example, if you pass `tickets: true` with the [VBB profile](../p/vbb), each `journey` will have a tickets array that looks like this: ```js [ { diff --git a/p/readme.md b/p/readme.md new file mode 100644 index 00000000..dea7cc16 --- /dev/null +++ b/p/readme.md @@ -0,0 +1,15 @@ +# Profiles + +This directory contains specific customisations for each endpoint, called *profiles*. They **parse data from the API differently, add additional information, or enable non-default methods** (such as [`journeyLeg`](../docs/journey-leg.md)) if they are supported. + +Each profile has it's own directory. It will be passed into `hafas-client` and is expected to be in a certain structure: + +```js +const createClient = require('hafas-client') +const someProfile = require('hafas-client/p/some-profile') + +// create a client with the profile +const client = createClient(dbProfile) + +// use it to query data… +```