gtfs-to-html 2.9.0 → 2.9.2
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/config-sample.json +68 -0
- package/dist/app/index.js +2 -1
- package/dist/app/index.js.map +1 -1
- package/dist/bin/gtfs-to-html.js +16 -9
- package/dist/bin/gtfs-to-html.js.map +1 -1
- package/dist/index.js +16 -9
- package/dist/index.js.map +1 -1
- package/docker/Dockerfile +14 -0
- package/docker/README.md +5 -0
- package/docker/config.json +21 -0
- package/docker/docker-compose.yml +10 -0
- package/examples/stop_attributes.txt +6 -0
- package/examples/timetable_notes.txt +8 -0
- package/examples/timetable_notes_references.txt +8 -0
- package/examples/timetable_pages.txt +3 -0
- package/examples/timetable_stop_order.txt +16 -0
- package/examples/timetables.txt +9 -0
- package/package.json +8 -3
- package/views/default/css/overview_styles.css +198 -0
- package/views/default/css/timetable_pdf_styles.css +69 -0
- package/views/default/css/timetable_styles.css +522 -0
- package/views/default/formatting_functions.pug +104 -0
- package/views/default/js/system-map.js +594 -0
- package/views/default/js/timetable-map.js +753 -0
- package/views/default/js/timetable-menu.js +57 -0
- package/views/default/layout.pug +11 -0
- package/views/default/overview.pug +27 -0
- package/views/default/overview_full.pug +16 -0
- package/views/default/timetable_continuation_as.pug +7 -0
- package/views/default/timetable_continuation_from.pug +7 -0
- package/views/default/timetable_horizontal.pug +42 -0
- package/views/default/timetable_hourly.pug +30 -0
- package/views/default/timetable_map.pug +15 -0
- package/views/default/timetable_menu.pug +48 -0
- package/views/default/timetable_note_symbol.pug +5 -0
- package/views/default/timetable_stop_name.pug +13 -0
- package/views/default/timetable_stoptime.pug +17 -0
- package/views/default/timetable_vertical.pug +67 -0
- package/views/default/timetablepage.pug +64 -0
- package/views/default/timetablepage_full.pug +25 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# syntax=docker/dockerfile:1
|
|
2
|
+
FROM node:20
|
|
3
|
+
|
|
4
|
+
RUN apt update
|
|
5
|
+
RUN apt install -y chromium
|
|
6
|
+
|
|
7
|
+
RUN cd ~/
|
|
8
|
+
COPY config.json ./
|
|
9
|
+
|
|
10
|
+
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
|
|
11
|
+
ENV PATH=$PATH:/home/node/.npm-global/bin
|
|
12
|
+
RUN npm install -g gtfs-to-html
|
|
13
|
+
|
|
14
|
+
CMD [ "gtfs-to-html" ]
|
package/docker/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"agencies": [
|
|
3
|
+
{
|
|
4
|
+
"agency_key": "marintransit",
|
|
5
|
+
"url": "https://marintransit.org/data/google_transit.zip"
|
|
6
|
+
}
|
|
7
|
+
],
|
|
8
|
+
"beautify": true,
|
|
9
|
+
"coordinatePrecision": 5,
|
|
10
|
+
"defaultOrientation": "vertical",
|
|
11
|
+
"timeFormat": "h:mm[<span class=\"stop-time-period\">]a[</span>]",
|
|
12
|
+
"noServiceSymbol": "--",
|
|
13
|
+
"requestPickupSymbol": "***",
|
|
14
|
+
"showMap": true,
|
|
15
|
+
"showOnlyTimepoint": true,
|
|
16
|
+
"showStopCity": false,
|
|
17
|
+
"mapboxAccessToken": "pk.eyJ1IjoiYnJlbmRhbm5lZSIsImEiOiJjaXRkMWIzbzEwMDV5MnRvMzJwbjRiaWc3In0.smzRW-NB_BCAGAQiEOvJdg",
|
|
18
|
+
"zipOutput": false,
|
|
19
|
+
"noHead": true,
|
|
20
|
+
"menuType": "radio"
|
|
21
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
note_id,symbol,note
|
|
2
|
+
1,,"No service during baseball games"
|
|
3
|
+
2,,"No express service during a full moon"
|
|
4
|
+
3,,"Trip is cancelled if drawbridge is up"
|
|
5
|
+
4,,"This stop is sometimes underwater"
|
|
6
|
+
5,,"Driver will only stop if prearranged by fax"
|
|
7
|
+
6,§,"Vehicle can arrive early if leap second is added during trip and *will not wait*"
|
|
8
|
+
7,,"[See list of holidays](http://transitagency.org/holidays)"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
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
|
|
2
|
+
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
|
|
3
|
+
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
|
|
4
|
+
2,2035,1,20150819,20151122,1,1,0,1,1,0,0,,,0,101T Northbound,"Mon,Tue,Thur,Fri",horizontal,1,0,Northbound,0
|
|
5
|
+
3,2035,0,20150819,20151122,0,0,1,0,0,0,0,,,0,101T Southbound,Wednesday,horizontal,1,0,Southbound,0
|
|
6
|
+
4,2036,1,20150101,20151122,0,0,0,0,0,0,1,,,0,102 Eastbound,Sunday,horizontal,1,0,Eastbound,0
|
|
7
|
+
5,2036,0,20150101,20151122,1,1,1,1,1,0,0,,,0,102 Westbound,Mon-Fri,horizontal,1,0,Westbound,0
|
|
8
|
+
6,2036,1,20150101,20151122,0,0,0,0,0,1,0,,,0,102 Eastbound,Saturday,horizontal,1,0,Eastbound,0
|
|
9
|
+
7,2037,0,20150101,20151122,1,1,1,1,1,0,0,,,0,103 Westbound,Mon-Fri,horizontal,1,0,Westbound,0
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gtfs-to-html",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Build human readable transit timetables as HTML, PDF or CSV from GTFS",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"transit",
|
|
8
8
|
"gtfs",
|
|
9
|
+
"gtfs-realtime",
|
|
9
10
|
"transportation",
|
|
10
11
|
"timetables"
|
|
11
12
|
],
|
|
@@ -30,7 +31,11 @@
|
|
|
30
31
|
"main": "./dist/index.js",
|
|
31
32
|
"types": "./dist/index.d.ts",
|
|
32
33
|
"files": [
|
|
33
|
-
"dist"
|
|
34
|
+
"dist",
|
|
35
|
+
"docker",
|
|
36
|
+
"examples",
|
|
37
|
+
"views/default",
|
|
38
|
+
"config-sample.json"
|
|
34
39
|
],
|
|
35
40
|
"bin": {
|
|
36
41
|
"gtfs-to-html": "dist/bin/gtfs-to-html.js"
|
|
@@ -71,7 +76,7 @@
|
|
|
71
76
|
"@types/express": "^4.17.21",
|
|
72
77
|
"@types/lodash-es": "^4.17.12",
|
|
73
78
|
"@types/morgan": "^1.9.9",
|
|
74
|
-
"@types/node": "^20.16.
|
|
79
|
+
"@types/node": "^20.16.5",
|
|
75
80
|
"@types/timer-machine": "^1.1.3",
|
|
76
81
|
"@types/yargs": "^17.0.33",
|
|
77
82
|
"husky": "^9.1.5",
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/* Base styles */
|
|
2
|
+
body {
|
|
3
|
+
color: #666;
|
|
4
|
+
font-family: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji',
|
|
5
|
+
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
|
6
|
+
font-feature-settings: normal;
|
|
7
|
+
line-height: inherit;
|
|
8
|
+
margin: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
*,
|
|
12
|
+
::before,
|
|
13
|
+
::after {
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
border-width: 0;
|
|
16
|
+
border-style: solid;
|
|
17
|
+
border-color: #e5e7eb;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
h1,
|
|
21
|
+
h2,
|
|
22
|
+
h3,
|
|
23
|
+
h4,
|
|
24
|
+
h5,
|
|
25
|
+
h6 {
|
|
26
|
+
line-height: inherit;
|
|
27
|
+
font-weight: inherit;
|
|
28
|
+
color: #333;
|
|
29
|
+
margin: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
a {
|
|
33
|
+
text-decoration: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
a:hover {
|
|
37
|
+
text-decoration: underline;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* Overview styles */
|
|
41
|
+
|
|
42
|
+
.timetable-overview {
|
|
43
|
+
height: 100vh;
|
|
44
|
+
align-items: stretch;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@media (min-width: 768px) {
|
|
48
|
+
.timetable-overview {
|
|
49
|
+
display: flex;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.timetable-overview h1 {
|
|
54
|
+
font-size: 1.5rem;
|
|
55
|
+
line-height: 2rem;
|
|
56
|
+
margin-left: 1rem;
|
|
57
|
+
margin-right: 1rem;
|
|
58
|
+
padding-top: 0.75rem;
|
|
59
|
+
padding-bottom: 0.75rem;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.timetable-overview .overview-list {
|
|
63
|
+
flex: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@media (min-width: 768px) {
|
|
67
|
+
.timetable-overview .overview-list {
|
|
68
|
+
max-width: 24rem;
|
|
69
|
+
overflow-y: scroll;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.timetable-overview a.timetable-page-link {
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
gap: 0.5rem;
|
|
77
|
+
border-bottom: 1px solid rgb(226 232 240);
|
|
78
|
+
text-decoration: none;
|
|
79
|
+
padding: 0.5rem;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.timetable-overview a.timetable-page-link:hover {
|
|
83
|
+
background-color: rgb(241 245 249);
|
|
84
|
+
text-decoration: none;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.timetable-overview a.timetable-page-link .timetable-page-label {
|
|
88
|
+
font-size: 1.25rem;
|
|
89
|
+
line-height: 1;
|
|
90
|
+
color: rgb(30 41 59);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.timetable-overview .route-color-swatch {
|
|
94
|
+
min-width: 29px;
|
|
95
|
+
height: 29px;
|
|
96
|
+
border-radius: 50%;
|
|
97
|
+
text-align: center;
|
|
98
|
+
line-height: 26px;
|
|
99
|
+
font-size: 12px;
|
|
100
|
+
letter-spacing: -0.5px;
|
|
101
|
+
padding: 0 5px;
|
|
102
|
+
flex: none;
|
|
103
|
+
flex-shrink: 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.timetable-overview .route-color-swatch-large {
|
|
107
|
+
min-width: 46px;
|
|
108
|
+
height: 46px;
|
|
109
|
+
border-radius: 50%;
|
|
110
|
+
text-align: center;
|
|
111
|
+
line-height: 46px;
|
|
112
|
+
font-size: 20px;
|
|
113
|
+
font-weight: bold;
|
|
114
|
+
letter-spacing: -1px;
|
|
115
|
+
padding: 0 6px;
|
|
116
|
+
flex: none;
|
|
117
|
+
flex-shrink: 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.timetable-overview .btn-blue {
|
|
121
|
+
color: rgb(255 255 255);
|
|
122
|
+
padding: 0.75rem 1.5rem;
|
|
123
|
+
background-color: rgb(37 99 235);
|
|
124
|
+
border-radius: 0.375rem;
|
|
125
|
+
justify-content: center;
|
|
126
|
+
align-items: center;
|
|
127
|
+
display: inline-flex;
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
text-decoration: none;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.timetable-overview .btn-blue:hover {
|
|
133
|
+
background-color: rgb(29 78 216);
|
|
134
|
+
text-decoration: none;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.timetable-overview .btn-sm {
|
|
138
|
+
padding: 0.25rem 1rem;
|
|
139
|
+
border-radius: 0.25rem;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.timetable-overview .badge-gray {
|
|
143
|
+
display: inline-flex;
|
|
144
|
+
align-items: center;
|
|
145
|
+
justify-content: center;
|
|
146
|
+
padding-left: 0.5rem;
|
|
147
|
+
padding-right: 0.5rem;
|
|
148
|
+
padding-top: 0.25rem;
|
|
149
|
+
padding-bottom: 0.25rem;
|
|
150
|
+
font-size: 0.75rem;
|
|
151
|
+
line-height: 1;
|
|
152
|
+
font-weight: 700;
|
|
153
|
+
color: rgb(30 41 59);
|
|
154
|
+
background-color: rgb(226 232 240);
|
|
155
|
+
border-radius: 9999px;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* Map Styles */
|
|
159
|
+
|
|
160
|
+
.overview-map {
|
|
161
|
+
height: 100%;
|
|
162
|
+
width: 100%;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.overview-map .mapboxgl-popup-content .popup-title {
|
|
166
|
+
margin: 0 20px 5px 0;
|
|
167
|
+
font-size: 16px;
|
|
168
|
+
font-weight: bold;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.overview-map .mapboxgl-popup-content .popup-label {
|
|
172
|
+
margin-right: 0.25rem;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.overview-map .mapboxgl-popup-content .route-list {
|
|
176
|
+
margin-bottom: 0.5rem;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.overview-map .mapboxgl-popup-content .map-route-item {
|
|
180
|
+
display: flex;
|
|
181
|
+
align-items: center;
|
|
182
|
+
font-size: 0.75rem;
|
|
183
|
+
line-height: 1;
|
|
184
|
+
margin-bottom: 0.5rem;
|
|
185
|
+
gap: 0.5rem;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.overview-map .mapboxgl-popup-content .map-route-item:hover {
|
|
189
|
+
text-decoration: none;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.overview-map .mapboxgl-popup-content a.map-route-item .underline-hover:hover {
|
|
193
|
+
text-decoration: underline;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.overview-map .mapboxgl-popup-content .mapboxgl-popup-close-button {
|
|
197
|
+
padding: 0 5px;
|
|
198
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
body {
|
|
2
|
+
-webkit-print-color-adjust: exact;
|
|
3
|
+
width: 100%;
|
|
4
|
+
margin: 0 auto;
|
|
5
|
+
font-size: 0.8rem;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
h1,
|
|
9
|
+
h2,
|
|
10
|
+
h3,
|
|
11
|
+
h4,
|
|
12
|
+
h5,
|
|
13
|
+
p {
|
|
14
|
+
page-break-inside: avoid;
|
|
15
|
+
orphans: 3;
|
|
16
|
+
widows: 3;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
img,
|
|
20
|
+
table {
|
|
21
|
+
max-width: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.timetable-page .timetable:not(:first-of-type) {
|
|
25
|
+
page-break-before: always;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.timetable-page .timetable .table-container {
|
|
29
|
+
overflow: auto;
|
|
30
|
+
margin-bottom: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.timetable-page .timetable table > thead > tr > th,
|
|
34
|
+
.timetable-page .timetable table > tbody > tr > th,
|
|
35
|
+
.timetable-page .timetable table > tfoot > tr > th {
|
|
36
|
+
padding: 3px 5px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.timetable-page .timetable table > thead > tr > td,
|
|
40
|
+
.timetable-page .timetable table > tbody > tr > td,
|
|
41
|
+
.timetable-page .timetable table > tfoot > tr > td {
|
|
42
|
+
padding: 1px 5px;
|
|
43
|
+
line-height: 1;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.timetable .table-container {
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
}
|
|
49
|
+
.timetable table {
|
|
50
|
+
page-break-after: auto;
|
|
51
|
+
}
|
|
52
|
+
.timetable tr {
|
|
53
|
+
page-break-inside: avoid;
|
|
54
|
+
page-break-after: auto;
|
|
55
|
+
}
|
|
56
|
+
.timetable td {
|
|
57
|
+
page-break-inside: avoid;
|
|
58
|
+
page-break-after: auto;
|
|
59
|
+
}
|
|
60
|
+
.timetable thead {
|
|
61
|
+
display: table-header-group;
|
|
62
|
+
}
|
|
63
|
+
.timetable tfoot {
|
|
64
|
+
display: table-footer-group;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.timetable-page .map-legend {
|
|
68
|
+
display: none;
|
|
69
|
+
}
|