doc: Work with sphinx 1.2.3

Fix up to work with new sphinx.  Backported to allow the old docs to continue to build.

--rebased-from #1330 

--------

Testing: will build with sphinx 1.2.3.