gtfs-to-html 2.6.9 → 2.6.10

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/CHANGELOG.md CHANGED
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.6.10] - 2024-07-15
9
+
10
+ ### Updated
11
+ - Better date format in timetable comment
12
+ - favicon
13
+ - Improved timetable_page_name fallback
14
+ - Overview template formatting
15
+ - Update mapbox version
16
+
8
17
  ## [2.6.9] - 2024-07-11
9
18
 
10
19
  ### Added
package/lib/formatters.js CHANGED
@@ -512,22 +512,16 @@ export function formatTimetablePageLabel(timetablePage) {
512
512
  timetablePage.consolidatedTimetables &&
513
513
  timetablePage.consolidatedTimetables.length > 0
514
514
  ) {
515
- if (timetablePage.consolidatedTimetables.length === 1) {
516
- // Get label from first timetable if there is only one
517
- return timetablePage.consolidatedTimetables[0].timetable_label;
518
- } else {
519
- // Otherwise, use route names from all timetables
520
- const routes = uniqBy(
521
- flatMap(
522
- timetablePage.consolidatedTimetables,
523
- (timetable) => timetable.routes,
524
- ),
525
- 'route_id',
526
- );
527
- const timetablePageLabel = routes.map((route) => formatRouteName(route));
515
+ // Use route names from all timetables
516
+ const routes = uniqBy(
517
+ flatMap(
518
+ timetablePage.consolidatedTimetables,
519
+ (timetable) => timetable.routes,
520
+ ),
521
+ 'route_id',
522
+ );
528
523
 
529
- return timetablePageLabel.join(' and ');
530
- }
524
+ return routes.map((route) => formatRouteName(route)).join(' and ');
531
525
  }
532
526
 
533
527
  return 'Unknown';
package/lib/log-utils.js CHANGED
@@ -17,7 +17,7 @@ export function generateLogText(outputStats, config) {
17
17
  const logText = [
18
18
  `Feed Version: ${feedVersion}`,
19
19
  `GTFS-to-HTML Version: ${config.gtfsToHtmlVersion}`,
20
- `Date Generated: ${new Date()}`,
20
+ `Date Generated: ${new Date().toISOString()}`,
21
21
  `Timetable Page Count: ${outputStats.timetablePages}`,
22
22
  `Timetable Count: ${outputStats.timetables}`,
23
23
  `Calendar Service ID Count: ${outputStats.calendars}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gtfs-to-html",
3
- "version": "2.6.9",
3
+ "version": "2.6.10",
4
4
  "private": false,
5
5
  "description": "Build human readable transit timetables as HTML, PDF or CSV from GTFS",
6
6
  "keywords": [
@@ -186,7 +186,7 @@ a:hover {
186
186
  font-size: 20px;
187
187
  font-weight: bold;
188
188
  letter-spacing: -1px;
189
- padding: 0 8px;
189
+ padding: 0 6px;
190
190
  }
191
191
 
192
192
  @media screen and (max-width: 767px) {
@@ -11,14 +11,8 @@
11
11
  return summary;
12
12
  }
13
13
 
14
- function formatRouteName(route) {
15
- const hasLongName = route.route_long_name !== '' && route.route_long_name !== null;
16
-
17
- if (hasLongName) {
18
- return route.route_long_name;
19
- }
20
-
21
- return route.route_short_name;
14
+ function isNullOrEmpty(value) {
15
+ return value === null || value === '';
22
16
  }
23
17
 
24
18
  function formatFrequencyWarning(frequencies) {
@@ -1,28 +1,28 @@
1
1
  include formatting_functions.pug
2
2
 
3
- .container.mx-4.h-screen.items-stretch(class="md:mx-auto md:flex")
3
+ .h-screen.items-stretch(class="md:flex")
4
4
  if !timetablePages || !timetablePages.length
5
5
  .flex.justify-center
6
6
  .bg-blue-700.text-white.font-bold.rounded-lg.border.shadow-lg.text-lg.p-8(class="w-1/2") No timetables found
7
7
  else
8
- .overview-list.flex-none(class="md:overflow-y-scroll")
8
+ .overview-list.flex-none(class="md:overflow-y-scroll md:max-w-96")
9
9
  each timetablePageGroup in getAgencyTimetableGroups(timetablePages, agencies)
10
- h1.text-2xl.pt-4.pb-2= `${formatAgencyName(timetablePageGroup.agency)} Routes`
10
+ h1.text-2xl.mx-4.py-3= `${formatAgencyName(timetablePageGroup.agency)} Routes`
11
+
11
12
  each timetablePage in timetablePageGroup.timetablePages
12
13
  if config.allowEmptyTimetables || timetablePage.consolidatedTimetables.length > 0
13
- a.block.p-2.border-b.border-slate-200(class="hover:bg-slate-100 hover:no-underline" href=`${timetablePage.relativePath}` data-route-ids=`${timetablePage.route_ids ? timetablePage.route_ids.join(',') : ''}`)
14
- .text-lg.text-gray-800.leading-none= timetablePage.timetable_page_label
14
+ a.timetable-overview-label.flex.items-center.gap-2.block.p-2.border-b.border-slate-200(class="hover:bg-slate-100 hover:no-underline" href=`${timetablePage.relativePath}` data-route-ids=`${timetablePage.route_ids ? timetablePage.route_ids.join(',') : ''}`)
15
15
  each route in _.uniqBy(_.flatMap(timetablePage.consolidatedTimetables, timetable => timetable.routes), 'route_id')
16
- .flex.my-1.items-center.gap-1
17
- .route-color-swatch.flex-none(style=`background-color: ${formatRouteColor(route)}; color: ${formatRouteTextColor(route)};`)= route.route_short_name || ''
18
- .text-gray-600.leading-none= formatRouteName(route)
19
- .inline-flex.items-center.justify-center.px-2.py-1.text-xs.font-bold.leading-none.text-slate-800.bg-slate-200.rounded-full= timetablePage.dayList
16
+ .route-color-swatch-large.flex-none(style=`background-color: ${formatRouteColor(route)}; color: ${formatRouteTextColor(route)};`)= route.route_short_name || ''
17
+ div
18
+ .text-xl.leading-none.text-slate-800= timetablePage.timetable_page_label
19
+ .inline-flex.items-center.justify-center.px-2.py-1.text-xs.font-bold.leading-none.text-slate-800.bg-slate-200.rounded-full= timetablePage.dayList
20
20
  if config.showMap
21
- .map.ml-4.h-full.w-full(id="system_map")
21
+ .map.h-full.w-full(id="system_map")
22
22
 
23
23
  //- Use #{variable} format to inject values from pug to client side js
24
24
  script.
25
25
  (function() {
26
- var geojson = !{JSON.stringify(geojson) || '\'\''};
26
+ const geojson = !{JSON.stringify(geojson) || '\'\''};
27
27
  createSystemMap('system_map', geojson);
28
28
  })();
@@ -6,9 +6,9 @@ block extraHeader
6
6
  if config.showMap
7
7
  script(src="https://unpkg.com/jquery@3.7.1/dist/jquery.min.js" crossorigin="anonymous")
8
8
  script(src="https://unpkg.com/lodash@4.17.21/lodash.min.js" crossorigin="anonymous")
9
- script(src="https://api.mapbox.com/mapbox-gl-js/v3.3.0/mapbox-gl.js")
9
+ script(src="https://api.mapbox.com/mapbox-gl-js/v3.5.1/mapbox-gl.js")
10
10
  script.
11
11
  mapboxgl.accessToken = '#{config.mapboxAccessToken}';
12
12
  script(src=`${config.assetPath}js/system-map.js`)
13
13
 
14
- link(href="https://api.mapbox.com/mapbox-gl-js/v3.3.0/mapbox-gl.css" rel="stylesheet")
14
+ link(href="https://api.mapbox.com/mapbox-gl-js/v3.5.1/mapbox-gl.css" rel="stylesheet")
@@ -1,6 +1,6 @@
1
1
  include formatting_functions.pug
2
2
 
3
- <!-- Timetable generated on #{Date()} using GTFS-to-HTML version #{config.gtfsToHtmlVersion} -->
3
+ <!-- Timetable generated on #{new Date().toISOString()} using GTFS-to-HTML version #{config.gtfsToHtmlVersion} -->
4
4
  .timetable-page(class=`menu-type-${config.menuType}`)
5
5
  .container.mx-4(class="md:mx-auto")
6
6
  if config.showRouteTitle
@@ -9,10 +9,10 @@ block extraHeader
9
9
  script(src=`${config.assetPath}js/timetable-menu.js`)
10
10
 
11
11
  if config.showMap
12
- script(src="https://api.mapbox.com/mapbox-gl-js/v3.3.0/mapbox-gl.js")
12
+ script(src="https://api.mapbox.com/mapbox-gl-js/v3.5.1/mapbox-gl.js")
13
13
  script.
14
14
  mapboxgl.accessToken = '#{config.mapboxAccessToken}';
15
15
  script(src=`${config.assetPath}js/timetable-map.js`)
16
16
 
17
- link(href="https://api.mapbox.com/mapbox-gl-js/v3.3.0/mapbox-gl.css" rel="stylesheet")
17
+ link(href="https://api.mapbox.com/mapbox-gl-js/v3.5.1/mapbox-gl.css" rel="stylesheet")
18
18
 
Binary file