gtfs-to-html 2.4.3 → 2.4.4

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,14 @@ 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.4.4] - 2022-12-22
9
+
10
+ ### Updated
11
+
12
+ - Use adjacent duplicate stoptimes as arrival/depart if different times
13
+ - Updates to gtfstohtml.com documentation website dependencies
14
+ - Dependency updates
15
+
8
16
  ## [2.4.3] - 2022-11-10
9
17
 
10
18
  ### Updated
package/lib/utils.js CHANGED
@@ -984,15 +984,24 @@ const addTripContinuation = async (trip, timetable) => {
984
984
  const filterTrips = (timetable) => {
985
985
  let filteredTrips = timetable.orderedTrips;
986
986
 
987
- // Remove adjacent stoptimes with the same stop_id
987
+ // Combine adjacent stoptimes with the same `stop_id`
988
988
  for (const trip of filteredTrips) {
989
- trip.stoptimes = trip.stoptimes.filter((stoptime, index) => {
990
- if (index === 0) {
991
- return true;
989
+ const combinedStoptimes = [];
990
+
991
+ for (const [index, stoptime] of trip.stoptimes.entries()) {
992
+ if (
993
+ index === 0 ||
994
+ stoptime.stop_id !== trip.stoptimes[index - 1].stop_id
995
+ ) {
996
+ combinedStoptimes.push(stoptime);
997
+ } else {
998
+ // The `stoptime` is the same as previous, use `arrival_time` from previous and `departure_time` from this stoptime
999
+ combinedStoptimes[combinedStoptimes.length - 1].departure_time =
1000
+ stoptime.departure_time;
992
1001
  }
1002
+ }
993
1003
 
994
- return stoptime.stop_id !== trip.stoptimes[index - 1].stop_id;
995
- });
1004
+ trip.stoptimes = combinedStoptimes;
996
1005
  }
997
1006
 
998
1007
  // Remove stoptimes for stops not used in timetable
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gtfs-to-html",
3
- "version": "2.4.3",
3
+ "version": "2.4.4",
4
4
  "private": false,
5
5
  "description": "Build human readable transit timetables as HTML, PDF or CSV from GTFS",
6
6
  "keywords": [
@@ -40,16 +40,16 @@
40
40
  "archiver": "^5.3.1",
41
41
  "cli-table": "^0.3.11",
42
42
  "copy-dir": "^1.3.0",
43
- "csv-stringify": "^6.2.1",
43
+ "csv-stringify": "^6.2.3",
44
44
  "express": "^4.18.2",
45
- "gtfs": "^3.6.1",
45
+ "gtfs": "^3.8.0",
46
46
  "js-beautify": "^1.14.7",
47
47
  "lodash-es": "^4.17.21",
48
48
  "moment": "^2.29.4",
49
49
  "morgan": "^1.10.0",
50
50
  "pretty-error": "^4.0.0",
51
51
  "pug": "^3.0.2",
52
- "puppeteer": "^19.2.2",
52
+ "puppeteer": "^19.4.1",
53
53
  "sanitize-filename": "^1.6.3",
54
54
  "sqlstring": "^2.3.3",
55
55
  "timer-machine": "^1.1.0",
@@ -59,11 +59,11 @@
59
59
  "yoctocolors": "^1.0.0"
60
60
  },
61
61
  "devDependencies": {
62
- "eslint": "^8.27.0",
62
+ "eslint": "^8.30.0",
63
63
  "eslint-config-prettier": "^8.5.0",
64
64
  "eslint-config-xo": "^0.43.1",
65
65
  "husky": "^8.0.2",
66
- "prettier": "^2.7.1",
66
+ "prettier": "^2.8.1",
67
67
  "pretty-quick": "^3.1.3"
68
68
  },
69
69
  "engines": {
package/www/package.json CHANGED
@@ -9,8 +9,8 @@
9
9
  "deploy": "docusaurus deploy"
10
10
  },
11
11
  "dependencies": {
12
- "@docusaurus/core": "^2.0.0-rc.1",
13
- "@docusaurus/preset-classic": "^2.0.0-rc.1",
12
+ "@docusaurus/core": "^2.2.0",
13
+ "@docusaurus/preset-classic": "^2.2.0",
14
14
  "clsx": "^1.2.1",
15
15
  "react": "^18.2.0",
16
16
  "react-dom": "^18.2.0"
@@ -48,7 +48,7 @@ function Feature({ imageUrl, title, description }) {
48
48
  <div className={clsx('col col--4', styles.feature)}>
49
49
  {imgUrl && (
50
50
  <div className="text--center">
51
- <img className={styles.featureImage} src={imgUrl} alt="" />
51
+ <img className={styles['feature-image']} src={imgUrl} alt="" />
52
52
  </div>
53
53
  )}
54
54
  <h3>{title}</h3>
@@ -65,7 +65,7 @@ function Home() {
65
65
  title="GTFS-to-HTML"
66
66
  description="GTFS-to-HTML creates human-readable, user-friendly transit timetables in HTML format directly from GTFS transit data."
67
67
  >
68
- <header className={clsx('hero hero--dark', styles.heroBanner)}>
68
+ <header className={clsx('hero hero--dark', styles['hero-banner'])}>
69
69
  <div className="container">
70
70
  <div className="row">
71
71
  <div className="col col--4">
@@ -88,7 +88,7 @@ function Home() {
88
88
  <Link
89
89
  className={clsx(
90
90
  'button button--outline button--secondary button--lg',
91
- styles.heroButton
91
+ styles['hero-button']
92
92
  )}
93
93
  to={useBaseUrl('docs/')}
94
94
  >
@@ -112,10 +112,7 @@ function Home() {
112
112
  </section>
113
113
  )}
114
114
 
115
- <section
116
- style={{ backgroundColor: 'hsl(0, 0%, 85%)' }}
117
- className="padding--lg"
118
- >
115
+ <section className={clsx('padding--lg', styles['gray-section'])}>
119
116
  <div className="container">
120
117
  <div className="row">
121
118
  <div className="col"></div>
@@ -5,7 +5,7 @@
5
5
  * and scoped locally.
6
6
  */
7
7
 
8
- .heroBanner {
8
+ .hero-banner {
9
9
  padding: 4rem 0;
10
10
  text-align: center;
11
11
  position: relative;
@@ -13,7 +13,7 @@
13
13
  }
14
14
 
15
15
  @media screen and (max-width: 966px) {
16
- .heroBanner {
16
+ .hero-banner {
17
17
  padding: 2rem;
18
18
  }
19
19
  }
@@ -24,12 +24,20 @@
24
24
  justify-content: center;
25
25
  }
26
26
 
27
- .heroButton {
28
- color: #FFFFFF!important;
27
+ .hero-button {
28
+ color: #ffffff !important;
29
29
  }
30
30
 
31
- .heroButton:hover {
32
- color: #333!important;
31
+ .hero-button:hover {
32
+ color: #333 !important;
33
+ }
34
+
35
+ .gray-section {
36
+ background-color: hsl(0, 0%, 85%);
37
+ }
38
+
39
+ [data-theme='dark'] .gray-section {
40
+ background-color: rgb(94, 94, 94);
33
41
  }
34
42
 
35
43
  .features {
@@ -39,7 +47,7 @@
39
47
  width: 100%;
40
48
  }
41
49
 
42
- .featureImage {
50
+ .feature-image {
43
51
  height: 200px;
44
52
  width: 200px;
45
53
  }