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.
- package/package.json +21 -8
- package/.eslintrc.json +0 -28
- package/.husky/pre-commit +0 -4
- package/CHANGELOG.md +0 -1018
- package/app/index.js +0 -138
- package/bin/gtfs-to-html.js +0 -48
- package/config-sample.json +0 -59
- package/docker/Dockerfile +0 -14
- package/docker/README.md +0 -5
- package/docker/docker-compose.yml +0 -10
- package/examples/stop_attributes.txt +0 -6
- package/examples/timetable_notes.txt +0 -8
- package/examples/timetable_notes_references.txt +0 -8
- package/examples/timetable_pages.txt +0 -3
- package/examples/timetable_stop_order.txt +0 -16
- package/examples/timetables.txt +0 -9
- package/index.js +0 -1
- package/lib/file-utils.js +0 -202
- package/lib/formatters.js +0 -518
- package/lib/geojson-utils.js +0 -96
- package/lib/gtfs-to-html.js +0 -214
- package/lib/log-utils.js +0 -215
- package/lib/template-functions.js +0 -192
- package/lib/time-utils.js +0 -90
- package/lib/utils.js +0 -1702
- package/views/default/css/overview_styles.css +0 -197
- package/views/default/css/timetable_pdf_styles.css +0 -7
- package/views/default/css/timetable_styles.css +0 -447
- package/views/default/formatting_functions.pug +0 -113
- package/views/default/js/system-map.js +0 -594
- package/views/default/js/timetable-map.js +0 -358
- package/views/default/js/timetable-menu.js +0 -63
- package/views/default/layout.pug +0 -11
- package/views/default/overview.pug +0 -27
- package/views/default/overview_full.pug +0 -16
- package/views/default/timetable_continuation_as.pug +0 -7
- package/views/default/timetable_continuation_from.pug +0 -7
- package/views/default/timetable_horizontal.pug +0 -42
- package/views/default/timetable_hourly.pug +0 -30
- package/views/default/timetable_menu.pug +0 -48
- package/views/default/timetable_note_symbol.pug +0 -5
- package/views/default/timetable_stop_name.pug +0 -13
- package/views/default/timetable_stoptime.pug +0 -17
- package/views/default/timetable_vertical.pug +0 -67
- package/views/default/timetablepage.pug +0 -66
- package/views/default/timetablepage_full.pug +0 -22
- package/www/README.md +0 -33
- package/www/babel.config.js +0 -3
- package/www/blog/2020-07-07-New-Documentation.md +0 -12
- package/www/blog/2020-08-20-Version-1.0.0.md +0 -29
- package/www/blog/2021-11-06-CSV-Export.md +0 -26
- package/www/docs/additional-files.md +0 -24
- package/www/docs/configuration.md +0 -568
- package/www/docs/current-usage.md +0 -48
- package/www/docs/custom-templates.md +0 -13
- package/www/docs/introduction.md +0 -39
- package/www/docs/logging-sql-queries.md +0 -12
- package/www/docs/previewing-html-output.md +0 -24
- package/www/docs/processing-large-gtfs.md +0 -10
- package/www/docs/quick-start.md +0 -136
- package/www/docs/related-libraries.md +0 -54
- package/www/docs/reviewing-changes.md +0 -29
- package/www/docs/stop-attributes.md +0 -30
- package/www/docs/support.md +0 -12
- package/www/docs/timetable-notes-references.md +0 -44
- package/www/docs/timetable-notes.md +0 -33
- package/www/docs/timetable-pages.md +0 -37
- package/www/docs/timetable-stop-order.md +0 -63
- package/www/docs/timetables.md +0 -64
- package/www/docusaurus.config.js +0 -104
- package/www/package.json +0 -21
- package/www/sidebars.js +0 -10
- package/www/src/css/custom.css +0 -25
- package/www/src/pages/index.js +0 -270
- package/www/src/pages/styles.module.css +0 -53
- package/www/static/.nojekyll +0 -0
- package/www/static/img/favicon.ico +0 -0
- package/www/static/img/gtfs-to-html-logo.svg +0 -18
- package/www/static/img/overview-example.jpg +0 -0
- package/www/static/img/timetable-example.jpg +0 -0
- package/www/static/img/undraw_happy_music.svg +0 -1
- package/www/static/img/undraw_proud_coder.svg +0 -1
- package/www/static/img/undraw_spreadsheets.svg +0 -1
- package/www/yarn.lock +0 -8351
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
- let columnCount = timetable.stops.length;
|
|
2
|
-
- if (config.showStopCity) {
|
|
3
|
-
- columnCount += timetable.stops.reduce((memo, stop, index) => {
|
|
4
|
-
- if (index === 0 || stop.stop_city !== timetable.stops[index - 1].stop_city) {
|
|
5
|
-
- memo += 1;
|
|
6
|
-
- }
|
|
7
|
-
- return memo;
|
|
8
|
-
- }, 0);
|
|
9
|
-
- }
|
|
10
|
-
- const timetableHasTripNotes = timetable.orderedTrips.flatMap(trip => getNotesForTrip(timetable.notes, trip)).length > 0;
|
|
11
|
-
.table-container
|
|
12
|
-
table.table-vertical(summary= getTimetableSummary(timetable) data-orientation="vertical")
|
|
13
|
-
caption.sr-only= `${timetable.timetable_label} | ${timetable.dayList}`
|
|
14
|
-
colgroup
|
|
15
|
-
each stop, idx in timetable.stops
|
|
16
|
-
col(id=`stop_id_${formatHtmlId(stop.stop_id)}` class=`stop-${idx}` data-stop-id=`${stop.stop_id}` data-is-timepoint=`${stop.is_timepoint}`)
|
|
17
|
-
thead
|
|
18
|
-
tr
|
|
19
|
-
if timetableHasTripNotes || timetable.routes.length > 1
|
|
20
|
-
th
|
|
21
|
-
if timetable.has_continues_from_route
|
|
22
|
-
th.stop-header.continues-from Continues from route
|
|
23
|
-
|
|
24
|
-
- let previousCity = null;
|
|
25
|
-
each stop, idx in timetable.stops
|
|
26
|
-
if stop.stop_city !== '' && previousCity !== stop.stop_city && config.showStopCity
|
|
27
|
-
th.city-column= stop.stop_city
|
|
28
|
-
- previousCity = stop.stop_city
|
|
29
|
-
|
|
30
|
-
th.stop-header(scope="col" width=`${(100 / columnCount).toFixed(2)}%`)
|
|
31
|
-
include timetable_stop_name.pug
|
|
32
|
-
|
|
33
|
-
if timetable.has_continues_as_route
|
|
34
|
-
th.stop-header.continues-as Continues as route
|
|
35
|
-
|
|
36
|
-
tbody
|
|
37
|
-
if timetable.frequencies && !timetable.frequencyExactTimes
|
|
38
|
-
tr.trip-row
|
|
39
|
-
if timetableHasTripNotes || timetable.routes.length > 1
|
|
40
|
-
td
|
|
41
|
-
if timetable.has_continues_from_route
|
|
42
|
-
td
|
|
43
|
-
|
|
44
|
-
td.trip-frequency(colspan=`${columnCount}`)!= formatFrequencyWarning(timetable.frequencies)
|
|
45
|
-
|
|
46
|
-
if timetable.has_continues_as_route
|
|
47
|
-
td
|
|
48
|
-
each trip, idx in timetable.orderedTrips
|
|
49
|
-
tr.trip-row(id=`trip_id_${formatHtmlId(trip.trip_id)}`)
|
|
50
|
-
if timetableHasTripNotes || timetable.routes.length > 1
|
|
51
|
-
td.trip-notes= formatTripName(trip, idx, timetable)
|
|
52
|
-
each note in getNotesForTrip(timetable.notes, trip)
|
|
53
|
-
include timetable_note_symbol.pug
|
|
54
|
-
if timetable.has_continues_from_route
|
|
55
|
-
include timetable_continuation_from.pug
|
|
56
|
-
|
|
57
|
-
- let previousCity = null;
|
|
58
|
-
each stop in timetable.stops
|
|
59
|
-
if stop.stop_city !== '' && previousCity !== stop.stop_city && config.showStopCity
|
|
60
|
-
td
|
|
61
|
-
- previousCity = stop.stop_city
|
|
62
|
-
|
|
63
|
-
- stoptime = stop.trips[idx]
|
|
64
|
-
include timetable_stoptime.pug
|
|
65
|
-
|
|
66
|
-
if timetable.has_continues_as_route
|
|
67
|
-
include timetable_continuation_as.pug
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
include formatting_functions.pug
|
|
2
|
-
|
|
3
|
-
<!-- Timetable generated on #{new Date().toISOString()} using GTFS-to-HTML version #{config.gtfsToHtmlVersion} -->
|
|
4
|
-
.timetable-page(class=`menu-type-${config.menuType}`)
|
|
5
|
-
if config.showRouteTitle
|
|
6
|
-
- const timetableRouteList = _.uniqBy(_.flatMap(timetablePage.consolidatedTimetables, timetable => timetable.routes), 'route_id')
|
|
7
|
-
h1
|
|
8
|
-
each route in timetableRouteList
|
|
9
|
-
.route-color-swatch-large(style=`background-color: ${formatRouteColor(route)}; color: ${formatRouteTextColor(route)};`)= route.route_short_name || ''
|
|
10
|
-
div= timetablePage.timetable_page_label || timetableRouteList.map(route => formatRouteName(route)).join(' and ')
|
|
11
|
-
if config.effectiveDate
|
|
12
|
-
.effective-date= `Effective ${config.effectiveDate}`
|
|
13
|
-
|
|
14
|
-
include timetable_menu.pug
|
|
15
|
-
|
|
16
|
-
each timetable in timetablePage.consolidatedTimetables
|
|
17
|
-
.timetable(id=`timetable_id_${formatHtmlId(timetable.timetable_id)}` data-day-list=timetable.dayList data-direction-name=timetable.direction_name data-timetable-id=timetable.timetable_id data-direction-id=timetable.direction_id data-route-id=timetable.route_ids.join('_'))
|
|
18
|
-
if config.showRouteTitle
|
|
19
|
-
.timetable-label
|
|
20
|
-
h2= `${timetable.timetable_label} | ${timetable.dayListLong}`
|
|
21
|
-
each note in getNotesForTimetableLabel(timetable.notes)
|
|
22
|
-
include timetable_note_symbol.pug
|
|
23
|
-
if timetable.service_notes !== null
|
|
24
|
-
.timetable-service-notes= timetable.service_notes
|
|
25
|
-
|
|
26
|
-
if config.showMap
|
|
27
|
-
.map(id=`map_timetable_id_${formatHtmlId(timetable.timetable_id)}`)
|
|
28
|
-
script.
|
|
29
|
-
(function() {
|
|
30
|
-
const { id, geojson, routes } = !{JSON.stringify(prepareMapData(timetable))};
|
|
31
|
-
createMap(id, geojson, routes);
|
|
32
|
-
})();
|
|
33
|
-
|
|
34
|
-
if timetable.orientation === 'horizontal'
|
|
35
|
-
include timetable_horizontal.pug
|
|
36
|
-
else if timetable.orientation === 'hourly'
|
|
37
|
-
include timetable_hourly.pug
|
|
38
|
-
else if timetable.orientation === 'vertical'
|
|
39
|
-
include timetable_vertical.pug
|
|
40
|
-
|
|
41
|
-
.timetable-footer
|
|
42
|
-
if hasNotesOrNotices(timetable)
|
|
43
|
-
.notes
|
|
44
|
-
if timetable.requestPickupSymbolUsed
|
|
45
|
-
.note(id=`note-${timetable.timetable_id}-request-pickup`)= `${config.requestPickupSymbol} = ${config.requestPickupText}`
|
|
46
|
-
if timetable.noPickupSymbolUsed
|
|
47
|
-
.note(id=`note-${timetable.timetable_id}-no-pickup`)= `${config.noPickupSymbol} = ${config.noPickupText}`
|
|
48
|
-
if timetable.requestDropoffSymbolUsed
|
|
49
|
-
.note(id=`note-${timetable.timetable_id}-request-dropoff`)= `${config.requestDropoffSymbol} = ${config.requestDropoffText}`
|
|
50
|
-
if timetable.noDropoffSymbolUsed
|
|
51
|
-
.note(id=`note-${timetable.timetable_id}-no-dropoff`)= `${config.noDropoffSymbol} = ${config.noDropoffText}`
|
|
52
|
-
if timetable.noServiceSymbolUsed
|
|
53
|
-
.note(id=`note-${timetable.timetable_id}-no-service`)= `${config.noServiceSymbol} = ${config.noServiceText}`
|
|
54
|
-
if timetable.interpolatedStopSymbolUsed
|
|
55
|
-
.note(id=`note-${timetable.timetable_id}-interpolated-stop`)= `${config.interpolatedStopSymbol} = ${config.interpolatedStopText}`
|
|
56
|
-
each note in _.uniqBy(timetable.notes, 'note_id')
|
|
57
|
-
.note(id=`note-${timetable.timetable_id}-${note.note_id}`)
|
|
58
|
-
span= note.symbol
|
|
59
|
-
span =
|
|
60
|
-
span!= md(note.note)
|
|
61
|
-
|
|
62
|
-
if config.showCalendarExceptions && timetable.calendarDates.includedDates.length
|
|
63
|
-
.included-dates= `${config.serviceProvidedOnText}: ${timetable.calendarDates.includedDates.join(', ')}`
|
|
64
|
-
|
|
65
|
-
if config.showCalendarExceptions && timetable.calendarDates.excludedDates.length
|
|
66
|
-
.excluded-dates= `${config.serviceNotProvidedOnText}: ${timetable.calendarDates.excludedDates.join(', ')}`
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
extends layout
|
|
2
|
-
block content
|
|
3
|
-
include timetablepage.pug
|
|
4
|
-
|
|
5
|
-
block extraHeader
|
|
6
|
-
script(src="https://unpkg.com/jquery@3.7.1/dist/jquery.min.js" crossorigin="anonymous")
|
|
7
|
-
|
|
8
|
-
if config.menuType === 'radio'
|
|
9
|
-
script(src=`${config.assetPath}js/timetable-menu.js`)
|
|
10
|
-
|
|
11
|
-
if config.showMap
|
|
12
|
-
script(src="https://api.mapbox.com/mapbox-gl-js/v3.5.1/mapbox-gl.js")
|
|
13
|
-
script.
|
|
14
|
-
mapboxgl.accessToken = '#{config.mapboxAccessToken}';
|
|
15
|
-
script(src=`${config.assetPath}js/timetable-map.js`)
|
|
16
|
-
|
|
17
|
-
link(href="https://api.mapbox.com/mapbox-gl-js/v3.5.1/mapbox-gl.css" rel="stylesheet")
|
|
18
|
-
|
|
19
|
-
link(rel="stylesheet" href=`${config.assetPath}css/timetable_styles.css`)
|
|
20
|
-
if config.outputFormat === 'pdf'
|
|
21
|
-
link(rel="stylesheet" href=`${config.assetPath}css/timetable_pdf_styles.css`)
|
|
22
|
-
|
package/www/README.md
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# Website
|
|
2
|
-
|
|
3
|
-
This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator.
|
|
4
|
-
|
|
5
|
-
### Installation
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
$ yarn
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
### Local Development
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
$ yarn start
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server.
|
|
18
|
-
|
|
19
|
-
### Build
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
$ yarn build
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
This command generates static content into the `build` directory and can be served using any static contents hosting service.
|
|
26
|
-
|
|
27
|
-
### Deployment
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
|
package/www/babel.config.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
slug: new_documentation
|
|
3
|
-
title: New Documentation
|
|
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: [docusaurus]
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
GTFS-to-HTML's documentation now has a better layout with more room for explanation and examples. A full documentation website at https://gtfstohtml.com has been set up.
|
|
11
|
-
|
|
12
|
-
Thanks to [Docusaurus](https://docusaurus.io) for making documentation websites easy to generate.
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
slug: version_1
|
|
3
|
-
title: Version 1.0.0
|
|
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: [sqlite]
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
Nine years after [first publishing `node-gtfs`](https://github.com/BlinkTagInc/node-gtfs/commit/90b1d3a0e93972b0e8754ca1103b25a8cebdfd7e), GTFS-to-HTML is ready for version 1.0.
|
|
11
|
-
|
|
12
|
-
Version 1.0 of GTFS-to-HTML switches away from using MongoDB to using SQLite3 for the underlying database. It uses Version 2.0 of [node-gtfs](https://github.com/BlinkTagInc/node-gtfs), which made a similar switch in database used.
|
|
13
|
-
|
|
14
|
-
SQLite makes it easier to query GTFS data in SQL format if needed instead of using the [built-in query methods](https://github.com/BlinkTagInc/node-gtfs#query-methods). See [this query](https://github.com/BlinkTagInc/gtfs-to-html/blob/edaa6327999e8163f79015f2e7b037b9e7344a67/lib/utils.js#L360) as a example of selecting calendar dates while excluding specific service_ids.
|
|
15
|
-
|
|
16
|
-
The switch to SQLite also resulted in a 66% reduction in HTML generation times.
|
|
17
|
-
|
|
18
|
-
The breaking changes in GTFS-to-HTML 1.0.0:
|
|
19
|
-
|
|
20
|
-
* `config.json` accepts a `sqlitePath` instead of a `mongoUrl`.
|
|
21
|
-
* `route_color` and `route_text_color` in exported geoJSON now have a # prepended to the hex color. So `#45AA00` instead of `45AA00`.
|
|
22
|
-
* The `dataExpireAfterSeconds` config option has been removed.
|
|
23
|
-
* The default view pug template in `views/default` has some small improvements. If you are using your own custom template, you may want to include some of these.
|
|
24
|
-
|
|
25
|
-
[`GTFS-to-GeoJSON`](https://github.com/BlinkTagInc/gtfs-to-geojson) and [`GTFS-to-Chart`](https://github.com/BlinkTagInc/gtfs-to-chart) both have similar breaking changes.
|
|
26
|
-
|
|
27
|
-
If you are using node-gtfs in your own project, all query methods have breaking changes in version 2.0.0 - see [the documentation](https://github.com/BlinkTagInc/node-gtfs).
|
|
28
|
-
|
|
29
|
-
Please send feedback on issues you encounter or ideas for improvement by opening a [Github issue](https://github.com/BlinkTagInc/gtfs-to-html/issues). Pull requests are welcome.
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
```csv
|
|
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`.
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: additional-files
|
|
3
|
-
title: Why Additional Files?
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
You can better control timetable generation by adding some additional, non-standard .txt files to your GTFS.
|
|
7
|
-
|
|
8
|
-
## Controlling timetable output
|
|
9
|
-
By default, GTFS-to-HTML attempts to generate a timetable for each route and direction present in a GTFS file. However, greater control over which routes, directions and days of the week should be built into timetables is possible by adding `timetables.txt`, `timetable_pages.txt` and `timetable_stop_order.txt` files to an your GTFS.
|
|
10
|
-
|
|
11
|
-
* [timetables.txt](/docs/timetables) - Specifies which HTML timetables should be built based on route_id, direction_id, days of the week and a date range. Often, this is the only additional file you'll need.
|
|
12
|
-
* [timetable_stop_order.txt](/docs/timetable-stop-order) - Specifies the stop order that should be used for timetables.
|
|
13
|
-
* [timetable_pages.txt](/docs/timetable-pages) - Specifies which HTML timetables should be grouped together into a single HTML page.
|
|
14
|
-
|
|
15
|
-
## Adding notes to timetables
|
|
16
|
-
Notes about a specific trip, stop, stoptime, route or timetable can be added to timetables by using `timetable_notes.txt` and `timetable_notes_references.txt` in your GTFS. These notes can include links and other formatting using Markdown syntax.
|
|
17
|
-
|
|
18
|
-
* [timetable_notes.txt](/docs/timetable-notes) - Specifies notes to be used in timetables.
|
|
19
|
-
* [timetable_notes_references.txt](/docs/timetable-notes-references) - Specifies where notes should be placed in timetables.
|
|
20
|
-
|
|
21
|
-
## Additional info about a stop
|
|
22
|
-
Additional information about a stop can be added using `stop_attributes.txt` in your GTFS.
|
|
23
|
-
|
|
24
|
-
* [stop_attributes.txt](/docs/stop-attributes) - Specifies additional information about a stop.
|