BlinkTagInc / gtfs-to-html

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

Route # #119

Closed pmmtt closed 3 years ago

pmmtt commented 3 years ago

Is there a way to pull just the route number, not all the timetable info?

brendannee commented 3 years ago

You can create a custom template that would omit timetables and only show route names and numbers if you want: https://gtfstohtml.com/docs/custom-templates

pmmtt commented 3 years ago

Thanks. Is there a specific argument for the route number?

On Wed, Aug 25, 2021 at 10:30 AM Brendan Nee @.***> wrote:

You can create a custom template that would omit timetables and only show route names and numbers if you want: https://gtfstohtml.com/docs/custom-templates

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/BlinkTagInc/gtfs-to-html/issues/119#issuecomment-905732325, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEIDEK7DBSF5BY4NAER3UR3T6USCHANCNFSM5CZTIAFA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

brendannee commented 3 years ago

There are variables available in the template. Each timetablePags has an array of timetables as timetablePage.consolidatedTimetables each timetable has an array of route objects, each route object has a route_short_name which should have route number.

timetablePage.consolidatedTimetables[0].routes[0].route_short_name should get it for a timetable that only has one route (the most common case).

See example usage in the default template: https://github.com/BlinkTagInc/gtfs-to-html/blob/master/views/default/timetablepage.pug#L9