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 PDF export functionality for knowledge posts #300
Conversation
6b9da15
to
068d7c5
Compare
068d7c5
to
383e138
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this!
updating if statement
✅ Build knowledge-repo 1.0.748 completed (commit bbf4f399af by @bulam) |
✅ Build knowledge-repo 1.0.750 completed (commit 1f62844d2c by @bulam) |
Rewrote the if statement to include the pdf download option among the other download options. Also, I don't think we need the format argument. The resource type seems sufficient, so removing the format arg.
removing the format arg since we also removed it from the posts.py logic
✅ Build knowledge-repo 1.0.751 completed (commit 2529e3d005 by @bulam) |
✅ Build knowledge-repo 1.0.754 completed (commit 1b27f84883 by @bulam) |
Changing the PDF font from the default to Helvetica
✅ Build knowledge-repo 1.0.756 completed (commit c587463bc0 by @bulam) |
❌ Build knowledge-repo 1.0.758 failed (commit dfc6b2ae7b by @bulam) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the following changes:
- Rewrite the if statement so that the PDF download function works along with the other download options
- Remove the post format argument since the resource type argument was sufficient
- Change PDF default font to Helvetica to match the KR default font more closely
- Add weasyprint as a dependency. Limited to older versions of weasyprint to prevent build failures due to Python 2 incompatibility
✅ Build knowledge-repo 1.0.760 completed (commit 63fc510a15 by @bulam) |
✅ Build knowledge-repo 1.0.762 completed (commit 168e0bbfc1 by @bulam) |
Ha yea maybe for the next PR :P |
✅ Build knowledge-repo 1.0.764 completed (commit f3a3f1acbc by @bulam) |
This PR addresses #298 by adding support for exporting knowledge posts to PDFs using
weasyprint
, as well as exposing support for this format in the web app user interface. At this point, the code works, but there are no stylesheets are applied, and so it is very much a work in progress.Auto-reviewers: @NiharikaRay @matthewwardrop @earthmancash @danfrankj