gtfs-to-html 2.7.2 → 2.8.0

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.
Files changed (84) hide show
  1. package/package.json +21 -8
  2. package/.eslintrc.json +0 -28
  3. package/.husky/pre-commit +0 -4
  4. package/CHANGELOG.md +0 -1018
  5. package/app/index.js +0 -138
  6. package/bin/gtfs-to-html.js +0 -48
  7. package/config-sample.json +0 -59
  8. package/docker/Dockerfile +0 -14
  9. package/docker/README.md +0 -5
  10. package/docker/docker-compose.yml +0 -10
  11. package/examples/stop_attributes.txt +0 -6
  12. package/examples/timetable_notes.txt +0 -8
  13. package/examples/timetable_notes_references.txt +0 -8
  14. package/examples/timetable_pages.txt +0 -3
  15. package/examples/timetable_stop_order.txt +0 -16
  16. package/examples/timetables.txt +0 -9
  17. package/index.js +0 -1
  18. package/lib/file-utils.js +0 -202
  19. package/lib/formatters.js +0 -518
  20. package/lib/geojson-utils.js +0 -96
  21. package/lib/gtfs-to-html.js +0 -214
  22. package/lib/log-utils.js +0 -215
  23. package/lib/template-functions.js +0 -192
  24. package/lib/time-utils.js +0 -90
  25. package/lib/utils.js +0 -1702
  26. package/views/default/css/overview_styles.css +0 -197
  27. package/views/default/css/timetable_pdf_styles.css +0 -7
  28. package/views/default/css/timetable_styles.css +0 -447
  29. package/views/default/formatting_functions.pug +0 -113
  30. package/views/default/js/system-map.js +0 -594
  31. package/views/default/js/timetable-map.js +0 -358
  32. package/views/default/js/timetable-menu.js +0 -63
  33. package/views/default/layout.pug +0 -11
  34. package/views/default/overview.pug +0 -27
  35. package/views/default/overview_full.pug +0 -16
  36. package/views/default/timetable_continuation_as.pug +0 -7
  37. package/views/default/timetable_continuation_from.pug +0 -7
  38. package/views/default/timetable_horizontal.pug +0 -42
  39. package/views/default/timetable_hourly.pug +0 -30
  40. package/views/default/timetable_menu.pug +0 -48
  41. package/views/default/timetable_note_symbol.pug +0 -5
  42. package/views/default/timetable_stop_name.pug +0 -13
  43. package/views/default/timetable_stoptime.pug +0 -17
  44. package/views/default/timetable_vertical.pug +0 -67
  45. package/views/default/timetablepage.pug +0 -66
  46. package/views/default/timetablepage_full.pug +0 -22
  47. package/www/README.md +0 -33
  48. package/www/babel.config.js +0 -3
  49. package/www/blog/2020-07-07-New-Documentation.md +0 -12
  50. package/www/blog/2020-08-20-Version-1.0.0.md +0 -29
  51. package/www/blog/2021-11-06-CSV-Export.md +0 -26
  52. package/www/docs/additional-files.md +0 -24
  53. package/www/docs/configuration.md +0 -568
  54. package/www/docs/current-usage.md +0 -48
  55. package/www/docs/custom-templates.md +0 -13
  56. package/www/docs/introduction.md +0 -39
  57. package/www/docs/logging-sql-queries.md +0 -12
  58. package/www/docs/previewing-html-output.md +0 -24
  59. package/www/docs/processing-large-gtfs.md +0 -10
  60. package/www/docs/quick-start.md +0 -136
  61. package/www/docs/related-libraries.md +0 -54
  62. package/www/docs/reviewing-changes.md +0 -29
  63. package/www/docs/stop-attributes.md +0 -30
  64. package/www/docs/support.md +0 -12
  65. package/www/docs/timetable-notes-references.md +0 -44
  66. package/www/docs/timetable-notes.md +0 -33
  67. package/www/docs/timetable-pages.md +0 -37
  68. package/www/docs/timetable-stop-order.md +0 -63
  69. package/www/docs/timetables.md +0 -64
  70. package/www/docusaurus.config.js +0 -104
  71. package/www/package.json +0 -21
  72. package/www/sidebars.js +0 -10
  73. package/www/src/css/custom.css +0 -25
  74. package/www/src/pages/index.js +0 -270
  75. package/www/src/pages/styles.module.css +0 -53
  76. package/www/static/.nojekyll +0 -0
  77. package/www/static/img/favicon.ico +0 -0
  78. package/www/static/img/gtfs-to-html-logo.svg +0 -18
  79. package/www/static/img/overview-example.jpg +0 -0
  80. package/www/static/img/timetable-example.jpg +0 -0
  81. package/www/static/img/undraw_happy_music.svg +0 -1
  82. package/www/static/img/undraw_proud_coder.svg +0 -1
  83. package/www/static/img/undraw_spreadsheets.svg +0 -1
  84. package/www/yarn.lock +0 -8351
@@ -1,568 +0,0 @@
1
- ---
2
- id: configuration
3
- title: Configuration Options
4
- ---
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`.
7
-
8
- cp config-sample.json config.json
9
-
10
- Ensure that your config.json is [valid JSON](https://jsonformatter.curiousconcept.com) before proceeding.
11
-
12
- :::note
13
- All files starting with `config*.json` are .gitignored - so you can create multiple configuration files such as `config-caltrain.json`.
14
- :::
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
- | [`endDate`](#enddate) | string | A date in ISO 8601 format to use to control which calendars are used for the timetables. |
29
- | [`interpolatedStopSymbol`](#interpolatedstopsymbol) | string | The symbol used to indicate that a timepoint isn't fixed, but just interpolated. |
30
- | [`interpolatedStopText`](#interpolatedstoptext) | string | The text used to describe a timepoint isn't fixed, but just interpolated. |
31
- | [`linkStopUrls`](#linkStopurls) | boolean | Whether or not to hyperlink timetable stop names to the `stop_url` defined in `stops.txt`. |
32
- | [`logFunction`](#logfunction) | function | A custom logging function for handling output of logs. |
33
- | [`mapboxAccessToken`](#mapboxaccesstoken) | string | The Mapbox access token for generating a map of the route. |
34
- | [`menuType`](#menutype) | string | The type of menu to use for selecting timetables on a timetable page. |
35
- | [`noDropoffSymbol`](#nodropoffsymbol) | string | The symbol used to indicate ta stop where no drop off is available. |
36
- | [`noDropoffText`](#nodropofftext) | string | The text used to describe a stop where no drop off is available. |
37
- | [`noHead`](#nohead) | boolean | Whether or not to skip the header and footer of the HTML document. |
38
- | [`noServiceSymbol`](#noservicesymbol) | string | The symbol used when a specific trip does not serve a specified stop. |
39
- | [`noServiceText`](#noservicetext) | string | The text used to describe a stop which is not served by a specific trip. |
40
- | [`outputFormat`](#outputformat) | string | The file format of the timetables generated. Either `html`, `pdf` or `csv`. |
41
- | [`noPickupSymbol`](#nopickupsymbol) | string | The symbol used to indicate a stop where no pickup is available. |
42
- | [`noPickupText`](#nopickuptext) | string | The text used to describe a stop where no pickup is available. |
43
- | [`requestDropoffSymbol`](#requestdropoffsymbol) | string | The symbol used to indicate a stop where riders must request a drop off. |
44
- | [`requestDropoffText`](#requestdropofftext) | string | The text used to describe a stop where riders must request a drop off. |
45
- | [`requestPickupSymbol`](#requestpickupsymbol) | string | The symbol used to indicate a stop where riders must request a pickup. |
46
- | [`requestPickupText`](#requestpickuptext) | string | The text used to describe a stop where riders must request a pickup. |
47
- | [`serviceNotProvidedOnText`](#servicenotprovidedontext) | string | The text used to label days where service is not provided. |
48
- | [`serviceProvidedOnText`](#serviceprovidedontext) | string | The text used to label days where service is provided. |
49
- | [`showArrivalOnDifference`](#showarrivalondifference) | float | Defines a difference between departure and arrival, on which arrival column/row will be shown. |
50
- | [`showCalendarExceptions`](#showcalendarexecptions) | boolean | Whether or not to show a list of calendar exceptions below each timetable. |
51
- | [`showMap`](#showmap) | boolean | Whether or not to show a map of the route on the timetable. |
52
- | [`showOnlyTimepoint`](#showonlytimepoint) | boolean | Whether or not all stops should be shown, or only stops with a `timepoint` value in `stops.txt`. |
53
- | [`showRouteTitle`](#showroutetitle) | boolean | Whether or not to show the route title at the top of the timetable page. |
54
- | [`showStopCity`](#showstopcity) | boolean | Whether or not to show each stop's city. |
55
- | [`showStopDescription`](#showstopdescription) | boolean | Whether or not to show a stop description. |
56
- | [`showStoptimesForRequestStops`](#showstoptimesforrequeststops) | boolean | Whether or not to show times for stops that require a request for pickup or dropoff. |
57
- | [`skipImport`](#skipimport) | boolean | Whether or not to skip importing GTFS data into SQLite. |
58
- | [`sortingAlgorithm`](#sortingalgorithm) | string | Defines the trip-sorting algorithm. |
59
- | [`sqlitePath`](#sqlitepath) | string | A path to an SQLite database. Optional, defaults to using an in-memory database. |
60
- | [`startDate`](#startdate) | string | A date in ISO 8601 format to use to control which calendars are used for the timetables. |
61
- | [`templatePath`](#templatepath) | string | Path to custom pug template for rendering timetable. |
62
- | [`timeFormat`](#timeformat) | string | A string defining time format in moment.js style. |
63
- | [`useParentStation`](#useparentstation) | boolean | Whether or not to use a stop's `parent_station`. |
64
- | [`verbose`](#verbose) | boolean | Whether or not to print output to the console. |
65
- | [`zipOutput`](#zipoutput) | boolean | Whether or not to zip the output into one zip file. |
66
-
67
- ### agencies
68
-
69
- {Array} Specify the GTFS files to be imported in an `agencies` array. GTFS files can be imported via a `url` or a local `path`.
70
-
71
- Each file needs an `agency_key`, a short name you create that is specific to that GTFS file. For GTFS files that contain more than one agency, you only need to list each GTFS file once in the `agencies` array, not once per agency that it contains.
72
-
73
- To find an agency's GTFS file, visit [transitfeeds.com](http://transitfeeds.com). You can use the
74
- URL from the agency's website or you can use a URL generated from the transitfeeds.com
75
- API along with your API token.
76
-
77
- - Specify a download URL:
78
-
79
- ```json
80
- {
81
- "agencies": [
82
- {
83
- "agency_key": "county-connection",
84
- "url": "https://countyconnection.com/GTFS/google_transit.zip"
85
- }
86
- ]
87
- }
88
- ```
89
-
90
- - Specify a path to a zipped GTFS file:
91
-
92
- ```json
93
- {
94
- "agencies": [
95
- {
96
- "agency_key": "myAgency",
97
- "path": "/path/to/the/gtfs.zip"
98
- }
99
- ]
100
- }
101
- ```
102
-
103
- - Specify a path to an unzipped GTFS file:
104
-
105
- ```json
106
- {
107
- "agencies": [
108
- {
109
- "agency_key": "myAgency",
110
- "path": "/path/to/the/unzipped/gtfs/"
111
- }
112
- ]
113
- }
114
- ```
115
-
116
- - Exclude files - if you don't want all GTFS files to be imported, you can specify an array of files to exclude.
117
-
118
- ```json
119
- {
120
- "agencies": [
121
- {
122
- "agency_key": "myAgency",
123
- "path": "/path/to/the/unzipped/gtfs/",
124
- "exclude": [
125
- "shapes",
126
- "stops"
127
- ]
128
- }
129
- ]
130
- }
131
- ```
132
-
133
- - Optionally specify a proj4 projection string to correct poorly formed coordinates in the GTFS file
134
-
135
- ```json
136
- {
137
- "agencies": [
138
- {
139
- "agency_key": "myAgency",
140
- "path": "/path/to/the/unzipped/gtfs/",
141
- "proj": "+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs"
142
- }
143
- ]
144
- }
145
- ```
146
-
147
- - 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.
148
-
149
- ```json
150
- {
151
- "agencies": [
152
- {
153
- "agency_key": "myAgency",
154
- "path": "/path/to/the/gtfs.zip"
155
- },
156
- {
157
- "agency_key": "otherAgency",
158
- "path": "/path/to/the/othergtfs.zip"
159
- }
160
- ]
161
- }
162
- ```
163
-
164
- ### allowEmptyTimetables
165
-
166
- \{Boolean\} Whether or not to generate empty timetables that have no trips. Defaults to `false`.
167
-
168
- ```json
169
- "allowEmptyTimetables": false
170
- ```
171
-
172
- ### beautify
173
-
174
- \{Boolean\} Whether or not to beautify the HTML output. Defaults to `false`.
175
-
176
- ```json
177
- "beautify": false
178
- ```
179
-
180
- ### coordinatePrecision
181
-
182
- \{Integer\} The number of decimal places to include in the latitude and longitude of coordinates in GeoJSON used in maps. Omit to avoid any rounding. `5` is a reasonable value (about 1.1 meters).
183
-
184
- ```json
185
- "coordinatePrecision": 5
186
- ```
187
-
188
- ### dateFormat
189
-
190
- \{String\} A string defining date format using moment.js tokens. [See full list of formatting options](https://momentjs.com/docs/#/displaying/format/). Defaults to `MMM D. YYYY` which yields "Apr 5, 2022".
191
-
192
- ```json
193
- "dateFormat": "MMM D, YYYY"
194
- ```
195
-
196
- ### daysShortStrings
197
-
198
- \{Array [String]\} An array of strings defining contractions of weekday names. Specify from Monday to Sunday.
199
-
200
- ```json
201
- "daysShortStrings": ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
202
- ```
203
-
204
- ### daysStrings
205
-
206
- \{Array [String]\} An array of strings defining contractions of weekday names. Specify from Monday to Sunday.
207
-
208
- ```json
209
- "daysStrings": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
210
- ```
211
-
212
- ### debug
213
-
214
- \{Boolean\} Whether or not to enable loggin of SQL queries and other info. Defaults to false.
215
-
216
- ```json
217
- "debug": false
218
- ```
219
-
220
- ### defaultOrientation
221
-
222
- \{String\} Specifies timetable orientation, when not mentioned in `timetables.txt`. Valid options are `vertical`, `horizontal` or `hourly`. For details, see [`timetables.txt` `orientation` specification](https://gtfstohtml.com/docs/timetables).
223
-
224
- ```json
225
- "defaultOrientation": "vertical"
226
- ```
227
-
228
- ### effectiveDate
229
-
230
- \{String\} This is printed at the top of the timetable.
231
-
232
- ```json
233
- "effectiveDate": "July 8, 2015"
234
- ```
235
-
236
- ### endDate
237
-
238
- \{String\} A date in `YYYYMMDD` format to use to control which calendars are used for the timetables. Can be used with [startDate](#startdate) configuration options.
239
-
240
- Optional, defaults to using all available calendars if not defined. Overridden by `start_date` and `end_date` defined in `timetables.txt`.
241
-
242
- ```json
243
- "endDate": "2024-04-01"
244
- ```
245
-
246
- ### interpolatedStopSymbol
247
-
248
- \{String\} The symbol used to indicate that a timepoint isn't fixed, but just interpolated. Defaults to `•`. To avoid having this symbol used in timetables, set it to `null`.
249
-
250
- ```json
251
- "interpolatedStopSymbol": "•"
252
- ```
253
-
254
- ### interpolatedStopText
255
-
256
- \{String\} The text used to describe that a timepoint isn't fixed, but just interpolated. Defaults to `Estimated time of arrival`.
257
-
258
- ```json
259
- "interpolatedStopText": "Estimated time of arrival"
260
- ```
261
-
262
- ### linkStopUrls
263
-
264
- \{Boolean\} Whether or not to hyperlink timetable stop names to the `stop_url` defined in `stops.txt`. If no `stop_url` is defined for a stop, no link will be created. Defaults to `false`.
265
-
266
- ```json
267
- "linkStopUrls": false
268
- ```
269
-
270
- ### logFunction
271
-
272
- \{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:
273
-
274
- ```javascript
275
- import gtfsToHtml from 'gtfs-to-html';
276
-
277
- const config = {
278
- agencies: [
279
- {
280
- agency_key: 'county-connection',
281
- url: 'https://countyconnection.com/GTFS/google_transit.zip',
282
- exclude: ['shapes'],
283
- },
284
- ],
285
- logFunction: function (text) {
286
- // Do something with the logs here, like save it or send it somewhere
287
- console.log(text);
288
- },
289
- };
290
-
291
- gtfsToHtml(config);
292
- ```
293
-
294
- ### mapboxAccessToken
295
-
296
- \{String\} The [Mapbox access token](https://www.mapbox.com/help/define-access-token/) for generating a map of the route.
297
-
298
- ```json
299
- "mapboxAccessToken": "pk.eyXaX5F8oCJSYedim3yCnTGsVBfnRjsoXdy4Ej7ZZZydrCn2WMDXha5bPj5.bPj5xsBo8u8N8GJqJh"
300
- ```
301
-
302
- ### menuType
303
-
304
- \{String\} The type of menu to use for selecting or navigating to timetables on timetable pages with multiple timetables. Valid choices are `none`, `simple`, `jump` and `radio`. Defaults to `simple`.
305
-
306
- ```json
307
- "menuType": "jump"
308
- ```
309
-
310
- ### noDropoffSymbol
311
-
312
- \{String\} The symbol used to indicate that no drop off is available at a stop. Defaults to `‡`. To avoid having this symbol used in timetables, set it to `null`.
313
-
314
- ```json
315
- "noDropoffSymbol": "‡"
316
- ```
317
-
318
- ### noDropoffText
319
-
320
- \{String\} The text used to describe that no drop off is available at a stop. Defaults to `No drop off available`.
321
-
322
- ```json
323
- "noDropoffText": "No drop off available"
324
- ```
325
-
326
- ### noHead
327
-
328
- \{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`.
329
-
330
- ```json
331
- "noHead": false
332
- ```
333
-
334
- ### noPickupSymbol
335
-
336
- \{String\} The symbol used to indicate that no pickup is available at a stop. Defaults to `**`. To avoid having this symbol used in timetables, set it to `null`.
337
-
338
- ```json
339
- "noPickupSymbol": "**"
340
- ```
341
-
342
- ### noPickupText
343
-
344
- \{String\} The text used to describe that no pickup is available at a stop. Defaults to `No pickup available`.
345
-
346
- ```json
347
- "noPickupText": "No pickup available"
348
- ```
349
-
350
- ### noServiceSymbol
351
-
352
- \{String\} The symbol used when a specific trip does not serve a specified stop. Defaults to `-`. To avoid having this symbol used in timetables, set it to `null`.
353
-
354
- ```json
355
- "noServiceSymbol": "-"
356
- ```
357
-
358
- ### noServiceText
359
-
360
- \{String\} The text used to describe when a specific trip does not serve a specified stop. Defaults to `No service at this stop`.
361
-
362
- ```json
363
- "noServiceText": "No service at this stop"
364
- ```
365
-
366
- ### outputFormat
367
-
368
- \{String\} The file format of the timetables generated. Either `html`, `pdf` or `csv`. Defaults to `html`.
369
-
370
- ```json
371
- "outputFormat": "html"
372
- ```
373
-
374
- ### requestDropoffSymbol
375
-
376
- \{String\} The symbol used to indicate that riders must request to be dropped off at a stop. Defaults to `†`. To avoid having this symbol used in timetables, set it to `null`.
377
-
378
- ```json
379
- "requestDropoffSymbol": "†"
380
- ```
381
-
382
- ### requestDropoffText
383
-
384
- \{String\} The text used to describe that riders must request to be dropped off at a stop. Defaults to `Must request drop off`.
385
-
386
- ```json
387
- "requestDropoffText": "Must request drop off"
388
- ```
389
-
390
- ### requestPickupSymbol
391
-
392
- \{String\} The symbol used to indicate that riders must request pickup at a stop. Defaults to `***`. To avoid having this symbol used in timetables, set it to `null`.
393
-
394
- ```json
395
- "requestPickupSymbol": "***"
396
- ```
397
-
398
- ### requestPickupText
399
-
400
- \{String\} The text used to describe that riders must request pickup at a stop. Defaults to `Request stop - call for pickup`.
401
-
402
- ```json
403
- "requestPickupText": "Request stop - call for pickup"
404
- ```
405
-
406
- ### serviceNotProvidedOnText
407
-
408
- \{String\} The text used to label days where service is not provided. Defaults to `Service not provided on`.
409
-
410
- ```json
411
- "serviceNotProvidedOnText": "Service not provided on"
412
- ```
413
-
414
- ### serviceProvidedOnText
415
-
416
- \{String\} The text used to label days where service is provided. Defaults to `Service provided on`.
417
-
418
- ```json
419
- "serviceProvidedOnText": "Service provided on"
420
- ```
421
-
422
- ### showArrivalOnDifference
423
-
424
- \{Float\} Whether or not to show an arrival column/row in the timetable. It means, that if on at least one stop difference (stay on that stop) is **equal or greater** than specified here, the arrival time will be shown. Use `0` to show on each stop or `null` to skip showing an additional column for arrival.
425
-
426
- ```json
427
- "showArrivalOnDifference": 0.2
428
- ```
429
-
430
- ### showCalendarExceptions
431
-
432
- \{Boolean\} Whether or not to show a list of calendar exceptions below each timetable. Uses dates defined in calendar_dates.txt. Defaults to `true`.
433
-
434
- ```json
435
- "showCalendarExceptions": true
436
- ```
437
-
438
- ### showMap
439
-
440
- \{Boolean\} Whether or not to show a map of the route on the timetable. Defaults to `false`.
441
-
442
- If you'd rather just get all stops and route info as geoJSON, see [gtfs-to-geojson](https://github.com/blinktaginc/gtfs-to-geojson).
443
-
444
- ```json
445
- "showMap": false
446
- ```
447
-
448
- ### showOnlyTimepoint
449
-
450
- \{Boolean\} Whether or not all stops should be shown, or only stops with a `timepoint` value in [stop_times.txt](https://developers.google.com/transit/gtfs/reference?hl=en#stop_times_fields) that is considered exact (i.e. empty or `1`). Defaults to `false`, all stops shown.
451
-
452
- ```json
453
- "showOnlyTimepoint": false
454
- ```
455
-
456
- ### showRouteTitle
457
-
458
- \{Boolean\} Whether or not to show the route title and effective date at the top of the timetable page and the timetable label and notes before each timetable. Defaults to `true`, showing the route title and timetable labels and notes.
459
-
460
- ```json
461
- "showRouteTitle": true
462
- ```
463
-
464
- ### showStopCity
465
-
466
- \{Boolean\} Whether or not to show the city for each stop. City is determined by the `stop_city` field in the non-standard `stop_attributes.txt`. Only has an effect when the timetable's `orientation` is `horizontal` or `hourly`. Defaults to `false`.
467
-
468
- ```json
469
- "showStopCity": false
470
- ```
471
-
472
- ### showStopDescription
473
-
474
- \{Boolean\} Whether or not to show a stop description for each stop. Stop description is taken from the `stop_desc` field in`stops.txt`. Defaults to `false`.
475
-
476
- ```json
477
- "showStopDescription": false
478
- ```
479
-
480
- ### showStoptimesForRequestStops
481
-
482
- \{Boolean\} Whether or not to show times for stops that require a request for pickup or dropoff. Some agencies prefer to hide the actual stoptimes from stops that require a quest and instead just show the request pickup or dropoff symbols. See [`requestDropoffSymbol`](#requestdropoffsymbol) and [`requestPickupSymbol`](#requestpickupsymbol) for how to customize appearance. Defaults to `true`.
483
-
484
- ```json
485
- "showStoptimesForRequestStops": true
486
- ```
487
-
488
- ### skipImport
489
-
490
- \{Boolean\} Whether or not to skip importing from GTFS into SQLite. Useful for re-running the script if the GTFS data has not changed. If you use this option and the GTFS file hasn't been imported or you don't have an `sqlitePath` to a non-in-memory database specified, you'll get an error. Defaults to `false`.
491
-
492
- ```json
493
- "skipImport": false
494
- ```
495
-
496
- ### sortingAlgorithm
497
-
498
- \{String\} Defines trip-sorting algorithm used to determine the order that trips are shown in timetables.
499
-
500
- - `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.
501
- - `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.
502
- - `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.
503
- - `first` uses the first stop of the longest trip and sorts by stoptimes at that stop.
504
- - `last` uses the last stop of the longest trip and sorts by stoptimes at that stop.
505
-
506
- The default trip-sorting algorithm is `common`.
507
-
508
- ```json
509
- "sortingAlgorithm": "common"
510
- ```
511
-
512
- ### sqlitePath
513
-
514
- \{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`. Supports tilde as part of the path, like `~/Documents/gtfs`.
515
-
516
- ```json
517
- "sqlitePath": "/tmp/gtfs"
518
- ```
519
-
520
- ### startDate
521
-
522
- \{String\} A date in `YYYYMMDD` format to use to control which calendars are used for the timetables. Can be used with [endDate](#enddate) configuration options.
523
-
524
- Optional, defaults to using all available calendars if not defined. Overridden by `start_date` and `end_date` defined in `timetables.txt`.
525
-
526
- ```json
527
- "startDate": "2024-03-01"
528
- ```
529
-
530
- ### templatePath
531
-
532
- \{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`.
533
-
534
- ```json
535
- "templatePath": "views/custom/my-agency/"
536
- ```
537
-
538
- ### timeFormat
539
-
540
- \{String\} A string defining time format using moment.js tokens. [See full list of formatting options](https://momentjs.com/docs/#/displaying/format/). Defaults to `h:mma` which yields "8:36pm".
541
-
542
- ```json
543
- "timeFormat": "h:mma"
544
- ```
545
-
546
- ### useParentStation
547
-
548
- \{Boolean\} Whether or not to use the `parent_station` of a stop, if specified instead of the platform or boarding area. Useful if different trips for the same route have different platforms that you want to show up in the timetable as separate stops. Defaults to `true`.
549
-
550
- ```json
551
- "useParentStation": true
552
- ```
553
-
554
- ### verbose
555
-
556
- \{Boolean\} If you don't want the import script to print any output to the console, you can set `verbose` to `false`. Defaults to `true`.
557
-
558
- ```json
559
- "verbose": false
560
- ```
561
-
562
- ### zipOutput
563
-
564
- \{Boolean\} Whether or not to zip the output into one zip file named `timetables.zip`. Defaults to `false`.
565
-
566
- ```json
567
- "zipOutput": false
568
- ```
@@ -1,48 +0,0 @@
1
- ---
2
- id: current-usage
3
- title: Current Usage
4
- ---
5
-
6
- ## Transit agencies using GTFS-to-HTML
7
-
8
- Many transit agencies use GTFS-to-HTML to generate the schedule pages used on their websites, including:
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
- | [Mountain View Community Shuttle](https://mvcommunityshuttle.com) | Mountain View, California |
27
- | [MVgo](https://mvgo.org) | Mountain View, California |
28
- | [NW Connector](http://www.nworegontransit.org) | Northwest Oregon |
29
- | [Palo Verde Valley Transit Agency](http://pvvta.com) | Palo Verde Valley, California |
30
- | [Petaluma Transit](http://transit.cityofpetaluma.net) | Petaluma, California |
31
- | [Rogue Valley Transportation District](https://rvtd.org) | Medford, Oregon |
32
- | [RTC Washoe](https://www.rtcwashoe.com) | Reno, Nevada |
33
- | [Santa Barbara Metropolitan Transit District](https://sbmtd.gov) | Santa Barbara, California |
34
- | [Sonoma County Transit](http://sctransit.com) | Sonoma County, California |
35
- | [Tahoe Transportation District](https://www.tahoetransportation.org) | Lake Tahoe, California |
36
- | [Tahoe Truckee Area Regional Transit](https://tahoetruckeetransit.com) | Truckee, California |
37
- | [Transcollines](https://transcollines.ca) | Les Collines-de-l'Outaouais, Quebec |
38
- | [Tulare County Area Transit](https://ridetcat.org) | Tulare County, California |
39
- | [Victor Valley Transit](https://vvta.org) | Victory Valley, California |
40
- | [Worcester Regional Transit Authority](https://therta.com) | Worcester, Massachusetts |
41
-
42
- Are you using GTFS-to-HTML? Let us know via email (brendan@blinktag.com) and we'll add you to this list.
43
-
44
- ## Projects using GTFS-to-HTML
45
-
46
- - [`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.
47
-
48
- - [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!
@@ -1,13 +0,0 @@
1
- ---
2
- id: custom-templates
3
- title: Custom Templates
4
- ---
5
-
6
- GTFS-to-HTML includes a default template for generating HTML timetables in [`views/default`](https://github.com/BlinkTagInc/gtfs-to-html/tree/master/views/default). It is built using [pug](https://pugjs.org/).
7
-
8
- You can create your own template using the default one as a starting point.
9
-
10
- * Copy the `views/default` folder to `views/custom/myagency`.
11
- * Modifiy as needed.
12
- * All files within the `/views/custom` folder are .gitignored.
13
- * A template must include pug templates called `timetablepage.pug`, `timetablepage_full.pug`, `overview.pug`, and `overview_full.pug` (but can include any additional template files you'd like).
@@ -1,39 +0,0 @@
1
- ---
2
- id: introduction
3
- title: Introduction
4
- slug: /
5
- ---
6
-
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.
8
-
9
- ## Configurable and customizable
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
-
13
- ## Accessibility for all
14
-
15
- GTFS-to-HTML properly formats timetables to ensure they are screen-reader accessible and WCAG 2.0 compliant.
16
-
17
- ## Mobile responsiveness built in
18
-
19
- Built-in styling makes GTFS-to-HTML timetables ready to size and scroll easily on mobile phones and tablets.
20
-
21
- ## Schedule changes? A cinch.
22
-
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.
24
-
25
- ## Notes
26
-
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).
28
-
29
- ## Auto-generated maps
30
-
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.
32
-
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.
34
-
35
- GTFS-to-HTML uses the [`node-gtfs`](https://github.com/blinktaginc/node-gtfs) library to handle importing and querying GTFS data.
36
-
37
- ## GTFS-to-HTML on the web
38
-
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!