jupyter / nbviewer

nbconvert as a web service: Render Jupyter Notebooks as static web pages
https://nbviewer.jupyter.org
Other
2.21k stars 547 forks source link

Add PDF rendering #577

Open yuvipanda opened 8 years ago

yuvipanda commented 8 years ago

Would be quite cool, but also possibly more taxing on resources (at least for the public viewer).

Maybe could add it, and disable it for the public nbviewer (or just enable it, and disable it if it takes up too much resources?)

Carreau commented 8 years ago

Yeah, latex rendering is extremely resource intensive. I think this is more "nbconvert as a remote API" than actually for the nbviewer itself.

yuvipanda commented 8 years ago

I agree, but considering how hard latex can be to setup locally for several people, I do think it is a worthwhile thing to do.

bollwyvl commented 8 years ago

Yeah, the other somewhat promising approach (pdf via headless webkit) is also quite taxing... still digging into it here: https://github.com/Anaconda-Server/nbbrowserpdf

Fonts are kind of an issue, still working through.

This is germane to one theme of https://github.com/jupyter/notebook/issues/1123, namely really enhancing the fixed-page chops of the notebook, potentially with adopting ProseMirror/Draftjs.

perhaps we make it distributed? nbviewer@home? the search for archival, reproducible science!

Actually, that's less crazy than it sounds... torrents are a beautiful model for robust information dissemination. but still doesn't solve it all. I wonder how the readthedocs guys do it...

On Mon, Feb 22, 2016 at 2:10 PM Yuvi Panda notifications@github.com wrote:

I agree, but considering how hard latex can be to setup locally for several people, I do think it is a worthwhile thing to do.

— Reply to this email directly or view it on GitHub https://github.com/jupyter/nbviewer/issues/577#issuecomment-187324065.

yuvipanda commented 8 years ago

@bollwyvl ah, I've been thinking that IPFS (IPFS.io) and notebooks are a great fit :D

bollwyvl commented 8 years ago

Notebooks in spaaaaace!

We're working on an extension for uploading to anaconda.org, but have already discussed renaming it to nb_publish and offering github/gist/s3 uploading... or at least the UI/API hooks!

I think some kind of DHT (or whatever the IPFS merkledag is) publish would be dominate each of those for every aspect save, perhaps apparent security... because torrents are scary :ghost: But throw some encryption at it, and it'll be better than putting it in the cloud. More like the Oort cloud.

One could choose to include any of the following:

I don't think nbviewer would get involved in this particular game... but it wouldn't have to :) i imagine a binary (or conda-based) distribution of ipfs would be pretty trivial for most users to adopt that were willing to accept the peer-to-peer model.

then it's just a touch of UI:

For humor, here's a sort of self-IPFS-quining notebook using nbpresent: https://ipfs.io/ipfs/QmXNmc7L2pnqGo2Y4fFVMdYZkCaCrbfhX1Zj4kNr5hB3eh (there's a little information theoretical problem built in, but it's close enough)

I've killed my daemon and removed all my creds, and it still appears to be loading, so I'll be interested to see how it lives on.

Fantastic stuff!

yuvipanda commented 8 years ago

@bollwyvl :D <3 YES! We should move that conversation off this ticket to somewhere else tho.

Carreau commented 8 years ago

ipynbfs ?

mgeier commented 8 years ago

@yuvipanda As an alternative to nbviewer, you might want to consider creating PDFs on readthedocs.org. You can use nbsphinx to compile one notebook or several notebooks to PDF via Sphinx. The nice thing is that this can be done automatically on readthedocs.org. You can even execute your notebooks on the server (I think there is a 15-minute maximum runtime, though).

Here's an example for a PDF file created on readthedocs.org: https://media.readthedocs.org/pdf/nbsphinx/latest/nbsphinx.pdf

Note, however, that there is currently a problem: https://github.com/rtfd/readthedocs.org/issues/2127 (UPDATE: the problem is solved by upgrading to Sphinx >= 1.4).