(modified to export various util functions for smartrider)
See gtfstohtml.com for full documentation.
gtfs-to-html
creates human-readable, user-friendly transit timetables in HTML and PDF format directly from GTFS transit data. Most transit agencies have schedule data in GTFS format but need to show each route's schedule to users on a website. This project automates the process of creating nicely formatted HTML timetables for inclusion on a transit agency website. This makes it easy to keep timetables up to date and accurate when schedule changes happen and reduces the likelihood of errors.
gtfs-to-html
has many options that configure how timetables are presented. It also allows using a completely custom template which makes it easy to build chunks of HTML that will fit perfectly into any website using any HTML structure and classes that you'd like. Or, create printable PDF versions of timetables using the outputFormat
config option.
gtfs-to-html
properly formats timetables to ensure they are screen-reader accessible and WCAG 2.0 compliant.
Built-in styling makes gtfs-to-html
timetables ready to size and scroll easily on mobile phones and tablets.
By generating future timetables and including dates in table metadata, your timetables can appear in advance of a schedule change, and you can validate that your new timetables and GTFS are correct.
gtfs-to-html
can also generate a map for each route that can be included with the schedule page. The map shows all stops for the route and lists all routes that serve each stop. See the showMap
configuration option below. If you'd rather just get all stops and route info as geoJSON, check out the gtfs-to-geojson package.
gtfs-to-html
uses the node-gtfs
library to handle importing and querying GTFS data.
You can now use gtfs-to-html
without actually downloading any code or doing any configuration. run.gtfstohtml.com provides a web based interface for finding GTFS feeds for agenices, setting configuration and then generates a previewable and downloadable set of timetables.
Many transit agencies use gtfs-to-html
to generate the schedule pages used on their websites, including:
- Advance Transit
- Brockton Area Transit Authority
- Capital Transit (Helena, Montana)
- Capital Transit (Juneau, Alaska)
- County Connection (Contra Costa County, California)
- El Dorado Transit
- Greater Attleboro-Taunton Regional Transit Authority
- Humboldt Transit Authority
- Kings Area Rural Transit (KART)
- Madera County Connection
- Marin Transit
- Morongo Basin Transit Authority
- Mountain Transit
- MVgo (Mountain View, CA)
- NW Connector (Oregon)
- Palo Verde Valley Transit Agency
- Petaluma Transit
- RTC Washoe (Reno, NV)
- Santa Barbara Metropolitan Transit District
- Sonoma County Transit
- Tahoe Truckee Area Regional Transit
- Tulare County Area Transit
- Victor Valley Transit
- Worcester Regional Transit Authority
Are you using gtfs-to-html
? Let us know via email (brendan@blinktag.com) or via opening a github issue or pull request if your agency is using this library.
gtfs-to-html
is used as an integral part of transit-custom-posts
- a GTFS-optimized Wordpress plugin for transit websites.
See GTFS-to-HTML Documentation
GTFS-to-HTML 1.0.0 has some breaking changes.
- MongoDB is no longer used, instead SQLite is used.
config.json
accepts asqlitePath
instead of amongoUrl
.route_color
androute_text_color
in exported geoJSON now have a#
prepended to the hex color. So#45AA00
instead of45AA00
.- The
dataExpireAfterSeconds
config option has been removed. - The default view
pug
template inviews/timetable
has some small improvements.
Pull requests are welcome, as is feedback and reporting issues.
npm test