explosion / spacy-course

👩‍🏫 Advanced NLP with spaCy: A free online course
https://course.spacy.io
MIT License
2.31k stars 368 forks source link

"Export slides deck to pdf" functionality #19

Open GiulioRossetti opened 5 years ago

GiulioRossetti commented 5 years ago

Hi, this project is indeed very nice.

What about implementing an "export to pdf" functionality for slides deck? I feel that it might be something useful to make teaching resources available also offline.

ines commented 5 years ago

Yes, I've been thinking about this as well. The slides are powered by reveal.js, so in theory, PDF export should be possible. But I haven't really tried this yet.

The Gatsby/React setup that basically creates new instances of the Reveal slides for each slides section on the page might need some additional workarounds to ensure it's only ever printing the slides. But we might be able to do that in the print stylesheet.

(An alternative approach would be to generate the PDFs at build time via Gatsby. But this feels unnecessarily complicated and means we likely wouldn't be able to take advantage of what Reveal.js already does out-of-the-box.)

dwinston commented 4 years ago

It seems that reveal.js's dynamic PDF export doesn't actually produce a PDF file. Rather, it produces a view that allows you to "print to PDF" in a way that requires a user to be sure to set layout to landscape, enable background graphics option, etc. decktape would generate PDFs at build time, but in a way that leverages reveal.js functionality (headless rendering), and it purports to support reveal.js.

I don't have immediate plans to try this, but I thought it'd be a helpful contribution to this thread. I am interested in perhaps building a course using ines/course-starter-python, and slide deck PDFs would be something I'd want.