Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generator for documentation as PDF file #252

Closed
wants to merge 5 commits into from

Conversation

craig-davis
Copy link
Contributor

Closes #174

Feature

This adds a new grunt powered PDF generator that builds documentation to a new docs/docs.pdf file.

Background

This is based on the node-html-pdf project that can transform html to pdf. It uses a headless browser to drive this and the PDF layout is somewhat limited and finicky. However, it works reliably.

Solution

This introduces a new /docs.pdf.html template file that uses Jekyll relative include trickery to build a single html document that contains all of the docs found in the _config.yaml file. This file can then be processed into a PDF with the new grunt plugin.

This requires us to first build the _site and then build a PDF file that can be added.

~ make changes to docs files
> jekyll build
> grunt html_pdf
> git add docs/docs.pdf

Screenshot

pdf screenshot

Next Steps

The CSS in this is not complete. Because of the limitations of the web font used on the Slim website, the generator is not allowed to use the official font. In addition, there are certainly other improvements that can be made. I consider this to be a PR with demonstration of the mechanics of how this can be done with the existing build tools.

Other Updates

  • Removed .DS_Store file
  • Updated the .gitignore file for OSX, PHPStorm, Jekyll, and Node
  • Updated the _config.yml excludes so that README and friends aren't published.

Update package to include grunt-html-pdf with new docs generators
using some hackish Jekyll including and building. This includes
a separate pdf.less file that we can use to style the new docs
page.
Copy link
Member

@geggleto geggleto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. @akrabat @craig-davis just to be clear; would we need to run this after every update or is it automated?

@akrabat from an architecture point of view; should be upload it to an S3 bucket so we can have versioning?

@craig-davis
Copy link
Contributor Author

@geggleto IIRC, this can be run after any update. This adds a new command html_pdf that generates a pdf file. I don't know how y'all are managing the web site. You could run that command and then whatever you'd like with the docs/docs.pdf that it makes. I think I wrote the Solution section of this with the idea that you may be using GitHub Pages hosting.

@l0gicgate
Copy link
Member

Is there going to be any new progress with this? Otherwise I will close this PR as it is stale.

@l0gicgate l0gicgate closed this Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PDF for this
3 participants