From b302ba75d29fe00e26aedbaf93af65f624a553d9 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Thu, 21 May 2020 17:31:51 +0200 Subject: [PATCH] minor readme/documentation tweaks :memo: - stop(): add `remarks: true` default - journeys(): more intuitive options order - readme: fix build status badge --- docs/journeys.md | 8 ++++---- index.js | 9 +++++---- readme.md | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/journeys.md b/docs/journeys.md index ea6c7c79..45a7968b 100644 --- a/docs/journeys.md +++ b/docs/journeys.md @@ -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 } ``` diff --git a/index.js b/index.js index 19690efb..83d0fc28 100644 --- a/index.js +++ b/index.js @@ -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) diff --git a/readme.md b/readme.md index f150ec71..7c631229 100644 --- a/readme.md +++ b/readme.md @@ -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)