wptrainingteam / repo-template

Template for creating lesson plan repos, including the lesson plan template. Fork this or use it as a template to create new lesson plans.
GNU General Public License v3.0
14 stars 41 forks source link

Feature: Download Slide as PDF #21

Open swashata opened 5 years ago

swashata commented 5 years ago

While discussing at WordCamp Ahmedabad today, we came up with an idea that perhaps we can have a button on the main page of the slide which would download a PDF format of the document.

I think this is very much doable and would solve the offline issue. There are three approaches that come to mind.

Manual PDF Linking

Here, author of the repo/slide would create a PDF by simply taking a Print (Save as PDF) and having the button link to the PDF.

pros

cons

Automated PDF generation with JS

We can use an Open Source MIT licensed JS library jsPDF to automate the process without needing a server.

pros

cons

Build time PDF generation

I don't know here how exactly the docs would find their way to publication/website. But there has to be a build process and I believe it would be powered by node.

So if we have something to work with right now, I think it would be best for me to try and integrate the PDF generation during the build time.

pros

cons

JulieKuehl commented 5 years ago

Downloading as a PDF can also be done through the regular print feature of most operating systems.

swashata commented 5 years ago

Yes and we can also have a button to invoke the print command, which is the easiest to implement.

JulieKuehl commented 5 years ago

Just be aware that on the learn.wordpress.org site we are very limited as to what scripts can be run there. We'll have to work with the Meta team on this.