minor readme/documentation tweaks 📝

- stop(): add `remarks: true` default
- journeys(): more intuitive options order
- readme: fix build status badge
This commit is contained in:
Jannis R 2020-05-21 17:31:51 +02:00
parent e02a20b1de
commit b302ba75d2
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
3 changed files with 10 additions and 9 deletions

View file

@ -55,6 +55,9 @@ With `opt`, you can override the default options, which look like this:
transferTime: 0, // minimum time for a single transfer in minutes
accessibility: 'none', // 'none', 'partial' or 'complete'
bike: false, // only bike-friendly journeys
walkingSpeed: 'normal', // 'slow', 'normal', 'fast'
// Consider walking to nearby stations at the beginning of a journey?
startWithWalking: true,
products: {
// these entries may vary from profile to profile
suburban: true,
@ -68,11 +71,8 @@ With `opt`, you can override the default options, which look like this:
tickets: false, // return tickets? only available with some profiles
polylines: false, // return a shape for each leg?
remarks: true, // parse & expose hints & warnings?
// Consider walking to nearby stations at the beginning of a journey?
walkingSpeed: 'normal', // 'slow', 'normal', 'fast'
startWithWalking: true,
scheduledDays: false, // parse which days each journey is valid on
language: 'en', // language to get results in
scheduledDays: false // parse which days each journey is valid on
}
```

View file

@ -121,12 +121,12 @@ const createClient = (profile, userAgent, opt = {}) => {
// todo: does this work with every endpoint?
accessibility: 'none', // 'none', 'partial' or 'complete'
bike: false, // only bike-friendly journeys
tickets: false, // return tickets?
polylines: false, // return leg shapes?
remarks: true, // parse & expose hints & warnings?
walkingSpeed: 'normal', // 'slow', 'normal', 'fast'
// Consider walking to nearby stations at the beginning of a journey?
startWithWalking: true,
tickets: false, // return tickets?
polylines: false, // return leg shapes?
remarks: true, // parse & expose hints & warnings?
scheduledDays: false
}, opt)
if (opt.via) opt.via = profile.formatLocation(profile, opt.via, 'opt.via')
@ -299,7 +299,8 @@ const createClient = (profile, userAgent, opt = {}) => {
else throw new TypeError('stop must be an object or a string.')
opt = Object.assign({
linesOfStops: false // parse & expose lines at the stop/station?
linesOfStops: false, // parse & expose lines at the stop/station?
remarks: true, // parse & expose hints & warnings?
}, opt)
const req = profile.formatStopReq({profile, opt}, stop)

View file

@ -3,7 +3,7 @@
**A client for the "mobile APIs" of [HAFAS](https://de.wikipedia.org/wiki/HAFAS) public transport management systems**.
[![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/public-transport/hafas-client.svg?branch=3)](https://travis-ci.org/public-transport/hafas-client)
[![build status](https://img.shields.io/travis/public-transport/hafas-client.svg?branch=5)](https://travis-ci.org/public-transport/hafas-client)
![ISC-licensed](https://img.shields.io/github/license/public-transport/hafas-client.svg)
[![chat on gitter](https://badges.gitter.im/public-transport/Lobby.svg)](https://gitter.im/public-transport/Lobby)
[![support Jannis via GitHub Sponsors](https://img.shields.io/badge/support%20Jannis-donate-fa7664.svg)](https://github.com/sponsors/derhuerst)