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,12 +0,0 @@
1
- ---
2
- id: logging-sql-queries
3
- title: Logging SQL Queries
4
- ---
5
-
6
- ## Logging SQL Queries
7
-
8
- You can add the option `debug` to your `config.json` file with the value of `true` to log all SQLite queries.
9
-
10
- ```json
11
- "debug": true
12
- ```
@@ -1,24 +0,0 @@
1
- ---
2
- id: previewing-html-output
3
- title: Previewing HTML output
4
- ---
5
-
6
- ## Previewing HTML output
7
-
8
- It can be useful to run the example Express application included in the `app` folder as a way to quickly preview all routes or see changes you are making to custom template.
9
-
10
- After an initial run of `gtfs-to-html`, the GTFS data will be downloaded and loaded into SQLite.
11
-
12
- You can view an individual route HTML on demand by running the included Express app:
13
-
14
- ```bash
15
- node app
16
- ```
17
-
18
- By default, `gtfs-to-html` will look for a `config.json` file in the project root. To specify a different path for the configuration file:
19
-
20
- ```bash
21
- node app --configPath /path/to/your/custom-config.json
22
- ```
23
-
24
- Once running, you can view the HTML in your browser at [localhost:3000](http://localhost:3000)
@@ -1,10 +0,0 @@
1
- ---
2
- id: processing-large-gtfs
3
- title: Processing very large GTFS files
4
- ---
5
-
6
- By default, node has a memory limit of 512 MB or 1 GB. If you have a very large GTFS file and want to use the option `showOnlyTimepoint` = `false` you may need to allocate more memory. Use the `max-old-space-size` option. For example to allocate 4 GB:
7
-
8
- ```
9
- NODE_OPTIONS=--max_old_space_size=4096 gtfs-to-html
10
- ```
@@ -1,136 +0,0 @@
1
- ---
2
- id: quick-start
3
- title: Quick Start
4
- ---
5
-
6
- ## Command Line Usage
7
-
8
- The `gtfs-to-html` command-line utility will download the GTFS file specified in `config.js` and then build the HTML timetables and save them in `html/:agency_key`.
9
-
10
- If you would like to use this library as a command-line utility, you can install it globally directly from [npm](https://npmjs.org):
11
- ```bash
12
- npm install gtfs-to-html -g
13
- ```
14
- Then you can run `gtfs-to-html`.
15
- ```bash
16
- gtfs-to-html
17
- ```
18
- ### Command-line options
19
-
20
- `configPath`
21
-
22
- Allows specifying a path to a configuration json file. By default, `gtfs-to-html` will look for a `config.json` file in the directory it is being run from. [See all configuration options](https://gtfstohtml.com/docs/configuration)
23
- ```bash
24
- gtfs-to-html --configPath /path/to/your/custom-config.json
25
- ```
26
- `skipImport`
27
-
28
- Skips importing GTFS into SQLite. Useful if you are rerunning with an unchanged GTFS file. If you use this option and the GTFS file hasn't been imported, you'll get an error.
29
- ```bash
30
- gtfs-to-html --skipImport
31
- ```
32
- ### Customizing the output
33
-
34
- You can create your own template to completely customize the HTML output using [custom templates](https://gtfstohtml.com/docs/custom-templates).
35
-
36
- ### Processing very large GTFS files.
37
-
38
- By default, node has a memory limit of 512 MB or 1 GB. If you have a very large GTFS file and want to use the option `showOnlyTimepoint` = `false` you may need to allocate more memory. Use the `max-old-space-size` option. For example to allocate 4 GB:
39
- ```bash
40
- NODE_OPTIONS=--max_old_space_size=4096 gtfs-to-html
41
- ```
42
- ## Docker Usage
43
-
44
- You can use both [`docker`](https://docker.com) and [`docker-compose`](https://docs.docker.com/compose/) to run GTFS-to-HTML.
45
-
46
- ### Dockerfile
47
-
48
- A `Dockerfile` is available in the `docker` directory.
49
-
50
- - Create a `config.json` file and save in the same directory as your `Dockerfile`. You can use `config-sample.json` from the project root as a starting point. For Docker usage, remove any `sqlitePath` and `templatePath` values from the config.json.
51
-
52
- - Build the docker image:
53
- ```bash
54
- docker build -t gtfs-to-html .
55
- ```
56
- - Run the docker image:
57
- ```bash
58
- docker run gtfs-to-html
59
- ```
60
- - Copy the generated HTML out of the docker container
61
-
62
- ```bash
63
- // Figure out what your container ID is
64
- docker container ls -a
65
-
66
- // Then copy the html folder from that container
67
- docker cp <YOUR IMAGE CONTAINER ID>:/html .
68
-
69
- // For example:
70
- docker cp ca45a38963d9:/html .
71
- ```
72
-
73
- ### Docker Compose
74
-
75
- Docker compose is used for multi-container Docker applications. In this context, it is just a convenient way to manage volumes. This allows (_i_) to get the generated HTML out of the docker container without explicitly copying with `docker cp`, and (_ii_) to tweak and run a new configuration without rebuilding the container from scratch.
76
-
77
- - Create a `config.json` file and save in the same directory as your `Dockerfile` and `docker-compose.yml`;
78
-
79
- - build and run the container:
80
- ```bash
81
- docker-compose up
82
- ```
83
- - the generated HTML will be available in the folder `html` next to docker files.
84
-
85
- Do you want to change something? Just delete the old HTML, change your `config.json`, and finally run `docker-compose up` again.
86
-
87
- ## Usage as a node module
88
-
89
- If you are using this as a node module as part of an application, you can include it in your project's `package.json` file.
90
-
91
- ### Code example
92
-
93
- ```javascript
94
- import gtfsToHtml from 'gtfs-to-html';
95
- import { readFile } from 'fs/promises';
96
- const config = JSON.parse(
97
- await readFile(new URL('./config.json', import.meta.url))
98
- );
99
-
100
- gtfsToHtml(config)
101
- .then(() => {
102
- console.log('HTML Generation Successful');
103
- process.exit();
104
- })
105
- .catch((err) => {
106
- console.error(err);
107
- process.exit(1);
108
- });
109
- ```
110
-
111
- ### Example Application
112
-
113
- An example Express application that uses `gtfs-to-html` is included in the `app` folder. After an initial run of `gtfs-to-html`, the GTFS data will be downloaded and loaded into SQLite.
114
-
115
- You can view an individual route HTML on demand by running the included Express app:
116
- ```bash
117
- node app
118
- ```
119
- By default, `gtfs-to-html` will look for a `config.json` file in the project root. To specify a different path for the configuration file:
120
- ```bash
121
- node app --configPath /path/to/your/custom-config.json
122
- ```
123
- Once running, you can view the HTML in your browser at [localhost:3000](http://localhost:3000)
124
-
125
- ## Usage as a hosted web app
126
-
127
- A [hosted version of GTFS-to-HTML as a service](https://run.gtfstohtml.com) allows you to use it entirely within your browser - no downloads or command line necessary. Currently, it is limited to relatively small GTFS files and doesn't offer support for [Custom Templates](/docs/custom-templates).
128
-
129
- It provides:
130
-
131
- - a web-based interface for finding GTFS feeds or ability to enter your own URL
132
- - support for adding [custom configuration](/docs/configuration) as JSON
133
- - creation of HTML or PDF timetables as a downloadable .zip file
134
- - a preview of all timetables generated directly in your browser
135
-
136
- [run.gtfstohtml.com](https://run.gtfstohtml.com)
@@ -1,54 +0,0 @@
1
- ---
2
- id: related-libraries
3
- title: Related Libraries
4
- ---
5
-
6
- ## `node-gtfs`
7
- [`https://github.com/blinktaginc/node-gtfs`](https://github.com/blinktaginc/node-gtfs)
8
- <div style={{ display: 'flex', gap: 20 }}>
9
- <div style={{ width: 100, flexShrink: 0 }}><img src="https://github.com/BlinkTagInc/node-gtfs/raw/master/docs/images/node-gtfs-logo.svg" alt="node-gtfs" width="100" /></div>
10
- <div><code>gtfs-to-html</code> uses the <a href="https://github.com/blinktaginc/node-gtfs">node-gtfs</a> library to handle importing and querying GTFS data. It provides methods for loading transit data in GTFS format into a SQLite database and methods to query for agencies, routes, stops, times, fares, calendars and other GTFS data. It also offers spatial queries to find nearby stops, routes and agencies and can convert stops and shapes to geoJSON format.</div>
11
- </div>
12
-
13
- ## `gtfs-to-geojson`
14
- [`https://github.com/blinktaginc/gtfs-to-geojson`](https://github.com/blinktaginc/gtfs-to-geojson)
15
- <div style={{ display: 'flex', gap: 20 }}>
16
- <div style={{ width: 100, flexShrink: 0 }}><img src="https://github.com/BlinkTagInc/gtfs-to-geojson/raw/master/docs/images/gtfs-to-geojson-logo.svg" alt="gtfs-to-geojson" width="100" /></div>
17
- <div><a href="https://github.com/blinktaginc/gtfs-to-geojson"><code>gtfs-to-geojson</code></a> converts transit data in GTFS format into geoJSON. This includes both shapes and stops. It can be configured to generate one geoJSON file per route or a single file which contains all routes for an agency. This is useful for creating maps of transit routes.</div>
18
- </div>
19
-
20
- ## `gtfs-to-chart`
21
- [`https://github.com/blinktaginc/gtfs-to-chart`](https://github.com/blinktaginc/gtfs-to-chart)
22
- <div style={{ display: 'flex', gap: 20 }}>
23
- <div style={{ width: 100, flexShrink: 0 }}><img src="https://github.com/BlinkTagInc/gtfs-to-chart/raw/master/docs/images/gtfs-to-chart-logo.svg" alt="gtfs-to-chart" width="100" /></div>
24
- <div><a href="https://github.com/blinktaginc/gtfs-to-chart"><code>gtfs-to-chart</code></a> generates a stringline chart in D3 using data from an agency's GTFS. This chart shows all trips for a specific route as they travel through space over a single day.</div>
25
- </div>
26
-
27
- ## Transit Departures Widget
28
- [`https://github.com/BlinkTagInc/transit-departures-widget`](https://github.com/BlinkTagInc/transit-departures-widget)
29
- <div style={{ display: 'flex', gap: 20 }}>
30
- <div style={{ width: 100, flexShrink: 0 }}><img src="https://github.com/BlinkTagInc/transit-departures-widget/raw/main/docs/images/transit-departures-widget-logo.svg" alt="Transit Departures Widget" width="100" /></div>
31
- <div>The <a href="https://github.com/BlinkTagInc/transit-departures-widget">Transit Departures Widget</a> generates a user-friendly transit realtime departures widget in HTML format directly from GTFS and GTFS-RT transit data. Most transit agencies have schedule data in GTFS format and many publish realtime departure information using GTFS-RT. This project generates HTML, JS and CSS for use on a transit agency website to allow users to see when the next vehicle is departing from a specific stop and includes features like caching, auto-refresh, url parameters and custom templates.</div>
32
- </div>
33
-
34
- ## GTFS Accessibility Validator
35
- [`https://github.com/BlinkTagInc/gtfs-accessibility-validator`](https://github.com/BlinkTagInc/gtfs-accessibility-validator)
36
- <div style={{ display: 'flex', gap: 20 }}>
37
- <div style={{ width: 100, flexShrink: 0 }}><img src="https://github.com/BlinkTagInc/gtfs-accessibility-validator/raw/main/docs/images/gtfs-accessibility-validator-logo.svg" alt="Transit Departures Widget" width="100" /></div>
38
- <div>The <a href="https://github.com/BlinkTagInc/gtfs-accessibility-validator">GTFS Accessibility Validator</a> checks transit data in GTFS format for fields and files related to accessibility. The accessibility guidelines are taken from the <a href="https://dot.ca.gov/cal-itp/california-transit-data-guidelines-v3_0#section-checklist">California Transit Data Guidelines</a> published by Caltrans.</div>
39
- </div>
40
-
41
- ## GTFS Text-to-Speech Tester
42
- [`https://github.com/BlinkTagInc/node-gtfs-tts`](https://github.com/BlinkTagInc/node-gtfs-tts)
43
- <div style={{ display: 'flex', gap: 20 }}>
44
- <div style={{ width: 100, flexShrink: 0 }}><img src="https://github.com/BlinkTagInc/node-gtfs-tts/raw/main/docs/images/gtfs-tts-logo.svg" alt="Transit Departures Widget" width="100" /></div>
45
- <div>The <a href="https://github.com/BlinkTagInc/node-gtfs-tts">GTFS Text-to-Speech Tester</a> is a command-line tool that will read all GTFS stop names using Text-to-Speech and allow flagging which names need Text-to-Speech values for tts_stop_name in stops.txt. Using this tool is the quickest way to determine which stops need phonetic spellings, abbreviations written out, large digits written as words, ordinals written out or other changes so that they can be read.</div>
46
- </div>
47
-
48
- ## `node-gtfs-realtime`
49
- [`https://github.com/BlinkTagInc/node-gtfs-realtime`](https://github.com/BlinkTagInc/node-gtfs-realtime)
50
- <div style={{ display: 'flex', gap: 20 }}>
51
- <div style={{ width: 100, flexShrink: 0 }}><img src="https://github.com/BlinkTagInc/node-gtfs-realtime/raw/main/docs/images/node-gtfs-realtime-logo.svg
52
- " alt="Transit Departures Widget" width="100" /></div>
53
- <div>GTFS-realtime transit data is in <a href="https://developers.google.com/protocol-buffers">protobuf format</a> which means its not human-readable by default. <code>node-GTFS-Realtime</code> aims to make it fast and easy to inspect GTFS-realtime data by providing a one-line command for downloading GTFS-realtime format data and converting to JSON. Try it out by running <code>npx gtfs-realtime http://api.bart.gov/gtfsrt/tripupdate.aspx</code> in your terminal.</div>
54
- </div>
@@ -1,29 +0,0 @@
1
- ---
2
- id: reviewing-changes
3
- title: Reviewing changes between schedule updates
4
- ---
5
-
6
- When an agency updates their schedule and releases an updated GTFS file, it can be useful to review what has changed when generating HTML timetables. There are two ways to review what has changed:
7
-
8
- ## Use `git`
9
-
10
- Use git to version control the output of GTFS-to-HTML. Make a git repository for this purpose and check in a set of timetable HTML files. Then, when generating updated timetables overwrite the old timetables and review the changes using your favorite git tool, such as [Github Desktop](https://desktop.github.com).
11
-
12
-
13
- ## Use `diff2html`
14
-
15
- `diff2html` is a command line tool to easily compare two folders of html timetables.
16
-
17
- First generate two folders of GTFS-to-HTML output to compare. To make it easy to see what has changed, set the `beautify` option to `true` in the config file for both sets of output.
18
-
19
- Then, install diff2html:
20
-
21
- ```bash
22
- npm install -g diff2html-cli
23
- ```
24
-
25
- Use the `diff` command and pipe the output to `diff2html` to get a nicely formatted list of the differences between two folders of html files.
26
-
27
- ```bash
28
- diff -bur html/folder1 html/folder2 | diff2html -i stdin
29
- ```
@@ -1,30 +0,0 @@
1
- ---
2
- id: stop-attributes
3
- title: stop_attributes.txt
4
- ---
5
-
6
- This is an optional, non-standard file called `stop_attributes.txt` which can be included in an agency's GTFS. This can be used to add additional useful information not included in GTFS, such as the city of each stop.
7
-
8
- ### Column Definitions
9
-
10
- | column name | description |
11
- | ----------- | ----------- |
12
- | `stop_id` | A `stop_id` from `stops.txt` |
13
- | `stop_city` | The name of the city or region that the stop is in. |
14
-
15
- ### Example
16
-
17
- ```csv
18
- stop_id,stop_city
19
- 1001,"Fresno, CA"
20
- 1002,"Fresno, CA"
21
- 1003,"Hanford, CA"
22
- 1004,"Hanford, CA"
23
- 1005,"Lemoore, CA"
24
- ```
25
-
26
- An example of this file is located in [examples/stop_attributes.txt](https://github.com/BlinkTagInc/gtfs-to-html/blob/master/examples/stop_attributes.txt).
27
-
28
- :::note
29
- This feature is in development. Fields may be added or changed in the future.
30
- :::
@@ -1,12 +0,0 @@
1
- ---
2
- id: contact
3
- title: Questions, Feedback and Support
4
- ---
5
-
6
- ## Issues
7
-
8
- GTFS-to-HTML is an open source project. If you encounter an issue when using it, please [open an issue on github](https://github.com/BlinkTagInc/gtfs-to-html/issues). Pull requests are welcome!
9
-
10
- # Questions, Feedback and Support
11
-
12
- Have questions about GTFS-to-HTML or need help integrating it into your agency's website? Email us at brendan@blinktag.com.
@@ -1,44 +0,0 @@
1
- ---
2
- id: timetable-notes-references
3
- title: timetable_notes_references.txt
4
- ---
5
-
6
- This is an optional, non-standard file called `timetable_notes_references.txt` which can be included in an agency's GTFS. This file specifies where notes that are defined in [`timetable_notes.txt`](/docs/timetable-notes) should be placed. Using `timetable_notes_references.txt` notes can be placed on specific stops, trips, stoptimes, routes or timetables.
7
-
8
- ### Column Definitions
9
-
10
- | column name | description |
11
- | ----------- | ----------- |
12
- | `note_id` | The `note_id` that this reference refers to. |
13
- | `timetable_id` | Use to attach a note to an entire timetable, or in combination with `stop_id` to restrict which timetable a a note should show up on. Optional. |
14
- | `route_id` | Use to attach a note to all timetables for a specific route, or in combination with `stop_id` to restrict which timetable a a note should show up on. Optional. |
15
- | `trip_id` | Use to attach a note to a specific trip row or column, or in combination with `stop_id` to restrict to a specific stoptime. Optional. |
16
- | `stop_id` | Use to attach a note to a specific stop row or column, or in combination with `trip_id` to restrict to a specific stoptime. Optional. |
17
- | `stop_sequence` | Use along with a `stop_id` to attach a note to a specific stop and stop_sequence. Useful for routes that serve the same stop more than once in a trip such as circular routes. Optional. |
18
- | `show_on_stoptime` | A binary value that indicates whether this note should show up on all stoptimes of a trip or stop that it applies to. Valid options are `0` and `1`. Optional, defaults to `0`. |
19
-
20
- ### Example
21
-
22
- ```csv
23
- note_id,timetable_id,route_id,trip_id,stop_id,stop_sequence,show_on_stoptime
24
- 1,131,,,,,
25
- 2,,17,,,,
26
- 3,,,17010,,,1
27
- 4,,,,254514,,
28
- 5,,,,254514,11,
29
- 6,,,17010,235269,,
30
- ```
31
-
32
- Note `1` applies to only a specific timetable and it applies to the entire timetable. No other timetables will have this note.
33
-
34
- Note `2` applies only to a specific route. All timetables for that route will have this note.
35
-
36
- Note `3` applies only to a specific trip. Because it has `show_on_stoptime` set to `1` it shows up in the trip header and also for each timepoint of that trip in all timetables that have that trip.
37
-
38
- Note `4` applies only to a specific stop. It shows up by the stop name in all timetables that use that stop.
39
-
40
- Note `5` applies only to a specific stop and stop_sequence. It shows up by the stop name only if that stop has that stop_sequence value `11` for any trip in that timetable.
41
-
42
- Note `6` applies only to a specific stop and trip. It only shows up by the timepoint that matches the specific trip_id and stop_id.
43
-
44
- An example of this file is located in [examples/timetable_notes_references.txt](https://github.com/BlinkTagInc/gtfs-to-html/blob/master/examples/timetable_notes_references.txt).
@@ -1,33 +0,0 @@
1
- ---
2
- id: timetable-notes
3
- title: timetable_notes.txt
4
- ---
5
-
6
- This is an optional, non-standard file called `timetable_notes.txt` which can be included in an agency's GTFS. This file specifies notes about specific stops, trips, stoptimes, routes or timetables that should be included in the HTML output of a timetable.
7
-
8
- The symbol and text of each note is defined in this file while the locations that each note should be placed is defined in [`timetable_notes_references.txt`](/docs/timetable-notes-references). This allows one note to be used in multiple places, such as two different trips, without having to duplicate the text of the note multiple times.
9
-
10
- Notes can have a `symbol` specified or can be left blank and GTFS-to-HTML will assign a letter a-z to each note (falling back to using integers if more than 26 symbols are needed).
11
-
12
- ### Column Definitions
13
-
14
- | column name | description |
15
- | ----------- | ----------- |
16
- | `note_id` | A unique ID for the timetable note |
17
- | `symbol` | The symbol used to indicate the note, such as `§`. Optional, if omitted a letter of the alphabet starting with `a` will be used. |
18
- | `note` | The text of the note, such as "This stop is sometimes underwater". [Markdown syntax](https://daringfireball.net/projects/markdown/syntax) is supported which allows including links and formatting. |
19
-
20
- ### Example
21
-
22
- ```csv
23
- note_id,symbol,note
24
- 1,,"No service during baseball games"
25
- 2,,"No express service during a full moon"
26
- 3,,"Trip is cancelled if drawbridge is up"
27
- 4,,"This stop is sometimes underwater"
28
- 5,,"Driver will only stop if prearranged by fax"
29
- 6,§,"Vehicle can arrive early if leap second is added during trip and *will not wait*"
30
- 7,,"[See list of holidays](http://transitagency.org/holidays)"
31
- ```
32
-
33
- An example of this file is located in [examples/timetable_notes.txt](https://github.com/BlinkTagInc/gtfs-to-html/blob/master/examples/timetable_notes.txt).
@@ -1,37 +0,0 @@
1
- ---
2
- id: timetable-pages
3
- title: timetable_pages.txt
4
- ---
5
-
6
- This is an optional, non-standard file called `timetable_pages.txt` which can be included in an agency's GTFS. This file specifies which HTML timetable to group together into a single HTML page.
7
-
8
- If you'd like to show timetables both directions of a route on the same HTML page or show timetables for weekdays and weekends on the same HTML page then you'll need `timetable_pages.txt`.
9
-
10
- ### Column Definitions
11
-
12
- | column name | description |
13
- | ----------- | ----------- |
14
- | `timetable_page_id` | A unique ID for the timetable page |
15
- | `timetable_page_label` | A label that will show up on the top of the page. Optional, defaults to using route name. |
16
- | `filename` | The filename to use for the generated HTML file. Optional, defaults to `timetable_page_id` with file extension `.html`, for example `1.html`. |
17
-
18
- ### Example
19
-
20
- ```csv
21
- timetable_page_id,timetable_page_label,filename
22
- 1,"Cloverdale, Healdsburg, Windsor, Santa Rosa","60.html"
23
- 2,"Sebastopol, Rohnert Park, Cotati","26.html"
24
- ```
25
-
26
- ### Simple Example
27
-
28
- This example just lists `timetable_page_id` and will default to creating `1.html`, `2.html` and `3.html`.
29
-
30
- ```csv
31
- timetable_page_id,timetable_page_label,filename
32
- 1,,
33
- 2,,
34
- 3,,
35
- ```
36
-
37
- An example of this file is located in [examples/timetable_pages.txt](https://github.com/BlinkTagInc/gtfs-to-html/blob/master/examples/timetable_pages.txt).
@@ -1,63 +0,0 @@
1
- ---
2
- id: timetable-stop-order
3
- title: timetable_stop_order.txt
4
- ---
5
-
6
- This is an optional, non-standard file called `timetable_stop_order.txt` which can be included in an agency's GTFS. It is used to specify stop order for a particular timetable. It is useful when generating combined timetables for multiple overlapping routes, or exerting fine-grained control on stop order.
7
-
8
- This file is often not needed. If all trips for a route serve the same set of stops, or all trips stop order is topologically sortable, there is no need to use `timetable_stop_order.txt` for that route. `timetable_stop_order.txt` is only needed for routes where some trips serve completely different stops than other trips and where the order can not be determined using a directed graph.
9
-
10
- GTFS-to-HTML uses [toposort](https://www.npmjs.com/package/toposort) to sort stops for each trip topologically iin a directed graph to determine a valid stop order for use in a timetable. If stop order across trips is cyclic or disjointed (i.e. not all trips have a common stop) then the stop order from trip with most number of stops is used as a fallback.
11
-
12
- | column name | description |
13
- | ----------- | ----------- |
14
- | `timetable_id` | The ID of the timetable from `timetables.txt` |
15
- | `stop_id` | The ID of the stop from `stops.txt`. |
16
- | `stop_sequence` | An assigned integer identifying the order of stops to be presented in the timetable. The values for `stop_sequence` must be non-negative integers, and they must increase along the trip. This value does not need to match the `stop_sequence` found in `stop_times.txt`. |
17
-
18
- ### Example
19
-
20
- Route 1, trip 1 stops:
21
-
22
- _____/‾‾‾\___
23
- A B C D E H I
24
-
25
- Route 2, trip 2 stops:
26
-
27
- ‾‾‾‾‾\___/‾‾‾
28
- A B C F G H I
29
-
30
- The `timetable_stop_order.txt` for this route would be:
31
-
32
- ```csv
33
- timetable_id,stop_id,stop_sequence
34
- 1,A,0
35
- 1,B,1
36
- 1,C,2
37
- 1,D,3
38
- 1,E,4
39
- 1,F,5
40
- 1,G,6
41
- 1,H,7
42
- 1,I,8
43
- ```
44
-
45
- Or, if you'd like to show stops `F` and `G` before stops `D` and `E` on the timetable:
46
- ```csv
47
- timetable_id,stop_id,stop_sequence
48
- 1,A,0
49
- 1,B,1
50
- 1,C,2
51
- 1,F,3
52
- 1,G,4
53
- 1,D,5
54
- 1,E,6
55
- 1,H,7
56
- 1,I,8
57
- ```
58
-
59
- An example of this file is located in [examples/timetable_stop_order.txt](https://github.com/BlinkTagInc/gtfs-to-html/blob/master/examples/timetable_stop_order.txt).
60
-
61
- ## Stops with different arrival and departure times
62
-
63
- Stoptimes with different arrival and departure times will be shown twice in a row and labeled as "(arrival)" and "(departure)". There is no need to put the same stop in timetable_stop_order twice in a row.
@@ -1,64 +0,0 @@
1
- ---
2
- id: timetables
3
- title: timetables.txt
4
- ---
5
-
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.
7
-
8
- ### Column Definitions
9
-
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 `YYYYMMDD` format. |
16
- | `end_date` | The end date for this timetable in `YYYYMMDD` 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`. |
34
-
35
- ### Example
36
-
37
- ```csv
38
- 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
39
- 0,2034,0,20150101,20151122,1,1,1,1,1,1,0,00:00:00,13:00:00,0,101 Northbound,Mon-Sat AM,horizontal,1,0,Northbound,0
40
- 1,2034,0,20150101,20151122,1,1,1,1,1,1,0,13:00:00,24:00:00,0,101 Northbound,Mon-Sat PM,horizontal,1,1,Northbound,0
41
- 2,2035,1,20150819,20151122,1,1,0,1,1,0,0,,,0,101T Northbound,"Mon,Tue,Thur,Fri",horizontal,1,0,Northbound,0
42
- 3,2035,0,20150819,20151122,0,0,1,0,0,0,0,,,0,101T Southbound,Wednesday,horizontal,1,0,Southbound,0
43
- 4,2036,1,20150101,20151122,0,0,0,0,0,0,1,,,0,102 Eastbound,Sunday,horizontal,1,0,Eastbound,0
44
- 5,2036,0,20150101,20151122,1,1,1,1,1,0,0,,,0,102 Westbound,Mon-Fri,horizontal,1,0,Westbound,0
45
- 6,2036,1,20150101,20151122,0,0,0,0,0,1,0,,,0,102 Eastbound,Saturday,horizontal,1,0,Eastbound,0
46
- 7,2037,0,20150101,20151122,1,1,1,1,1,0,0,,,0,103 Westbound,Mon-Fri,horizontal,1,0,Westbound,0
47
- ```
48
-
49
- An example of this file is located in [examples/timetables.txt](https://github.com/BlinkTagInc/gtfs-to-html/blob/master/examples/timetables.txt).
50
-
51
- ## Multi-route Timetables
52
-
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`.
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
- ```