docs-app icon indicating copy to clipboard operation
docs-app copied to clipboard

Build the PDF version after each deploy

Open sergeyklay opened this issue 7 years ago • 14 comments

sergeyklay avatar Jul 17 '17 13:07 sergeyklay

Is this still on our wish list?

ruudboon avatar Feb 01 '19 17:02 ruudboon

Well, we did this earlier for older versions and I see no reason because of which we cannot do it now. Probable we should discuss this at Discord.

sergeyklay avatar Feb 02 '19 08:02 sergeyklay

Yes we can do this but to do so we need to first build PDF templates. Once that is done it should be easy to generate the file

niden avatar Feb 02 '19 20:02 niden

@niden What kind of templates do you need? Isn't this something we can do with pdffiller.com?

ruudboon avatar Feb 04 '19 16:02 ruudboon

@ruudboon There is a gem that generates PDF files from the Jekyll pages. All it needs is HTML templates that the PDF process will use i.e. not to have the big header and the right sidebar (as our docs site has now).

Then I can start testing this and see how the PDF comes out. I don't think that we need PDFiller for this, at least until we just try that out.

The templates themselves can be very rudimentary, honestly not even have any styling. For now I just want to know how it will render. If that is successful then we can work on making them better/prettier

niden avatar Feb 04 '19 16:02 niden

https://github.com/abeMedia/jekyll-pdf

This is the library I am looking at. It kind of seems that it is abandoned and there is a "bug" they have with launching it but one of the users has a solution for it. so it will work.

Note how in the readme it mentions about header/footer and cover page templates.

niden avatar Feb 04 '19 16:02 niden

Ok, will have a look at if @ninjapanzer didn't started it already.

ruudboon avatar Feb 04 '19 16:02 ruudboon

I am going to do my best to wrap this up today

ninjapanzer avatar Feb 09 '19 13:02 ninjapanzer

So I see two paths here:

  1. https://github.com/abeMedia/jekyll-pdf -> supports page by page PDFs so this is useful for getting a printable pdf of any page. It is based on WKHTML2PDF which is kinda like imagemagick where each version has its own bugs and features that work differently
  2. https://idratherbewriting.com/documentation-theme-jekyll/mydoc_generating_pdfs.html -> this one is some tooling ontop of prince that generates a full site PDF.

EDIT PRINCE is not an open source product so I am going to keep poking about for a solution

I suspect that 1 is abandonware because the browser does a really good job of this given we have valid Print CSS. That said I am going to follow along with the full site PDF which while it has been a while feels like what we used to do.

The deploy process should be easy to automate. Some buildmachine has to run a script to serve the jekyll site in devmode and then then prince walks the site and produces a pdf.

Are we doing any deploys via docker here? I see a boxfile.yml but I am unsure what is using that.

ninjapanzer avatar Feb 09 '19 20:02 ninjapanzer

@ninjapanzer The boxfile.yml is there if you want to run the docs locally. When something gets pushed to the docs-app repository, netlify gets notifified and starts building the site. Once the build is complete it is deployed as live.

From what I understood reading regarding the jekyll-pdf if you will need templates for your PDF version (pdf_*.html) potentially stripped of from the unnecessary stuff such as the sidebar for instance and just print one page after another to produce the PDF file. Then the file is ready to be downloaded.

niden avatar Feb 10 '19 15:02 niden

@niden are you looking to have 1 pdf file for each version and language or one per rendered page?

I figure the goal isn’t to get an offline copy of the docs in whole

ninjapanzer avatar Feb 10 '19 17:02 ninjapanzer

I was looking for one PDF file for English (everything in there) and one per other language. So you have the whole docs as one

niden avatar Feb 10 '19 23:02 niden

Ok thats the direction I am going, I am taking https://github.com/abeMedia/jekyll-pdf as a pattern and writing a new gem that will using the existing site metadata to generate the pdfs in various combinations.

So if jekyll-pdf would have worked so will this.

ninjapanzer avatar Feb 11 '19 13:02 ninjapanzer

@ninjapanzer Is this something you're still working on?

ruudboon avatar Sep 04 '19 11:09 ruudboon