-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need to show direction in the title of the route #159
Comments
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. 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. |
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: eace808 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. |
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. |
How about a new field in timetable_pages.txt called Let me know what you think of that idea, or if you can see a better way to achieve this. |
@yashgt Let me know what you think of the idea above - would that work for your use case? Any other ideas? |
@brendannee What would be most useful is a top-level option such as "showBothDirectionsTogether" to create a single page for trips of both directions, or an option such as "showDirectionInTitle" to continue showing one page per direction and adding the direction in the title of the page on the landing page. |
Having a config option to automatically group directions into a single page is a good idea. |
I added the timetables.txt and set the timetable_sequence and direction_name fields in it, hoping to see the pages getting listed in a given sequence. However, the pages continue to be listed in only the numeric order. The GTFS is at http://15.206.194.4/gtfs/gtfs.zip . The config jso is attached. |
Thanks for pointing that out. The timetable_sequence field in timetables.txt was meant to control how timetables are sorted on a single timetable page when there are more than one (such as showing multiple directions or days of the week on the same page). But you are right that there isn't a way to control the order that timetablepages appear on the overview page. I pushed an update https://github.com/BlinkTagInc/gtfs-to-html/blob/master/views/default/formatting_functions.pug#L148 that moves the sorting logic into the template. In formatting_functions.pug there is a function called This means you can create a custom template and update this function to sort however you'd like (including using the timetable_sequence of the first timetable of each timetable page). Check it out and let me know what you think. |
ktcl-goa-in: Generating HTML timetables ===================--------------------- 470/1012 I get this error. Apparently the views do not get copid into the dist folder during instalation. |
Can you let me know the path that gtfs-to-html is set to after install: which gtfs-to-html |
It is under App Roaming folder on Windows. Will give the exact path a bit later |
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.
The text was updated successfully, but these errors were encountered: