PDF output for RsT/Sphinx documents works again

40 views
Skip to first unread message

Thomas Passin

unread,
Dec 27, 2019, 6:48:47 PM12/27/19
to leo-editor
With the change to Python 3+ for Leo, I found I couldn't build Sphinx documents to PDF, using rst2pdf.  It only worked for Python 2.x, not 3.x.  I've done some work on it, and I'm happy to say that I have had some success.

First of all, the Github repo for rst2pdf has had some updates since the last version available using pip, and many of the Python 3.x problems have been worked out.  I have fixed a few more and put requests on the rst2pdf github site to incorporate them.  Let's hope that happens.

Next I found that a build on Windows failed though it worked on Linux.  This turned out to be an issue with Jinja2, which is used behind the scenes.  I fixed that and posted the solution to the Jinja2 github site.

With these fixes, the documentation package built successfully on Windows.

I know that there are more unfixed Python 2/3 issues still in the rst2pdf codebase, but they didn't prevent my document from building.  So I'm happy.


If anyone needs the fixes I came up with before they get put into the codebases (if they ever do), say so and I'll post them here.

Matt Wilkie

unread,
Jan 3, 2020, 6:58:21 PM1/3/20
to leo-editor
Good things to know. Thanks! The rst2pdf project looks relatively vibrant so I would expect your fixes or something approximating them to be incorporated before too long.

Edward K. Ream

unread,
Jan 7, 2020, 5:16:25 AM1/7/20
to leo-editor
On Friday, December 27, 2019 at 6:48:47 PM UTC-5, Thomas Passin wrote:

With the change to Python 3+ for Leo, I found I couldn't build Sphinx documents to PDF, using rst2pdf.  It only worked for Python 2.x, not 3.x.  I've done some work on it, and I'm happy to say that I have had some success.

First of all, the Github repo for rst2pdf has had some updates since the last version available using pip, and many of the Python 3.x problems have been worked out.  I have fixed a few more and put requests on the rst2pdf github site to incorporate them.  Let's hope that happens.

Thanks for this excellent work.  I expect many more improvements in the python world now all python programmers are free to ignore all 2.x stuff.  Supporting 2.x was like a boat anchor.  I'm thrilled to be rid of it.

Edward
Reply all
Reply to author
Forward
0 new messages