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/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import sanitize2 from "sanitize-filename";
|
|
|
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.29.
|
|
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",
|
|
@@ -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) {
|
|
@@ -2373,6 +2378,46 @@ async function copyStaticAssets(config, outputPath) {
|
|
|
2373
2378
|
join(outputPath, "js/anchorme.min.js")
|
|
2374
2379
|
);
|
|
2375
2380
|
}
|
|
2381
|
+
if (config.showMap) {
|
|
2382
|
+
await copyFile(
|
|
2383
|
+
join(
|
|
2384
|
+
dirname(findPackageJSON("maplibre-gl", import.meta.url)),
|
|
2385
|
+
"dist/maplibre-gl.js"
|
|
2386
|
+
),
|
|
2387
|
+
join(outputPath, "js/maplibre-gl.js")
|
|
2388
|
+
);
|
|
2389
|
+
await copyFile(
|
|
2390
|
+
join(
|
|
2391
|
+
dirname(findPackageJSON("maplibre-gl", import.meta.url)),
|
|
2392
|
+
"dist/maplibre-gl.css"
|
|
2393
|
+
),
|
|
2394
|
+
join(outputPath, "css/maplibre-gl.css")
|
|
2395
|
+
);
|
|
2396
|
+
await copyFile(
|
|
2397
|
+
join(
|
|
2398
|
+
dirname(
|
|
2399
|
+
findPackageJSON(
|
|
2400
|
+
"@maplibre/maplibre-gl-geocoder",
|
|
2401
|
+
import.meta.url
|
|
2402
|
+
)
|
|
2403
|
+
),
|
|
2404
|
+
"dist/maplibre-gl-geocoder.js"
|
|
2405
|
+
),
|
|
2406
|
+
join(outputPath, "js/maplibre-gl-geocoder.js")
|
|
2407
|
+
);
|
|
2408
|
+
await copyFile(
|
|
2409
|
+
join(
|
|
2410
|
+
dirname(
|
|
2411
|
+
findPackageJSON(
|
|
2412
|
+
"@maplibre/maplibre-gl-geocoder",
|
|
2413
|
+
import.meta.url
|
|
2414
|
+
)
|
|
2415
|
+
),
|
|
2416
|
+
"dist/maplibre-gl-geocoder.css"
|
|
2417
|
+
),
|
|
2418
|
+
join(outputPath, "css/maplibre-gl-geocoder.css")
|
|
2419
|
+
);
|
|
2420
|
+
}
|
|
2376
2421
|
}
|
|
2377
2422
|
function zipFolder(outputPath) {
|
|
2378
2423
|
const output = createWriteStream(join(outputPath, "timetables.zip"));
|
|
@@ -2433,6 +2478,7 @@ async function renderTemplate(templateFileName, templateVars, config) {
|
|
|
2433
2478
|
const templatePath = getPathToTemplateFile(templateFileName, config);
|
|
2434
2479
|
const html = await renderFile(templatePath, {
|
|
2435
2480
|
_,
|
|
2481
|
+
cssEscape,
|
|
2436
2482
|
md: (text) => sanitizeHtml(marked.parseInline(text)),
|
|
2437
2483
|
...template_functions_exports,
|
|
2438
2484
|
formatRouteColor,
|