BlinkTagInc / gtfs-to-html

Build human readable transit timetables as HTML or PDF from GTFS.
https://gtfstohtml.com
MIT License
180 stars 57 forks source link

Need to show direction in the title of the route #159

Open yashgt opened 5 months ago

yashgt commented 5 months ago

I generated the HTML online at Preview . The route name appears twice, one for onward and one for return journey. The name should include a direction. Also, the routes should be listed in a configurable order, such as ordered by name, etc.

brendannee commented 5 months ago

Can you share with me the GTFS used so I can check it out?

You can configure many aspects of what routes/directions/days get generated and the order by adding https://gtfstohtml.com/docs/timetables and https://gtfstohtml.com/docs/timetable-pages to the GTFS when processing.

yashgt commented 5 months ago

Can you share with me the GTFS used so I can check it out?

You can configure many aspects of what routes/directions/days get generated and the order by adding https://gtfstohtml.com/docs/timetables and https://gtfstohtml.com/docs/timetable-pages to the GTFS when processing.

Here is the GTFS file I am using. GTFS

The timetables.txt lets us individually configure each route. What I am looking for is a way to say that the list of routes will appear sorted by route_name of the route given in routes.txt.

brendannee commented 5 months ago

Good point.

I tried the GTFS you provided, and noticed that the sorting wasn't working because route_short_name for all routes starts with a non-numeric character.

I updated gtfs-to-html so that timetable pages on the overview page are now sorted be stripping non-numeric characters from route_short_name: https://github.com/BlinkTagInc/gtfs-to-html/commit/eace808fa6ba94423f44ff3a37b6c26f4c47d515 In that commit, you can see where the sorting logic is happening. This isn't included in a published version of GTFS-to-HTML yet, but you can try it out by cloning the repo. Let me know if this handles the sort the way you'd want, or if you think a field in timetable_pages.txt might be useful to manually control sorting.

yashgt commented 5 months ago

I suggest the sorting criteria be kept configurable. When generating the html, one can choose short name or route name. Passengers would prefer an html sorted by route name as they may be unfamiliar with the route numbering used at a location they are visiting as tourists.

brendannee commented 5 months ago

How about a new field in timetable_pages.txt called timetable_page_sequence which would allow you to manually specify the order that timetable pages show up on the summary page? https://gtfstohtml.com/docs/timetable-pages

Let me know what you think of that idea, or if you can see a better way to achieve this.

brendannee commented 4 months ago

@yashgt Let me know what you think of the idea above - would that work for your use case? Any other ideas?