gtfs-to-html 2.2.1 → 2.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,26 @@
1
+ ---
2
+ slug: timetables_as_csv
3
+ title: New Feature - GTFS timetables as CSV
4
+ author: Brendan Nee
5
+ author_url: https://github.com/brendannee
6
+ author_image_url: https://avatars3.githubusercontent.com/u/96217?s=400&v=4
7
+ tags: [csv]
8
+ ---
9
+
10
+ GTFS-to-HTML Version 2.3.0 adds support for exporting timetables as CSV. Setting the [outputFormat](https://gtfstohtml.com/docs/configuration#outputformat) configuration to `csv` will generate CSV files instead of HTML. One CSV file per timetable will be generated.
11
+
12
+ An example of a CSV timetable:
13
+
14
+ ```
15
+ ,San Francisco Ferry Building,Vallejo Ferry Terminal,Mare Island Ferry Terminal
16
+ Run #1,10:30am,11:30am,
17
+ Run #2,11:30am,12:30pm,
18
+ Run #3,1:50pm,2:50pm,
19
+ Run #4,2:50pm,3:50pm,
20
+ Run #5,4:10pm,5:10pm,5:25pm
21
+ Run #6,5:10pm,6:10pm,6:25pm
22
+ Run #7,6:30pm,7:30pm,
23
+ Run #8,8:50pm,9:50pm,10:05pm
24
+ ```
25
+
26
+ Timetables in CSV respect the `orientation` set in `timetables.txt` or `defaultOrientation` in `config.json`, they can be either `horizontal` or `vertical`.
@@ -3,7 +3,7 @@ id: configuration
3
3
  title: Configuration Options
4
4
  ---
5
5
 
6
- GTFS-to-HTML reads its configuration from a JSON file. To get started, copy `config-sample.json` to `config.json` and then add your project's configuration to `config.json`.
6
+ GTFS-to-HTML reads its configuration from a JSON file. To get started, copy `config-sample.json` to `config.json` and then add your project's configuration to `config.json`.
7
7
 
8
8
  cp config-sample.json config.json
9
9
 
@@ -13,53 +13,53 @@ Ensure that your config.json is [valid JSON](https://jsonformatter.curiousconcep
13
13
  All files starting with `config*.json` are .gitignored - so you can create multiple configuration files such as `config-caltrain.json`.
14
14
  :::
15
15
 
16
- | option | type | description |
17
- | ------ | ---- | ----------- |
18
- | [`agencies`](#agencies) | array | An array of GTFS files to be imported. |
19
- | [`allowEmptyTimetables`](#allowemptytimetables) | boolean | Whether or not to generate timetables that have no trips. |
20
- | [`beautify`](#beautify) | boolean | Whether or not to beautify the HTML output. |
21
- | [`coordinatePrecision`](#coordinateprecision) | integer | Number of decimal places to include in geoJSON map output. |
22
- | [`dateFormat`](#dateformat) | string | A string defining date format in moment.js style. |
23
- | [`dayShortStrings`](#dayshortstrings) | array of strings | An array defining contractions of weekdays names from Monday to Sunday. |
24
- | [`dayStrings`](#daystrings) | array of strings | An array defining weekdays names from Monday to Sunday. |
25
- | [`debug`](#debug) | boolean | Enable logging of SQL queries and other info. |
26
- | [`defaultOrientation`](#defaultorientation) | string | Specify timetable orientation, when not specified in `timetables.txt`. |
27
- | [`effectiveDate`](#effectivedate) | string | A date to print at the top of the timetable. |
28
- | [`interpolatedStopSymbol`](#interpolatedstopsymbol) | string | The symbol used to indicate that a timepoint isn't fixed, but just interpolated. |
29
- | [`interpolatedStopText`](#interpolatedstoptext) | string | The text used to describe a timepoint isn't fixed, but just interpolated. |
30
- | [`linkStopUrls`](#linkStopurls) | boolean | Whether or not to hyperlink timetable stop names to the `stop_url` defined in `stops.txt`. |
31
- | [`logFunction`](#logfunction) | function | A custom logging function for handling output of logs. |
32
- | [`mapboxAccessToken`](#mapboxaccesstoken) | string | The Mapbox access token for generating a map of the route. |
33
- | [`menuType`](#menutype) | string | The type of menu to use for selecting timetables on a timetable page. |
34
- | [`noDropoffSymbol`](#nodropoffsymbol) | string | The symbol used to indicate ta stop where no drop off is available. |
35
- | [`noDropoffText`](#nodropofftext) | string | The text used to describe a stop where no drop off is available. |
36
- | [`noHead`](#nohead) | boolean | Whether or not to skip the header and footer of the HTML document. |
37
- | [`noServiceSymbol`](#noservicesymbol) | string | The symbol used when a specific trip does not serve a specified stop. |
38
- | [`noServiceText`](#noservicetext) | string | The text used to describe a stop which is not served by a specific trip. |
39
- | [`outputFormat`](#outputformat) | string | The file format of the timetables generated. Either `html` or `pdf`. |
40
- | [`noPickupSymbol`](#nopickupsymbol) | string | The symbol used to indicate a stop where no pickup is available. |
41
- | [`noPickupText`](#nopickuptext) | string | The text used to describe a stop where no pickup is available. |
42
- | [`requestDropoffSymbol`](#requestdropoffsymbol) | string | The symbol used to indicate a stop where riders must request a drop off. |
43
- | [`requestDropoffText`](#requestdropofftext) | string | The text used to describe a stop where riders must request a drop off. |
44
- | [`requestPickupSymbol`](#requestpickupsymbol) | string | The symbol used to indicate a stop where riders must request a pickup. |
45
- | [`requestPickupText`](#requestpickuptext) | string | The text used to describe a stop where riders must request a pickup. |
46
- | [`serviceNotProvidedOnText`](#servicenotprovidedontext) | string | The text used to label days where service is not provided. |
47
- | [`serviceProvidedOnText`](#serviceprovidedontext) | string | The text used to label days where service is provided. |
48
- | [`showArrivalOnDifference`](#showarrivalondifference) | float | Defines a difference between departure and arrival, on which arrival column/row will be shown. |
49
- | [`showMap`](#showmap) | boolean | Whether or not to show a map of the route on the timetable. |
50
- | [`showOnlyTimepoint`](#showonlytimepoint) | boolean | Whether or not all stops should be shown, or only stops with a `timepoint` value in `stops.txt`. |
51
- | [`showRouteTitle`](#showroutetitle) | boolean | Whether or not to show the route title at the top of the timetable page. |
52
- | [`showStopCity`](#showstopcity) | boolean | Whether or not to show each stop's city. |
53
- | [`showStopDescription`](#showstopdescription) | boolean | Whether or not to show a stop description. |
54
- | [`showStoptimesForRequestStops`](#showstoptimesforrequeststops) | boolean | Whether or not to show times for stops that require a request for pickup or dropoff. |
55
- | [`skipImport`](#skipimport) | boolean | Whether or not to skip importing GTFS data into SQLite. |
56
- | [`sortingAlgorithm`](#sortingalgorithm) | string | Defines the trip-sorting algorithm. |
57
- | [`sqlitePath`](#sqlitepath) | string | A path to an SQLite database. Optional, defaults to using an in-memory database. |
58
- | [`templatePath`](#templatepath) | string | Path to custom pug template for rendering timetable. |
59
- | [`timeFormat`](#timeformat) | string | A string defining time format in moment.js style. |
60
- | [`useParentStation`](#useparentstation) | boolean | Whether or not to use a stop's `parent_station`. |
61
- | [`verbose`](#verbose) | boolean | Whether or not to print output to the console. |
62
- | [`zipOutput`](#zipoutput) | boolean | Whether or not to zip the output into one zip file. |
16
+ | option | type | description |
17
+ | --------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------ |
18
+ | [`agencies`](#agencies) | array | An array of GTFS files to be imported. |
19
+ | [`allowEmptyTimetables`](#allowemptytimetables) | boolean | Whether or not to generate timetables that have no trips. |
20
+ | [`beautify`](#beautify) | boolean | Whether or not to beautify the HTML output. |
21
+ | [`coordinatePrecision`](#coordinateprecision) | integer | Number of decimal places to include in geoJSON map output. |
22
+ | [`dateFormat`](#dateformat) | string | A string defining date format in moment.js style. |
23
+ | [`dayShortStrings`](#dayshortstrings) | array of strings | An array defining contractions of weekdays names from Monday to Sunday. |
24
+ | [`dayStrings`](#daystrings) | array of strings | An array defining weekdays names from Monday to Sunday. |
25
+ | [`debug`](#debug) | boolean | Enable logging of SQL queries and other info. |
26
+ | [`defaultOrientation`](#defaultorientation) | string | Specify timetable orientation, when not specified in `timetables.txt`. |
27
+ | [`effectiveDate`](#effectivedate) | string | A date to print at the top of the timetable. |
28
+ | [`interpolatedStopSymbol`](#interpolatedstopsymbol) | string | The symbol used to indicate that a timepoint isn't fixed, but just interpolated. |
29
+ | [`interpolatedStopText`](#interpolatedstoptext) | string | The text used to describe a timepoint isn't fixed, but just interpolated. |
30
+ | [`linkStopUrls`](#linkStopurls) | boolean | Whether or not to hyperlink timetable stop names to the `stop_url` defined in `stops.txt`. |
31
+ | [`logFunction`](#logfunction) | function | A custom logging function for handling output of logs. |
32
+ | [`mapboxAccessToken`](#mapboxaccesstoken) | string | The Mapbox access token for generating a map of the route. |
33
+ | [`menuType`](#menutype) | string | The type of menu to use for selecting timetables on a timetable page. |
34
+ | [`noDropoffSymbol`](#nodropoffsymbol) | string | The symbol used to indicate ta stop where no drop off is available. |
35
+ | [`noDropoffText`](#nodropofftext) | string | The text used to describe a stop where no drop off is available. |
36
+ | [`noHead`](#nohead) | boolean | Whether or not to skip the header and footer of the HTML document. |
37
+ | [`noServiceSymbol`](#noservicesymbol) | string | The symbol used when a specific trip does not serve a specified stop. |
38
+ | [`noServiceText`](#noservicetext) | string | The text used to describe a stop which is not served by a specific trip. |
39
+ | [`outputFormat`](#outputformat) | string | The file format of the timetables generated. Either `html`, `pdf` or `csv`. |
40
+ | [`noPickupSymbol`](#nopickupsymbol) | string | The symbol used to indicate a stop where no pickup is available. |
41
+ | [`noPickupText`](#nopickuptext) | string | The text used to describe a stop where no pickup is available. |
42
+ | [`requestDropoffSymbol`](#requestdropoffsymbol) | string | The symbol used to indicate a stop where riders must request a drop off. |
43
+ | [`requestDropoffText`](#requestdropofftext) | string | The text used to describe a stop where riders must request a drop off. |
44
+ | [`requestPickupSymbol`](#requestpickupsymbol) | string | The symbol used to indicate a stop where riders must request a pickup. |
45
+ | [`requestPickupText`](#requestpickuptext) | string | The text used to describe a stop where riders must request a pickup. |
46
+ | [`serviceNotProvidedOnText`](#servicenotprovidedontext) | string | The text used to label days where service is not provided. |
47
+ | [`serviceProvidedOnText`](#serviceprovidedontext) | string | The text used to label days where service is provided. |
48
+ | [`showArrivalOnDifference`](#showarrivalondifference) | float | Defines a difference between departure and arrival, on which arrival column/row will be shown. |
49
+ | [`showMap`](#showmap) | boolean | Whether or not to show a map of the route on the timetable. |
50
+ | [`showOnlyTimepoint`](#showonlytimepoint) | boolean | Whether or not all stops should be shown, or only stops with a `timepoint` value in `stops.txt`. |
51
+ | [`showRouteTitle`](#showroutetitle) | boolean | Whether or not to show the route title at the top of the timetable page. |
52
+ | [`showStopCity`](#showstopcity) | boolean | Whether or not to show each stop's city. |
53
+ | [`showStopDescription`](#showstopdescription) | boolean | Whether or not to show a stop description. |
54
+ | [`showStoptimesForRequestStops`](#showstoptimesforrequeststops) | boolean | Whether or not to show times for stops that require a request for pickup or dropoff. |
55
+ | [`skipImport`](#skipimport) | boolean | Whether or not to skip importing GTFS data into SQLite. |
56
+ | [`sortingAlgorithm`](#sortingalgorithm) | string | Defines the trip-sorting algorithm. |
57
+ | [`sqlitePath`](#sqlitepath) | string | A path to an SQLite database. Optional, defaults to using an in-memory database. |
58
+ | [`templatePath`](#templatepath) | string | Path to custom pug template for rendering timetable. |
59
+ | [`timeFormat`](#timeformat) | string | A string defining time format in moment.js style. |
60
+ | [`useParentStation`](#useparentstation) | boolean | Whether or not to use a stop's `parent_station`. |
61
+ | [`verbose`](#verbose) | boolean | Whether or not to print output to the console. |
62
+ | [`zipOutput`](#zipoutput) | boolean | Whether or not to zip the output into one zip file. |
63
63
 
64
64
  ### agencies
65
65
 
@@ -71,7 +71,8 @@ To find an agency's GTFS file, visit [transitfeeds.com](http://transitfeeds.com)
71
71
  URL from the agency's website or you can use a URL generated from the transitfeeds.com
72
72
  API along with your API token.
73
73
 
74
- * Specify a download URL:
74
+ - Specify a download URL:
75
+
75
76
  ```
76
77
  {
77
78
  "agencies": [
@@ -83,7 +84,8 @@ API along with your API token.
83
84
  }
84
85
  ```
85
86
 
86
- * Specify a path to a zipped GTFS file:
87
+ - Specify a path to a zipped GTFS file:
88
+
87
89
  ```
88
90
  {
89
91
  "agencies": [
@@ -94,7 +96,9 @@ API along with your API token.
94
96
  ]
95
97
  }
96
98
  ```
97
- * Specify a path to an unzipped GTFS file:
99
+
100
+ - Specify a path to an unzipped GTFS file:
101
+
98
102
  ```
99
103
  {
100
104
  "agencies": [
@@ -106,7 +110,7 @@ API along with your API token.
106
110
  }
107
111
  ```
108
112
 
109
- * Exclude files - if you don't want all GTFS files to be imported, you can specify an array of files to exclude.
113
+ - Exclude files - if you don't want all GTFS files to be imported, you can specify an array of files to exclude.
110
114
 
111
115
  ```
112
116
  {
@@ -123,7 +127,7 @@ API along with your API token.
123
127
  }
124
128
  ```
125
129
 
126
- * Optionally specify a proj4 projection string to correct poorly formed coordinates in the GTFS file
130
+ - Optionally specify a proj4 projection string to correct poorly formed coordinates in the GTFS file
127
131
 
128
132
  ```
129
133
  {
@@ -137,7 +141,7 @@ API along with your API token.
137
141
  }
138
142
  ```
139
143
 
140
- * Specify multiple agencies to be imported. Note that it is often better to have one configuration file per agency and call gtfs-to-html multiple times rather than have two different agencies in the same config file. If agencies have conflicting ids for routes, stops, calendars or more, GTFS-to-HTML will fail.
144
+ - Specify multiple agencies to be imported. Note that it is often better to have one configuration file per agency and call gtfs-to-html multiple times rather than have two different agencies in the same config file. If agencies have conflicting ids for routes, stops, calendars or more, GTFS-to-HTML will fail.
141
145
 
142
146
  ```
143
147
  {
@@ -188,7 +192,7 @@ API along with your API token.
188
192
 
189
193
  ### daysShortStrings
190
194
 
191
- {Array \[String\]} An array of strings defining contractions of weekday names. Specify from Monday to Sunday.
195
+ {Array \[String\]} An array of strings defining contractions of weekday names. Specify from Monday to Sunday.
192
196
 
193
197
  ```
194
198
  "daysShortStrings": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
@@ -196,7 +200,7 @@ API along with your API token.
196
200
 
197
201
  ### daysStrings
198
202
 
199
- {Array \[String\]} An array of strings defining contractions of weekday names. Specify from Monday to Sunday.
203
+ {Array \[String\]} An array of strings defining contractions of weekday names. Specify from Monday to Sunday.
200
204
 
201
205
  ```
202
206
  "daysStrings": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
@@ -252,28 +256,26 @@ API along with your API token.
252
256
 
253
257
  ### logFunction
254
258
 
255
- {Function} If you want to route logs to a custom function, you can pass a function that takes a single `text` argument as `logFunction`. This can't be used when running GTFS-to-HTML as a command-line utility, only when included as part of a node.js app and passed in a config object to `gtfsToHtml()`. For example:
259
+ {Function} If you want to route logs to a custom function, you can pass a function that takes a single `text` argument as `logFunction`. This can't be used when running GTFS-to-HTML as a command-line utility, only when included as part of a node.js app and passed in a config object to `gtfsToHtml()`. For example:
256
260
 
257
261
  ```javascript
258
- import gtfsToHtml from 'gtfs-to-html';
259
-
260
- const config = {
261
- agencies: [
262
- {
263
- agency_key: 'county-connection',
264
- url: 'http://countyconnection.com/GTFS/google_transit.zip',
265
- exclude: [
266
- 'shapes'
267
- ]
268
- }
269
- ],
270
- logFunction: function(text) {
271
- // Do something with the logs here, like save it or send it somewhere
272
- console.log(text);
273
- }
274
- };
275
-
276
- gtfsToHtml(config);
262
+ import gtfsToHtml from 'gtfs-to-html';
263
+
264
+ const config = {
265
+ agencies: [
266
+ {
267
+ agency_key: 'county-connection',
268
+ url: 'http://countyconnection.com/GTFS/google_transit.zip',
269
+ exclude: ['shapes'],
270
+ },
271
+ ],
272
+ logFunction: function (text) {
273
+ // Do something with the logs here, like save it or send it somewhere
274
+ console.log(text);
275
+ },
276
+ };
277
+
278
+ gtfsToHtml(config);
277
279
  ```
278
280
 
279
281
  ### mapboxAccessToken
@@ -310,7 +312,7 @@ API along with your API token.
310
312
 
311
313
  ### noHead
312
314
 
313
- {Boolean} Whether or not to skip the HTML head and footer when generating the HTML. This is useful for creating embeddable HTML without `<html>`, `<head>` or `<body>` tags. Defaults to `false`. Ignored if `outputFormat` is set to `pdf`.
315
+ {Boolean} Whether or not to skip the HTML head and footer when generating the HTML. This is useful for creating embeddable HTML without `<html>`, `<head>` or `<body>` tags. Defaults to `false`. Ignored if `outputFormat` is set to `pdf` or `csv`.
314
316
 
315
317
  ```
316
318
  "noHead": false
@@ -350,7 +352,7 @@ API along with your API token.
350
352
 
351
353
  ### outputFormat
352
354
 
353
- {String} The file format of the timetables generated. Either `html` or `pdf`. Defaults to `html`.
355
+ {String} The file format of the timetables generated. Either `html`, `pdf` or `csv`. Defaults to `html`.
354
356
 
355
357
  ```
356
358
  "outputFormat": "html"
@@ -474,11 +476,11 @@ If you'd rather just get all stops and route info as geoJSON, see [gtfs-to-geojs
474
476
 
475
477
  {String} Defines trip-sorting algorithm used to determine the order that trips are shown in timetables.
476
478
 
477
- * `common` finds a common stop used by all trips and sorts by stoptimes at that stop. If there is no common stop for all trips, then `beginning` algorithm is used.
478
- * `beginning` uses the first stoptime of each trip, which can be from different stops if not all trips have the same first stop. If a multiple trips have identical first stoptimes, the trip with the earlier last stoptimes comes first.
479
- * `end` uses the last stoptime of each trip, which can be from different stops if not all trips have the same last stop. If a multiple trips have identical last stoptimes, the trip with the earlier first stoptimes comes first.
480
- * `first` uses the first stop of the longest trip and sorts by stoptimes at that stop.
481
- * `last` uses the last stop of the longest trip and sorts by stoptimes at that stop.
479
+ - `common` finds a common stop used by all trips and sorts by stoptimes at that stop. If there is no common stop for all trips, then `beginning` algorithm is used.
480
+ - `beginning` uses the first stoptime of each trip, which can be from different stops if not all trips have the same first stop. If a multiple trips have identical first stoptimes, the trip with the earlier last stoptimes comes first.
481
+ - `end` uses the last stoptime of each trip, which can be from different stops if not all trips have the same last stop. If a multiple trips have identical last stoptimes, the trip with the earlier first stoptimes comes first.
482
+ - `first` uses the first stop of the longest trip and sorts by stoptimes at that stop.
483
+ - `last` uses the last stop of the longest trip and sorts by stoptimes at that stop.
482
484
 
483
485
  The default trip-sorting algorithm is `common`.
484
486
 
@@ -488,7 +490,7 @@ The default trip-sorting algorithm is `common`.
488
490
 
489
491
  ### sqlitePath
490
492
 
491
- {String} A path to an SQLite database. Optional, defaults to using an in-memory database with a value of `:memory:`. If you want the data imported to persist, you need to specify a value for `sqlitePath`
493
+ {String} A path to an SQLite database. Optional, defaults to using an in-memory database with a value of `:memory:`. If you want the data imported to persist, you need to specify a value for `sqlitePath`
492
494
 
493
495
  ```
494
496
  "sqlitePath": "/tmp/gtfs"
@@ -496,7 +498,7 @@ The default trip-sorting algorithm is `common`.
496
498
 
497
499
  ### templatePath
498
500
 
499
- {String} Path to a folder containing (pug)[https://pugjs.org/] template for rendering timetables. This is optional. Defaults to using the templates provided in `views/default`. All files within the `/views/custom` folder will be .gitignored, so you can copy the `views/default` folder to `views/custom/myagency` and make any modifications needed. Any custom views folder should contain pug templates called `timetablepage.pug`, `timetablepage_full.pug`, `overview.pug`, and `overview_full.pug`.
501
+ {String} Path to a folder containing (pug)[https://pugjs.org/] template for rendering timetables. This is optional. Defaults to using the templates provided in `views/default`. All files within the `/views/custom` folder will be .gitignored, so you can copy the `views/default` folder to `views/custom/myagency` and make any modifications needed. Any custom views folder should contain pug templates called `timetablepage.pug`, `timetablepage_full.pug`, `overview.pug`, and `overview_full.pug`.
500
502
 
501
503
  ```
502
504
  "templatePath": "views/custom/my-agency/"
@@ -7,39 +7,40 @@ title: Current Usage
7
7
 
8
8
  Many transit agencies use GTFS-to-HTML to generate the schedule pages used on their websites, including:
9
9
 
10
- | Agency | Location |
11
- | -------- | --------- |
12
- | [Advance Transit](https://advancetransit.com) | Vermont |
13
- | [Brockton Area Transit Authority](https://ridebat.com) | Brockton, Massachusetts |
14
- | [Capital Transit](http://www.ridethecapitalt.org) | Helena, Montana |
15
- | [Capital Transit](https://juneaucapitaltransit.org) | Juneau, Alaska |
16
- | [Central Transit](https://centraltransit.org) | Ellensburg, Washington |
17
- | [County Connection](https://countyconnection.com) | Contra Costa County, California |
18
- | [El Dorado Transit](http://eldoradotransit.com) | El Dorado County, California |
19
- | [Greater Attleboro-Taunton Regional Transit Authority](https://www.gatra.org) | Attleboro-Taunton, Massachusetts |
20
- | [Humboldt Transit Authority](http://hta.org) | Humboldt County, California |
21
- | [Kings Area Rural Transit (KART)](https://www.kartbus.org) | Kings County, California |
22
- | [Madera County Connection](http://mcctransit.com) | Madera County, California |
23
- | [Marin Transit](https://marintransit.org) | Marin County, California |
24
- | [Morongo Basin Transit Authority](https://mbtabus.com) | Morongo Basin, California |
25
- | [Mountain Transit](http://mountaintransit.org) | Big Bear Valley, California |
26
- | [MVgo](https://mvgo.org) | Mountain View, California |
27
- | [NW Connector](http://www.nworegontransit.org) | Northwest Oregon |
28
- | [Palo Verde Valley Transit Agency](http://pvvta.com) | Palo Verde Valley, California |
29
- | [Petaluma Transit](http://transit.cityofpetaluma.net) | Petaluma, California |
30
- | [RTC Washoe](https://www.rtcwashoe.com) | Reno, Nevada |
31
- | [Santa Barbara Metropolitan Transit District](https://sbmtd.gov) | Santa Barbara, California |
32
- | [Sonoma County Transit](http://sctransit.com) | Sonoma County, California |
33
- | [Tahoe Truckee Area Regional Transit](https://tahoetruckeetransit.com) | Truckee, California |
34
- | [Transcollines](https://transcollines.ca) | Les Collines-de-l'Outaouais, Quebec |
35
- | [Tulare County Area Transit](https://ridetcat.org) | Tulare County, California |
36
- | [Victor Valley Transit](https://vvta.org) | Victory Valley, California |
37
- | [Worcester Regional Transit Authority](https://therta.com) | Worcester, Massachusetts |
10
+ | Agency | Location |
11
+ | ----------------------------------------------------------------------------- | ----------------------------------- |
12
+ | [Advance Transit](https://advancetransit.com) | Vermont |
13
+ | [Brockton Area Transit Authority](https://ridebat.com) | Brockton, Massachusetts |
14
+ | [Capital Transit](http://www.ridethecapitalt.org) | Helena, Montana |
15
+ | [Capital Transit](https://juneaucapitaltransit.org) | Juneau, Alaska |
16
+ | [Central Transit](https://centraltransit.org) | Ellensburg, Washington |
17
+ | [County Connection](https://countyconnection.com) | Contra Costa County, California |
18
+ | [El Dorado Transit](http://eldoradotransit.com) | El Dorado County, California |
19
+ | [Greater Attleboro-Taunton Regional Transit Authority](https://www.gatra.org) | Attleboro-Taunton, Massachusetts |
20
+ | [Humboldt Transit Authority](http://hta.org) | Humboldt County, California |
21
+ | [Kings Area Rural Transit (KART)](https://www.kartbus.org) | Kings County, California |
22
+ | [Madera County Connection](http://mcctransit.com) | Madera County, California |
23
+ | [Marin Transit](https://marintransit.org) | Marin County, California |
24
+ | [Morongo Basin Transit Authority](https://mbtabus.com) | Morongo Basin, California |
25
+ | [Mountain Transit](http://mountaintransit.org) | Big Bear Valley, California |
26
+ | [MVgo](https://mvgo.org) | Mountain View, California |
27
+ | [NW Connector](http://www.nworegontransit.org) | Northwest Oregon |
28
+ | [Palo Verde Valley Transit Agency](http://pvvta.com) | Palo Verde Valley, California |
29
+ | [Petaluma Transit](http://transit.cityofpetaluma.net) | Petaluma, California |
30
+ | [RTC Washoe](https://www.rtcwashoe.com) | Reno, Nevada |
31
+ | [Santa Barbara Metropolitan Transit District](https://sbmtd.gov) | Santa Barbara, California |
32
+ | [Sonoma County Transit](http://sctransit.com) | Sonoma County, California |
33
+ | [Tahoe Transportation District](https://www.tahoetransportation.org) | Lake Tahoe, California |
34
+ | [Tahoe Truckee Area Regional Transit](https://tahoetruckeetransit.com) | Truckee, California |
35
+ | [Transcollines](https://transcollines.ca) | Les Collines-de-l'Outaouais, Quebec |
36
+ | [Tulare County Area Transit](https://ridetcat.org) | Tulare County, California |
37
+ | [Victor Valley Transit](https://vvta.org) | Victory Valley, California |
38
+ | [Worcester Regional Transit Authority](https://therta.com) | Worcester, Massachusetts |
38
39
 
39
40
  Are you using GTFS-to-HTML? Let us know via email (brendan@blinktag.com) and we'll add you to this list.
40
41
 
41
42
  ## Projects using GTFS-to-HTML
42
43
 
43
- * [`transit-custom-posts`](https://trilliumtransit.github.io/transit-custom-posts/) - a GTFS-optimized Wordpress plugin for transit websites. GTFS-to-HTML is used for generating the schedule pages.
44
+ - [`transit-custom-posts`](https://trilliumtransit.github.io/transit-custom-posts/) - a GTFS-optimized Wordpress plugin for transit websites. GTFS-to-HTML is used for generating the schedule pages.
44
45
 
45
- * [run.gtfstohtml.com](https://run.gtfstohtml.com) provides a web based interface using GTFS-to-HTML. Find GTFS feeds for agenices, set configuration and generate a previewable and downloadable set of timetables all using your browser. Use GTFS-to-HTML without actually downloading any code or doing any configuration!
46
+ - [run.gtfstohtml.com](https://run.gtfstohtml.com) provides a web based interface using GTFS-to-HTML. Find GTFS feeds for agenices, set configuration and generate a previewable and downloadable set of timetables all using your browser. Use GTFS-to-HTML without actually downloading any code or doing any configuration!
@@ -4,25 +4,30 @@ title: Introduction
4
4
  slug: /
5
5
  ---
6
6
 
7
- GTFS-to-HTML creates human-readable, user-friendly transit timetables in HTML and PDF format directly from [GTFS transit data](https://developers.google.com/transit/gtfs/). Most transit agencies have schedule data in GTFS format but need to show each route's schedule to users on a website. This project automates the process of creating nicely formatted HTML timetables for inclusion on a transit agency website. This makes it easy to keep timetables up to date and accurate when schedule changes happen and reduces the likelihood of errors.
8
-
7
+ GTFS-to-HTML creates human-readable, user-friendly transit timetables in HTML, PDF or CSV format directly from [GTFS transit data](https://developers.google.com/transit/gtfs/). Most transit agencies have schedule data in GTFS format but need to show each route's schedule to users on a website. This project automates the process of creating nicely formatted HTML timetables for inclusion on a transit agency website. This makes it easy to keep timetables up to date and accurate when schedule changes happen and reduces the likelihood of errors.
9
8
 
10
9
  ## Configurable and customizable
11
- GTFS-to-HTML has many options that configure how timetables are presented. It also allows using a completely custom template which makes it easy to build chunks of HTML that will fit perfectly into any website using any HTML structure and classes that you'd like. Or, create printable PDF versions of timetables using the `outputFormat` config option.
10
+
11
+ GTFS-to-HTML has many options that configure how timetables are presented. It also allows using a completely custom template which makes it easy to build chunks of HTML that will fit perfectly into any website using any HTML structure and classes that you'd like. Or, create printable PDF versions or CSV exports of timetables using the `outputFormat` config option.
12
12
 
13
13
  ## Accessibility for all
14
+
14
15
  GTFS-to-HTML properly formats timetables to ensure they are screen-reader accessible and WCAG 2.0 compliant.
15
16
 
16
17
  ## Mobile responsiveness built in
18
+
17
19
  Built-in styling makes GTFS-to-HTML timetables ready to size and scroll easily on mobile phones and tablets.
18
20
 
19
21
  ## Schedule changes? A cinch.
22
+
20
23
  By generating future timetables and including dates in table metadata, your timetables can appear in advance of a schedule change, and you can validate that your new timetables and GTFS are correct.
21
24
 
22
25
  ## Notes
26
+
23
27
  Custom notes, like "No express service during a full moon" can be programatically attached to stops, trips, timepoints or routes can be added using [additional files](/docs/additional-files).
24
28
 
25
29
  ## Auto-generated maps
30
+
26
31
  GTFS-to-HTML can also generate a map for each route that can be included with the schedule page. The map shows all stops for the route and lists all routes that serve each stop. See the `showMap` configuration option below.
27
32
 
28
33
  Note: If you only want maps of GTFS data, use the [gtfs-to-geojson](https://github.com/blinktaginc/gtfs-to-geojson) package instead and skip making timetables entirely. If offers many different formats of GeoJSON for routes and stops.
@@ -32,5 +37,3 @@ GTFS-to-HTML uses the [`node-gtfs`](https://github.com/blinktaginc/node-gtfs) li
32
37
  ## GTFS-to-HTML on the web
33
38
 
34
39
  If you'd like to try out GTFS-to-HTML, you can do so entirely in your browser. [run.gtfstohtml.com](https://run.gtfstohtml.com) provides a web based interface for finding GTFS feeds, setting configuration and then generating downloadable sets of timetables. Use GTFS-to-HTML without actually downloading any code or doing any configuration!
35
-
36
-
@@ -3,35 +3,34 @@ id: timetables
3
3
  title: timetables.txt
4
4
  ---
5
5
 
6
-
7
6
  This is an optional, non-standard file called `timetables.txt` which can be included in an agency's GTFS. This file specifies to GTFS-to-HTML which HTML timetables should be built. Often, this is the only additional file you need to create to use GTFS-to-HTML.
8
7
 
9
8
  ### Column Definitions
10
9
 
11
- | column name | description |
12
- | ----------- | ----------- |
13
- | `timetable_id` | A unique ID for the timetable |
14
- | `route_id` | The ID of the route the timetable is for from `routes.txt`. |
15
- | `direction_id` | The `direction_id` from `trips.txt` for the timetable. This can be blank. |
16
- | `start_date` | The start date for this timetable in `YYYY-MM-DD` format. |
17
- | `end_date` | The end date for this timetable in `YYYY-MM-DD` format. |
18
- | `monday` | A binary value that indicates whether this timetable should include service on Mondays. Valid options are `0` and `1`. |
19
- | `tuesday` | A binary value that indicates whether this timetable should include service on Tuesdays. Valid options are `0` and `1`. |
20
- | `wednesday` | A binary value that indicates whether this timetable should include service on Wednesdays. Valid options are `0` and `1`. |
21
- | `thursday` | A binary value that indicates whether this timetable should include service on Thursdays. Valid options are `0` and `1`. |
22
- | `friday` | A binary value that indicates whether this timetable should include service on Fridays. Valid options are `0` and `1`. |
23
- | `saturday` | A binary value that indicates whether this timetable should include service on Saturdays. Valid options are `0` and `1`. |
24
- | `sunday` | A binary value that indicates whether this timetable should include service on Sundays. Valid options are `0` and `1`. |
25
- | `start_time` | A time in HH:MM:SS format used exclude all trips that start before this time. Optional, default is to use all trips throughout the day. |
26
- | `end_time` | A time in HH:MM:SS format used exclude all trips that start on or after this time. Optional, default is to use all trips throughout the day. |
27
- | `include_exceptions` | A binary value that indicates whether or not to include exceptions of type `1` from `calendar_dates.txt`, such as holiday service on a weekday. Valid options are `0` and `1`. Optional, defaults to `0` (exceptions are not included by default). |
28
- | `timetable_label` | A short text label describing the timetable, for instance "Route 4 Northbound Mon-Fri". Optional, defaults to route name and first and last stops. Optional. |
29
- | `service_notes` | Text shown on the timetable about the service represented. Optional. |
30
- | `orientation` | Determines if the top row should be a list of trips or stops. Valid options are `vertical`, `horizontal` or `hourly`. `vertical` shows stops across the top row with each row being a list of stop times for each trip. `horizontal` shows trips across the top row with each row being stop times for a specific stop. `hourly` is for routes that run the same time each hour and will print a simplified schedule showing minutes after the hour for each stop. `horizontal` orientation is best for routes with lots of stops and fewer trips while `vertical` orientation is best for routes with lots of trips and a smaller number of stops. Optional, default is `vertical`. |
31
- | `timetable_page_id` | The timetable page that should include this timetable. Optional. |
32
- | `timetable_sequence` | The order that this timetable should appear on the timetable page. Optional. |
33
- | `direction_name` | The human readable name of the direction of the timetable, such as "Southbound". Optional. |
34
- | `show_trip_continuation` | A binary value that indicates whether this timetable should show an additional column(s) or row(s) indicating which trips continue from a different route or continue on as a different route. This is calculated by trips that share the same `block_id` in `trips.txt`. Valid options are `0` and `1`. Optional, defaults to `0`. |
10
+ | column name | description |
11
+ | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
12
+ | `timetable_id` | A unique ID for the timetable |
13
+ | `route_id` | The ID of the route the timetable is for from `routes.txt`. For timetables that should include more than one route, see [Multi-route timetables](#multi-route-timetables) |
14
+ | `direction_id` | The `direction_id` from `trips.txt` for the timetable. This can be blank. |
15
+ | `start_date` | The start date for this timetable in `YYYY-MM-DD` format. |
16
+ | `end_date` | The end date for this timetable in `YYYY-MM-DD` format. |
17
+ | `monday` | A binary value that indicates whether this timetable should include service on Mondays. Valid options are `0` and `1`. |
18
+ | `tuesday` | A binary value that indicates whether this timetable should include service on Tuesdays. Valid options are `0` and `1`. |
19
+ | `wednesday` | A binary value that indicates whether this timetable should include service on Wednesdays. Valid options are `0` and `1`. |
20
+ | `thursday` | A binary value that indicates whether this timetable should include service on Thursdays. Valid options are `0` and `1`. |
21
+ | `friday` | A binary value that indicates whether this timetable should include service on Fridays. Valid options are `0` and `1`. |
22
+ | `saturday` | A binary value that indicates whether this timetable should include service on Saturdays. Valid options are `0` and `1`. |
23
+ | `sunday` | A binary value that indicates whether this timetable should include service on Sundays. Valid options are `0` and `1`. |
24
+ | `start_time` | A time in HH:MM:SS format used exclude all trips that start before this time. Optional, default is to use all trips throughout the day. |
25
+ | `end_time` | A time in HH:MM:SS format used exclude all trips that start on or after this time. Optional, default is to use all trips throughout the day. |
26
+ | `include_exceptions` | A binary value that indicates whether or not to include exceptions of type `1` from `calendar_dates.txt`, such as holiday service on a weekday. Valid options are `0` and `1`. Optional, defaults to `0` (exceptions are not included by default). |
27
+ | `timetable_label` | A short text label describing the timetable, for instance "Route 4 Northbound Mon-Fri". Optional, defaults to route name and first and last stops. Optional. |
28
+ | `service_notes` | Text shown on the timetable about the service represented. Optional. |
29
+ | `orientation` | Determines if the top row should be a list of trips or stops. Valid options are `vertical`, `horizontal` or `hourly`. `vertical` shows stops across the top row with each row being a list of stop times for each trip. `horizontal` shows trips across the top row with each row being stop times for a specific stop. `hourly` is for routes that run the same time each hour and will print a simplified schedule showing minutes after the hour for each stop. `horizontal` orientation is best for routes with lots of stops and fewer trips while `vertical` orientation is best for routes with lots of trips and a smaller number of stops. Optional, default is `vertical`. |
30
+ | `timetable_page_id` | The timetable page that should include this timetable. Optional. |
31
+ | `timetable_sequence` | The order that this timetable should appear on the timetable page. Optional. |
32
+ | `direction_name` | The human readable name of the direction of the timetable, such as "Southbound". Optional. |
33
+ | `show_trip_continuation` | A binary value that indicates whether this timetable should show an additional column(s) or row(s) indicating which trips continue from a different route or continue on as a different route. This is calculated by trips that share the same `block_id` in `trips.txt`. Valid options are `0` and `1`. Optional, defaults to `0`. |
35
34
 
36
35
  ### Example
37
36
 
@@ -47,10 +46,19 @@ timetable_id,route_id,direction_id,start_date,end_date,monday,tuesday,wednesday,
47
46
  7,2037,0,20150101,20151122,1,1,1,1,1,0,0,,,0,103 Westbound,Mon-Fri,horizontal,1,0,Westbound,0
48
47
  ```
49
48
 
50
- An example of this file is located in [examples/timetables.txt](https://github.com/BlinkTagInc/gtfs-to-html/blob/master/examples/timetables.txt).
51
-
49
+ An example of this file is located in [examples/timetables.txt](https://github.com/BlinkTagInc/gtfs-to-html/blob/master/examples/timetables.txt).
52
50
 
53
51
  ## Multi-route Timetables
54
52
 
55
53
  To allow creating a single timetable for multiple routes that overlap, you can have multiple entries in `timetables.txt` for the same `timetable_id`. All fields should be the same for each row in `timetables.txt` for a combined route timetable except `route_id`.
56
54
 
55
+ ### Multi-route example
56
+
57
+ In this example, only one timetable will be generated that will include trips from route_ids `2034`, `2035` and `2036`.
58
+
59
+ ```csv
60
+ timetable_id,route_id,direction_id,start_date,end_date,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_time,end_time,include_exceptions,timetable_label,service_notes,orientation,timetable_page_id,timetable_sequence,direction_name,show_trip_continuation
61
+ 0,2034,0,20150101,20151122,1,1,1,1,1,1,0,,,0,101 Northbound,Mon-Sat AM,horizontal,1,0,Northbound,0
62
+ 0,2035,0,20150101,20151122,1,1,1,1,1,1,0,,,0,101 Northbound,Mon-Sat AM,horizontal,1,0,Northbound,0
63
+ 0,2036,0,20150101,20151122,1,1,1,1,1,1,0,,,0,101 Northbound,Mon-Sat AM,horizontal,1,0,Northbound,0
64
+ ```
package/www/package.json CHANGED
@@ -9,8 +9,8 @@
9
9
  "deploy": "docusaurus deploy"
10
10
  },
11
11
  "dependencies": {
12
- "@docusaurus/core": "^2.0.0-beta.7",
13
- "@docusaurus/preset-classic": "^2.0.0-beta.7",
12
+ "@docusaurus/core": "^2.0.0-beta.14",
13
+ "@docusaurus/preset-classic": "^2.0.0-beta.14",
14
14
  "clsx": "^1.1.1",
15
15
  "react": "^17.0.2",
16
16
  "react-dom": "^17.0.2"
@@ -26,8 +26,5 @@
26
26
  "last 1 firefox version",
27
27
  "last 1 safari version"
28
28
  ]
29
- },
30
- "resolutions": {
31
- "node-fetch": "2.6.1"
32
29
  }
33
30
  }