docs-app
docs-app copied to clipboard
Build the PDF version after each deploy
Is this still on our wish list?
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.
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 What kind of templates do you need? Isn't this something we can do with pdffiller.com?
@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
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.
Ok, will have a look at if @ninjapanzer didn't started it already.
I am going to do my best to wrap this up today
So I see two paths here:
-
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 -
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 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 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
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
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 Is this something you're still working on?