gtfs-to-html 2.11.5 → 2.12.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/dist/app/index.js +38 -29
- package/dist/app/index.js.map +1 -1
- package/dist/bin/gtfs-to-html.js +54 -8
- package/dist/bin/gtfs-to-html.js.map +1 -1
- package/dist/index.js +54 -8
- package/dist/index.js.map +1 -1
- package/package.json +6 -3
- package/views/default/css/overview_styles.css +4 -2
- package/views/default/css/timetable_styles.css +24 -9
- package/views/default/formatting_functions.pug +1 -1
- package/views/default/js/system-map.js +143 -92
- package/views/default/js/timetable-alerts.js +68 -50
- package/views/default/js/timetable-map.js +264 -164
- package/views/default/js/timetable-menu.js +64 -40
- package/views/default/overview.pug +1 -1
- package/views/default/overview_full.pug +4 -6
- package/views/default/timetable_continuation_as.pug +1 -1
- package/views/default/timetable_continuation_from.pug +1 -1
- package/views/default/timetable_horizontal.pug +2 -2
- package/views/default/timetable_hourly.pug +1 -1
- package/views/default/timetable_map.pug +1 -1
- package/views/default/timetable_menu.pug +2 -2
- package/views/default/timetable_note_symbol.pug +1 -1
- package/views/default/timetable_stop_name.pug +1 -1
- package/views/default/timetable_stoptime.pug +7 -7
- package/views/default/timetable_vertical.pug +3 -3
- package/views/default/timetablepage.pug +8 -8
- package/views/default/timetablepage_full.pug +2 -4
package/dist/app/index.js
CHANGED
|
@@ -123,6 +123,7 @@ import toposort from "toposort";
|
|
|
123
123
|
|
|
124
124
|
// src/lib/file-utils.ts
|
|
125
125
|
import { dirname, join, resolve } from "path";
|
|
126
|
+
import cssEscape from "css.escape";
|
|
126
127
|
import { createWriteStream } from "fs";
|
|
127
128
|
import { fileURLToPath } from "url";
|
|
128
129
|
import {
|
|
@@ -149,7 +150,6 @@ import { marked } from "marked";
|
|
|
149
150
|
// src/lib/template-functions.ts
|
|
150
151
|
var template_functions_exports = {};
|
|
151
152
|
__export(template_functions_exports, {
|
|
152
|
-
formatHtmlId: () => formatHtmlId,
|
|
153
153
|
formatTripName: () => formatTripName,
|
|
154
154
|
formatTripNameForCSV: () => formatTripNameForCSV,
|
|
155
155
|
getNotesForStop: () => getNotesForStop,
|
|
@@ -162,9 +162,6 @@ __export(template_functions_exports, {
|
|
|
162
162
|
timetablePageHasDifferentLabels: () => timetablePageHasDifferentLabels
|
|
163
163
|
});
|
|
164
164
|
import { every } from "lodash-es";
|
|
165
|
-
function formatHtmlId(id) {
|
|
166
|
-
return id.replace(/([^\w[\]{}.:-])\s?/g, "");
|
|
167
|
-
}
|
|
168
165
|
function timetableHasDifferentDays(timetable) {
|
|
169
166
|
return !every(timetable.orderedTrips, (trip, idx) => {
|
|
170
167
|
if (idx === 0) {
|
|
@@ -309,6 +306,7 @@ async function renderTemplate(templateFileName, templateVars, config2) {
|
|
|
309
306
|
const templatePath = getPathToTemplateFile(templateFileName, config2);
|
|
310
307
|
const html = await renderFile(templatePath, {
|
|
311
308
|
_,
|
|
309
|
+
cssEscape,
|
|
312
310
|
md: (text) => sanitizeHtml(marked.parseInline(text)),
|
|
313
311
|
...template_functions_exports,
|
|
314
312
|
formatRouteColor,
|
|
@@ -430,7 +428,7 @@ function getAgencyGeoJSON(config2) {
|
|
|
430
428
|
// package.json
|
|
431
429
|
var package_default = {
|
|
432
430
|
name: "gtfs-to-html",
|
|
433
|
-
version: "2.
|
|
431
|
+
version: "2.12.0",
|
|
434
432
|
private: false,
|
|
435
433
|
description: "Build human readable transit timetables as HTML, PDF or CSV from GTFS",
|
|
436
434
|
keywords: [
|
|
@@ -477,23 +475,26 @@ var package_default = {
|
|
|
477
475
|
prepare: "husky"
|
|
478
476
|
},
|
|
479
477
|
dependencies: {
|
|
478
|
+
"@maplibre/maplibre-gl-geocoder": "^1.9.1",
|
|
480
479
|
"@turf/helpers": "^7.2.0",
|
|
481
480
|
"@turf/simplify": "^7.2.0",
|
|
482
481
|
anchorme: "^3.0.8",
|
|
483
482
|
archiver: "^7.0.1",
|
|
484
483
|
"cli-table": "^0.3.11",
|
|
484
|
+
"css.escape": "^1.5.1",
|
|
485
485
|
"csv-stringify": "^6.6.0",
|
|
486
486
|
express: "^5.1.0",
|
|
487
487
|
gtfs: "^4.18.1",
|
|
488
488
|
"gtfs-realtime-pbf-js-module": "^1.0.0",
|
|
489
489
|
"js-beautify": "^1.15.4",
|
|
490
490
|
"lodash-es": "^4.17.21",
|
|
491
|
-
|
|
491
|
+
"maplibre-gl": "^5.12.0",
|
|
492
|
+
marked: "^17.0.0",
|
|
492
493
|
moment: "^2.30.1",
|
|
493
494
|
pbf: "^4.0.1",
|
|
494
495
|
"pretty-error": "^4.0.0",
|
|
495
496
|
pug: "^3.0.3",
|
|
496
|
-
puppeteer: "^24.29.
|
|
497
|
+
puppeteer: "^24.29.1",
|
|
497
498
|
"sanitize-filename": "^1.6.3",
|
|
498
499
|
"sanitize-html": "^2.17.0",
|
|
499
500
|
sqlstring: "^2.3.3",
|
|
@@ -665,7 +666,12 @@ var getCalendarDatesForTimetable = (timetable, config2) => {
|
|
|
665
666
|
const excludedDates = /* @__PURE__ */ new Set();
|
|
666
667
|
const includedDates = /* @__PURE__ */ new Set();
|
|
667
668
|
for (const calendarDate of calendarDates) {
|
|
668
|
-
if (moment2(calendarDate.date, "YYYYMMDD").isBetween(
|
|
669
|
+
if (moment2(calendarDate.date, "YYYYMMDD").isBetween(
|
|
670
|
+
start,
|
|
671
|
+
end,
|
|
672
|
+
void 0,
|
|
673
|
+
"[]"
|
|
674
|
+
)) {
|
|
669
675
|
if (calendarDate.exception_type === 1) {
|
|
670
676
|
includedDates.add(formatDate(calendarDate, config2.dateFormat));
|
|
671
677
|
} else if (calendarDate.exception_type === 2) {
|
|
@@ -2187,27 +2193,30 @@ app.use((req, res, next) => {
|
|
|
2187
2193
|
});
|
|
2188
2194
|
var staticAssetPath = config.templatePath === void 0 ? getPathToViewsFolder(config) : untildify(config.templatePath);
|
|
2189
2195
|
app.use(express.static(staticAssetPath));
|
|
2190
|
-
|
|
2191
|
-
"/js",
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
)
|
|
2210
|
-
|
|
2196
|
+
var frontendLibraryPaths = [
|
|
2197
|
+
{ route: "/js", package: "pbf", subPath: "dist" },
|
|
2198
|
+
{ route: "/js", package: "gtfs-realtime-pbf-js-module", subPath: "" },
|
|
2199
|
+
{ route: "/js", package: "anchorme", subPath: "../../dist/browser" },
|
|
2200
|
+
{ route: "/js", package: "maplibre-gl", subPath: "../dist" },
|
|
2201
|
+
{
|
|
2202
|
+
route: "/js",
|
|
2203
|
+
package: "@maplibre/maplibre-gl-geocoder",
|
|
2204
|
+
subPath: "../dist"
|
|
2205
|
+
},
|
|
2206
|
+
{ route: "/css", package: "maplibre-gl", subPath: "../dist" },
|
|
2207
|
+
{
|
|
2208
|
+
route: "/css",
|
|
2209
|
+
package: "@maplibre/maplibre-gl-geocoder",
|
|
2210
|
+
subPath: "../dist"
|
|
2211
|
+
}
|
|
2212
|
+
];
|
|
2213
|
+
var resolvePackagePath = (packageName, subPath) => {
|
|
2214
|
+
const packagePath = dirname2(fileURLToPath2(import.meta.resolve(packageName)));
|
|
2215
|
+
return subPath ? join2(packagePath, subPath) : packagePath;
|
|
2216
|
+
};
|
|
2217
|
+
for (const { route, package: pkg, subPath } of frontendLibraryPaths) {
|
|
2218
|
+
app.use(route, express.static(resolvePackagePath(pkg, subPath)));
|
|
2219
|
+
}
|
|
2211
2220
|
app.get("/", async (req, res, next) => {
|
|
2212
2221
|
try {
|
|
2213
2222
|
const timetablePages = [];
|