Code to parse Thames Clippers' commuter timetable PDF and produce some more accessible HTML.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
README.md
convert.rb
template.haml
timetable.css

README.md

Accessible River Timetable

A parser/generator to turn the rather inaccessible PDF-formatted Thames Clippers timetable into HTML.

Usage

Extract the text from the commuter service PDF:

pdftotext -layout timetable.pdf

Convert to HTML:

ruby convert.rb < timetable.txt > index.html

Tweak timetable.txt to fix any columns that are out of alignment and repeat until happy.

It should look like this.

Prerequisites

  • pdftotext from the xpdf suite.
  • detabulator (gem) to parse the tabular text into columns.
  • builder (gem) to generate the tables.
  • haml (gem) and one of the many Markdown parsers to format the page HTML.