anaconda / nbpresent

next generation slides for Jupyter Notebooks
BSD 3-Clause "New" or "Revised" License
164 stars 24 forks source link

[wip] pdf generation #16

Closed bollwyvl closed 8 years ago

bollwyvl commented 9 years ago

This is the current state of the pdf work. It's pretty raw.

I am trying ghost.py instead of phantom: it's a more robust, as it doesn't bundle all of qt, but more about that below, and gives us better access to the underlying components of qt. it's error handling is not as good as phantomjs, though.

It stands up a temporary tornado server, and uses a long task outside the event loop which then kills the event loop when done.

I am getting some fascinating js errors that are heisenbergingly absent when run "full-local", i.e. no network access, but i am slowly but surely finding my way there through a mountain of undefined(0): undefiend is not a function-style errors.

Features

I am not trying to hit the widgets yet! That will probably have to wait until pyqt5 is usable with ghost

bollwyvl commented 9 years ago

Here's the kind of thing I'm getting out right now :) output.pdf

bollwyvl commented 9 years ago

The loading problem is due to baobab... maybe something isn't shimmed properly...

bollwyvl commented 9 years ago

Yep. The issue was creaky old PyQt's webview didn't have the Function.prototype.bind defined, which was exploding in ghost. Would have happened over in phantom, too, though I might have found it much more quickly.

Output is getting a lot better: output.pdf

I am going to do some other tests to ensure it's not cheating, but I'm confident it will be demoable now.

bollwyvl commented 9 years ago

The examples are looking better!

bollwyvl commented 8 years ago

Ok, really pretty ready to be done with this. nbbrowserpdf is in -c nbcio. I'm going to merge this, and we can pick up the shiny pieces if the nbpresent build is not good.