Open swashata opened 5 years ago
Downloading as a PDF can also be done through the regular print feature of most operating systems.
Yes and we can also have a button to invoke the print command, which is the easiest to implement.
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.
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