Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #48 - Enhanced the readability of docs #49

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions frontend/javascript/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ function enableDocSearch() {
});
}



function enableScrollToTop() {
const scrollToTopBtn = document.getElementById('scrollToTopBtn');
window.addEventListener('scroll', () => {
Expand All @@ -49,6 +51,8 @@ function enableScrollToTop() {
});
}



document.addEventListener("DOMContentLoaded", function(event) {
const codeBlocks = document.querySelectorAll('pre code');
codeBlocks.forEach(function(block) {
Expand Down
2 changes: 2 additions & 0 deletions frontend/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ pre.highlight {
padding: 0!important;
}



@tailwind utilities;
4 changes: 2 additions & 2 deletions src/api/where/elements/agency.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: page
title: Agency Element
---

The `<agency/>` element models agencies in OneBusAway. Agencies are directly mapped from entries in the [GTFS agency.txt](http://code.google.com/transit/spec/transit_feed_specification.html#agency_txt___Field_Definitions) file from the GTFS feeds that power an API instance.
The **`<agency/>`** element models agencies in OneBusAway. Agencies are directly mapped from entries in the [GTFS agency.txt](http://code.google.com/transit/spec/transit_feed_specification.html#agency_txt___Field_Definitions) file from the GTFS feeds that power an API instance.

## Example

Expand All @@ -23,5 +23,5 @@ The fields of the agency element closely match the fields defined for agencies i

A few important details:

* The only fields that are required are `id`, `name`, `url`, and `timezone`.
* The only fields that are required are **`id`**, **`name`**, **`url`**, and **`timezone`**.
* The disclaimer field is an additional field that includes any legal disclaimer that transit agencies would like displayed to users when using the agency's data in an application.
48 changes: 24 additions & 24 deletions src/api/where/elements/arrival-and-departure.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: page
title: arrivalAndDeparture Element
---

The `<arrivalAndDeparture/>` element captures information about the arrival and departure of a transit vehicle at a transit stop. The element is returned as a sub-element in the following api methods:
The **`<arrivalAndDeparture/>`** element captures information about the arrival and departure of a transit vehicle at a transit stop. The element is returned as a sub-element in the following api methods:

* [arrivals-and-departures-for-stop](/api/where/methods/arrivals-and-departures-for-stop)
* [arrival-and-departure-for-stop](/api/where/methods/arrival-and-departure-for-stop)
Expand Down Expand Up @@ -35,30 +35,30 @@ The `<arrivalAndDeparture/>` element captures information about the arrival and

## Details

* `routeId` - the route id for the arriving vehicle
* `tripId` - the trip id for the arriving vehicle
* `serviceDate` - time, in ms since the unix epoch, of midnight for start of the service date for the trip.
* `stopId` - the stop id of the stop the vehicle is arriving at
* `stopSequence` - the index of the stop into the sequence of stops that make up the trip for this arrival. This value is 0-indexed, and is generated internally by OneBusAway (it is not the GTFS stop_sequence). The first stop in the trip will always have stopSequence = 0, while the last stop in the trip will always have stopSequence = totalStopsInTrip - 1.
* `totalStopsInTrip` - the total number of stops visited on the trip for this arrival. If the same stop is visited more than once in this trip, each visitation is counted towards the total.
* `blockTripSequence` - the index of this arrival's trip into the sequence of trips for the active block. Compare to `blockTripSequence` in the [OneBusAwayRestApi_TripStatusElementV2 tripStatus element] to determine where the arrival-and-departure is on the block in comparison to the active block location.
* `routeShortName` - the route short name that potentially overrides the route short name in the referenced [`<route/>` element](/api/where/elements/route) - *OPTIONAL*
* `routeLongName` - the route long name that potentially overrides the route long name in the referenced [`<route/>` element](/api/where/elements/route) - *OPTIONAL*
* `tripHeadsign` - the trip headsign that potentially overrides the trip headsign in the referenced [`<trip/>` element](/api/where/elements/trip) - *OPTIONAL*
* `arrivalEnabled` - true if this transit vehicle is one that riders could arrive on
* `departureEnabled` - true if this transit vehicle is one that riders can depart on
* `scheduledArrivalTime` - scheduled arrival time, ms since unix epoch
* `scheduledDepartureTime` - scheduled departure time, ms since unix epoch
* `frequency` - information about [frequency based scheduling](/api/where/elements/frequency), if applicable to the trip - *OPTIONAL*
* `predicted` - true if we have real-time arrival info available for this trip
* `predictedArrivalTime` - predicted arrival time, ms since unix epoch, zero if no real-time available
* `predictedDepartureTime` - predicted departure time, ms since unix epoch, zero if no real-time available
* `distanceFromStop` - distance of the arriving transit vehicle from the stop, in meters
* `numberOfStopsAway` - the number of stops between the arriving transit vehicle and the current stop (doesn't include the current stop)
* `tripStatus` - [`<tripStatus/>` element](/api/where/elements/trip-status) giving trip-specific status for the arriving transit vehicle - *OPTIONAL*
* **`routeId`** - the route id for the arriving vehicle
* **`tripId`** - the trip id for the arriving vehicle
* **`serviceDate`** - time, in ms since the unix epoch, of midnight for start of the service date for the trip.
* **`stopId`** - the stop id of the stop the vehicle is arriving at
* **`stopSequence`** - the index of the stop into the sequence of stops that make up the trip for this arrival. This value is 0-indexed, and is generated internally by OneBusAway (it is not the GTFS stop_sequence). The first stop in the trip will always have stopSequence = 0, while the last stop in the trip will always have stopSequence = totalStopsInTrip - 1.
* **`totalStopsInTrip`** - the total number of stops visited on the trip for this arrival. If the same stop is visited more than once in this trip, each visitation is counted towards the total.
* **`blockTripSequence`** - the index of this arrival's trip into the sequence of trips for the active block. Compare to **`blockTripSequence`** in the [OneBusAwayRestApi_TripStatusElementV2 tripStatus element] to determine where the arrival-and-departure is on the block in comparison to the active block location.
* **`routeShortName`** - the route short name that potentially overrides the route short name in the referenced [**`<route/>`**](/api/where/elements/route) element - *OPTIONAL*
* **`routeLongName`** - the route long name that potentially overrides the route long name in the referenced [**`<route/>`** element](/api/where/elements/route) - *OPTIONAL*
* **`tripHeadsign`** - the trip headsign that potentially overrides the trip headsign in the referenced [**`<trip/>`**](/api/where/elements/trip) element - *OPTIONAL*
* **`arrivalEnabled`** - true if this transit vehicle is one that riders could arrive on
* **`departureEnabled`** - true if this transit vehicle is one that riders can depart on
* **`scheduledArrivalTime`** - scheduled arrival time, ms since unix epoch
* **`scheduledDepartureTime`** - scheduled departure time, ms since unix epoch
* **`frequency`** - information about [frequency based scheduling](/api/where/elements/frequency), if applicable to the trip - *OPTIONAL*
* **`predicted`** - true if we have real-time arrival info available for this trip
* **`predictedArrivalTime`** - predicted arrival time, ms since unix epoch, zero if no real-time available
* **`predictedDepartureTime`** - predicted departure time, ms since unix epoch, zero if no real-time available
* **`distanceFromStop`** - distance of the arriving transit vehicle from the stop, in meters
* **`numberOfStopsAway`** - the number of stops between the arriving transit vehicle and the current stop (doesn't include the current stop)
* **`tripStatus`** - [**`<tripStatus/>`**](/api/where/elements/trip-status) element giving trip-specific status for the arriving transit vehicle - *OPTIONAL*

## Notes

It's important to note that the active trip contained in the `<tripStatus/>` element may be different than the `tripId` specified in the `<arrivalAndDeparture/>`, especially in the case of blocks of trips where the vehicle is currently servicing the previous trip that will link to the trip that will ultimately service the current stop.
It's important to note that the active trip contained in the **`<tripStatus/>`** element may be different than the **`tripId`** specified in the **`<arrivalAndDeparture/>`**, especially in the case of blocks of trips where the vehicle is currently servicing the previous trip that will link to the trip that will ultimately service the current stop.

In order to support frequency-based scheduling in legacy clients, we will set the `scheduledArrivalTime` and `scheduledDepartureTime` to be the current time + the headway for frequency-based scheduled trips.
In order to support frequency-based scheduling in legacy clients, we will set the **`scheduledArrivalTime`** and **`scheduledDepartureTime`** to be the current time + the headway for frequency-based scheduled trips.
38 changes: 19 additions & 19 deletions src/api/where/elements/block-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ layout: page
title: blockConfiguration Element
---

A `<blockConfiguration/>` captures a sequence of block trips active on a particular service date. Recall that a block is a sequence of linked trips operated by the same vehicle. Unfortunately, that set of trips is not always the same. For example, the last trip of a block may typically be active, but might be left of during a holiday.
A **`<blockConfiguration/>`** captures a sequence of block trips active on a particular service date. Recall that a block is a sequence of linked trips operated by the same vehicle. Unfortunately, that set of trips is not always the same. For example, the last trip of a block may typically be active, but might be left of during a holiday.

To help model these situations correctly, we have the concept of a block configuration: a sequence of block trips that are active for a particular block on a particular service date. The active service date is determined by the combination of active and inactive service ids on that date. See the [`<trip/>`](/api/where/elements/trip) element and the [GTFS spec](http://code.google.com/transit/spec/transit_feed_specification.html#trips_txt___Field_Definitions) for more discussion of service ids and how they determine when a trip is active.
To help model these situations correctly, we have the concept of a block configuration: a sequence of block trips that are active for a particular block on a particular service date. The active service date is determined by the combination of active and inactive service ids on that date. See the [**`<trip/>`**](/api/where/elements/trip) element and the [GTFS spec](http://code.google.com/transit/spec/transit_feed_specification.html#trips_txt___Field_Definitions) for more discussion of service ids and how they determine when a trip is active.

In addition to service id information, the block configuration contains the list of active block trips.

Expand Down Expand Up @@ -43,30 +43,30 @@ In addition to service id information, the block configuration contains the list

## Details

The `<blockConfiguration/>` element has the following sub-elements:
The **`<blockConfiguration/>`** element has the following sub-elements:

* activeServiceIds - a collection of strings indicating which service ids are active for the block configuration
* inactiveServiceIds - a collection of strings indicating which service ids are NOT active for the block configuration
* trips - the sequence of `<blockTrip/>` elements for each block trip in the configuration
* **`activeServiceIds`** - a collection of strings indicating which service ids are active for the block configuration
* **`inactiveServiceIds`** - a collection of strings indicating which service ids are NOT active for the block configuration
* **`trips`** - the sequence of **`<blockTrip/>`** elements for each block trip in the configuration

The block trip has the following properties:

* tripId - id of the referenced [`<trip/>`](/api/where/elements/trip) element
* block stop times - see below
* accumulated slack time - how much slack time from layovers has been accumulated from previous block trips in the block up to the start of this block
* distanceAlongBlock - how far along the block, in meters, is the start of this trip
* **`tripId`** - id of the referenced [**`<trip/>`**](/api/where/elements/trip) element
* **`block stop times`** - see below
* **`accumulated slack time`** - how much slack time from layovers has been accumulated from previous block trips in the block up to the start of this block
* **`distanceAlongBlock`** - how far along the block, in meters, is the start of this trip

Block stop times capture the individually scheduled stops along each trip. We provide the following fields:

* blockSequence - the index of the block stop time in the list of all scheduled stops for the block configuration
* distanceAlongBlock - how far along the block, in meters, this stop occurs
* accumulatedSlackTime - how much slack time from layovers has been accumulated previous along the block up until, but not including, this stop
* stopTime - reference to the general stop time for the trip - see below
* **`blockSequence`** - the index of the block stop time in the list of all scheduled stops for the block configuration
* **`distanceAlongBlock`** - how far along the block, in meters, this stop occurs
* **`accumulatedSlackTime`** - how much slack time from layovers has been accumulated previous along the block up until, but not including, this stop
* **`stopTime`** - reference to the general stop time for the trip - see below

A stop time is a more general notion of a scheduled stop along a trip:

* stopId - id of the referenced [`<stop/>`](/api/where/elements/stop) element
* arrivalTime - time, in seconds from the start of the service date
* departureTime - time, in seconds from the start of the service date
* pickupType - see the [GTFS spec](http://code.google.com/transit/spec/transit_feed_specification.html#stop_times_txt___Field_Definitions)
* dropOffType - see the [GTFS spec](http://code.google.com/transit/spec/transit_feed_specification.html#stop_times_txt___Field_Definitions)
* **`stopId`** - id of the referenced [**`<stop/>`**](/api/where/elements/stop) element
* **`arrivalTime`** - time, in seconds from the start of the service date
* **`departureTime`** - time, in seconds from the start of the service date
* **`pickupType`** - see the [GTFS spec](http://code.google.com/transit/spec/transit_feed_specification.html#stop_times_txt___Field_Definitions)
* **`dropOffType`** - see the [GTFS spec](http://code.google.com/transit/spec/transit_feed_specification.html#stop_times_txt___Field_Definitions)
8 changes: 4 additions & 4 deletions src/api/where/elements/frequency.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: page
title: Frequency Element
---

The `<frequency/>` element captures information about a trip that uses frequency-based scheduling. Frequency-based scheduling is where a trip doesn't have specifically scheduled stop times, but instead just a headway specifying the frequency of service (ex. service every 10 minutes). The `<frequency/>` element can be a sub-element of a number of other elements:
The **`<frequency/>`** element captures information about a trip that uses frequency-based scheduling. Frequency-based scheduling is where a trip doesn't have specifically scheduled stop times, but instead just a headway specifying the frequency of service (ex. service every 10 minutes). The **`<frequency/>`** element can be a sub-element of a number of other elements:

* [arrivalAndDeparture](/api/where/elements/arrival-and-departure)
* [tripStatus](/api/where/elements/trip-status)
Expand All @@ -20,6 +20,6 @@ The `<frequency/>` element captures information about a trip that uses frequency

We include three fields:

* `startTime` - the start time (unix timestamp) when the frequency block starts
* `endTime` - the end time (unix timestamp) when the frequency block ends
* `headway` - the frequency of service, in seconds
* **`startTime`** - the start time (unix timestamp) when the frequency block starts
* **`endTime`** - the end time (unix timestamp) when the frequency block ends
* **`headway`** - the frequency of service, in seconds
8 changes: 4 additions & 4 deletions src/api/where/elements/list-result.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ Many API methods return a list of elements as their response. There are a coupl

## Request

Many list response methods accept a `maxCount` parameter that controls the maximum number of elements returned in a response. Each method has a default value for `maxCount`, which you can override to get more or less results. Note that most methods also have an upper limit on the number of results they will return, no matter how large you set `maxCount`.
Many list response methods accept a **`maxCount`** parameter that controls the maximum number of elements returned in a response. Each method has a default value for **`maxCount`**, which you can override to get more or less results. Note that most methods also have an upper limit on the number of results they will return, no matter how large you set **`maxCount`**.

## Response

The response is composed of two elements. The first, `<list/>`, is the actual list of elements returned by the method. The type of element for individual list entries is determined by the method.
The response is composed of two elements. The first, **`<list/>`**, is the actual list of elements returned by the method. The type of element for individual list entries is determined by the method.

Additionally, the list response will have a `<limitExceeded/>` element, which a single true or false value. This value will be true if the number of elements that could have been potentially returned exceeded the limit sent by `maxCount`, either explicitly or the default value.
Additionally, the list response will have a **`<limitExceeded/>`** element, which a single true or false value. This value will be true if the number of elements that could have been potentially returned exceeded the limit sent by **`maxCount`**, either explicitly or the default value.

Finally, some responses will also include an `<outOfRange/>` element, which will indicate if the search request was made outside the current areas of service for OneBusAway (see [agencies-with-coverage](/api/where/methods/agencies-with-coverage)). The following geographic query methods currently include the `<outOfRange/>` element:
Finally, some responses will also include an **`<outOfRange/>`** element, which will indicate if the search request was made outside the current areas of service for OneBusAway (see [agencies-with-coverage](/api/where/methods/agencies-with-coverage)). The following geographic query methods currently include the **`<outOfRange/>`** element:

* [routes-for-location](/api/where/methods/routes-for-location)
* [stops-for-location](/api/where/methods/stops-for-location)
Expand Down
Loading