Fix version format.
Merge David's changes: fix reading an empty table.
Rewrite build-docs script in Python.