gtfs-to-html 2.11.4 → 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 +39 -30
- package/dist/app/index.js.map +1 -1
- package/dist/bin/gtfs-to-html.js +55 -9
- package/dist/bin/gtfs-to-html.js.map +1 -1
- package/dist/index.js +55 -9
- package/dist/index.js.map +1 -1
- package/package.json +7 -4
- 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/bin/gtfs-to-html.js
CHANGED
|
@@ -12,6 +12,7 @@ import PrettyError from "pretty-error";
|
|
|
12
12
|
|
|
13
13
|
// src/lib/file-utils.ts
|
|
14
14
|
import { dirname, join, resolve } from "path";
|
|
15
|
+
import cssEscape from "css.escape";
|
|
15
16
|
import { createWriteStream } from "fs";
|
|
16
17
|
import { fileURLToPath } from "url";
|
|
17
18
|
import {
|
|
@@ -383,7 +384,6 @@ function getAgencyGeoJSON(config) {
|
|
|
383
384
|
// src/lib/template-functions.ts
|
|
384
385
|
var template_functions_exports = {};
|
|
385
386
|
__export(template_functions_exports, {
|
|
386
|
-
formatHtmlId: () => formatHtmlId,
|
|
387
387
|
formatTripName: () => formatTripName,
|
|
388
388
|
formatTripNameForCSV: () => formatTripNameForCSV,
|
|
389
389
|
getNotesForStop: () => getNotesForStop,
|
|
@@ -396,9 +396,6 @@ __export(template_functions_exports, {
|
|
|
396
396
|
timetablePageHasDifferentLabels: () => timetablePageHasDifferentLabels
|
|
397
397
|
});
|
|
398
398
|
import { every } from "lodash-es";
|
|
399
|
-
function formatHtmlId(id) {
|
|
400
|
-
return id.replace(/([^\w[\]{}.:-])\s?/g, "");
|
|
401
|
-
}
|
|
402
399
|
function timetableHasDifferentDays(timetable) {
|
|
403
400
|
return !every(timetable.orderedTrips, (trip, idx) => {
|
|
404
401
|
if (idx === 0) {
|
|
@@ -497,7 +494,7 @@ function formatTripNameForCSV(trip, timetable) {
|
|
|
497
494
|
// package.json
|
|
498
495
|
var package_default = {
|
|
499
496
|
name: "gtfs-to-html",
|
|
500
|
-
version: "2.
|
|
497
|
+
version: "2.12.0",
|
|
501
498
|
private: false,
|
|
502
499
|
description: "Build human readable transit timetables as HTML, PDF or CSV from GTFS",
|
|
503
500
|
keywords: [
|
|
@@ -544,23 +541,26 @@ var package_default = {
|
|
|
544
541
|
prepare: "husky"
|
|
545
542
|
},
|
|
546
543
|
dependencies: {
|
|
544
|
+
"@maplibre/maplibre-gl-geocoder": "^1.9.1",
|
|
547
545
|
"@turf/helpers": "^7.2.0",
|
|
548
546
|
"@turf/simplify": "^7.2.0",
|
|
549
547
|
anchorme: "^3.0.8",
|
|
550
548
|
archiver: "^7.0.1",
|
|
551
549
|
"cli-table": "^0.3.11",
|
|
550
|
+
"css.escape": "^1.5.1",
|
|
552
551
|
"csv-stringify": "^6.6.0",
|
|
553
552
|
express: "^5.1.0",
|
|
554
553
|
gtfs: "^4.18.1",
|
|
555
554
|
"gtfs-realtime-pbf-js-module": "^1.0.0",
|
|
556
555
|
"js-beautify": "^1.15.4",
|
|
557
556
|
"lodash-es": "^4.17.21",
|
|
558
|
-
|
|
557
|
+
"maplibre-gl": "^5.12.0",
|
|
558
|
+
marked: "^17.0.0",
|
|
559
559
|
moment: "^2.30.1",
|
|
560
560
|
pbf: "^4.0.1",
|
|
561
561
|
"pretty-error": "^4.0.0",
|
|
562
562
|
pug: "^3.0.3",
|
|
563
|
-
puppeteer: "^24.
|
|
563
|
+
puppeteer: "^24.29.1",
|
|
564
564
|
"sanitize-filename": "^1.6.3",
|
|
565
565
|
"sanitize-html": "^2.17.0",
|
|
566
566
|
sqlstring: "^2.3.3",
|
|
@@ -571,7 +571,7 @@ var package_default = {
|
|
|
571
571
|
devDependencies: {
|
|
572
572
|
"@types/archiver": "^7.0.0",
|
|
573
573
|
"@types/cli-table": "^0.3.4",
|
|
574
|
-
"@types/express": "^5.0.
|
|
574
|
+
"@types/express": "^5.0.5",
|
|
575
575
|
"@types/insane": "^1.0.0",
|
|
576
576
|
"@types/js-beautify": "^1.14.3",
|
|
577
577
|
"@types/lodash-es": "^4.17.12",
|
|
@@ -732,7 +732,12 @@ var getCalendarDatesForTimetable = (timetable, config) => {
|
|
|
732
732
|
const excludedDates = /* @__PURE__ */ new Set();
|
|
733
733
|
const includedDates = /* @__PURE__ */ new Set();
|
|
734
734
|
for (const calendarDate of calendarDates) {
|
|
735
|
-
if (moment2(calendarDate.date, "YYYYMMDD").isBetween(
|
|
735
|
+
if (moment2(calendarDate.date, "YYYYMMDD").isBetween(
|
|
736
|
+
start,
|
|
737
|
+
end,
|
|
738
|
+
void 0,
|
|
739
|
+
"[]"
|
|
740
|
+
)) {
|
|
736
741
|
if (calendarDate.exception_type === 1) {
|
|
737
742
|
includedDates.add(formatDate(calendarDate, config.dateFormat));
|
|
738
743
|
} else if (calendarDate.exception_type === 2) {
|
|
@@ -2398,6 +2403,46 @@ async function copyStaticAssets(config, outputPath) {
|
|
|
2398
2403
|
join(outputPath, "js/anchorme.min.js")
|
|
2399
2404
|
);
|
|
2400
2405
|
}
|
|
2406
|
+
if (config.showMap) {
|
|
2407
|
+
await copyFile(
|
|
2408
|
+
join(
|
|
2409
|
+
dirname(findPackageJSON("maplibre-gl", import.meta.url)),
|
|
2410
|
+
"dist/maplibre-gl.js"
|
|
2411
|
+
),
|
|
2412
|
+
join(outputPath, "js/maplibre-gl.js")
|
|
2413
|
+
);
|
|
2414
|
+
await copyFile(
|
|
2415
|
+
join(
|
|
2416
|
+
dirname(findPackageJSON("maplibre-gl", import.meta.url)),
|
|
2417
|
+
"dist/maplibre-gl.css"
|
|
2418
|
+
),
|
|
2419
|
+
join(outputPath, "css/maplibre-gl.css")
|
|
2420
|
+
);
|
|
2421
|
+
await copyFile(
|
|
2422
|
+
join(
|
|
2423
|
+
dirname(
|
|
2424
|
+
findPackageJSON(
|
|
2425
|
+
"@maplibre/maplibre-gl-geocoder",
|
|
2426
|
+
import.meta.url
|
|
2427
|
+
)
|
|
2428
|
+
),
|
|
2429
|
+
"dist/maplibre-gl-geocoder.js"
|
|
2430
|
+
),
|
|
2431
|
+
join(outputPath, "js/maplibre-gl-geocoder.js")
|
|
2432
|
+
);
|
|
2433
|
+
await copyFile(
|
|
2434
|
+
join(
|
|
2435
|
+
dirname(
|
|
2436
|
+
findPackageJSON(
|
|
2437
|
+
"@maplibre/maplibre-gl-geocoder",
|
|
2438
|
+
import.meta.url
|
|
2439
|
+
)
|
|
2440
|
+
),
|
|
2441
|
+
"dist/maplibre-gl-geocoder.css"
|
|
2442
|
+
),
|
|
2443
|
+
join(outputPath, "css/maplibre-gl-geocoder.css")
|
|
2444
|
+
);
|
|
2445
|
+
}
|
|
2401
2446
|
}
|
|
2402
2447
|
function zipFolder(outputPath) {
|
|
2403
2448
|
const output = createWriteStream(join(outputPath, "timetables.zip"));
|
|
@@ -2458,6 +2503,7 @@ async function renderTemplate(templateFileName, templateVars, config) {
|
|
|
2458
2503
|
const templatePath = getPathToTemplateFile(templateFileName, config);
|
|
2459
2504
|
const html = await renderFile(templatePath, {
|
|
2460
2505
|
_,
|
|
2506
|
+
cssEscape,
|
|
2461
2507
|
md: (text) => sanitizeHtml(marked.parseInline(text)),
|
|
2462
2508
|
...template_functions_exports,
|
|
2463
2509
|
formatRouteColor,
|