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 PDF export functionality for knowledge posts #300

Merged
merged 11 commits into from May 26, 2020
Merged

Conversation

matthewwardrop
Copy link
Collaborator

@matthewwardrop matthewwardrop commented Jul 7, 2017

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

Copy link
Collaborator

@NiharikaRay NiharikaRay left a 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!

@AppVeyorBot
Copy link

@AppVeyorBot
Copy link

bulam added 2 commits May 25, 2020 00:53
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
@AppVeyorBot
Copy link

@AppVeyorBot
Copy link

Changing the PDF font from the default to Helvetica
@AppVeyorBot
Copy link

@AppVeyorBot
Copy link

Build knowledge-repo 1.0.758 failed (commit dfc6b2ae7b by @bulam)

Copy link
Collaborator

@bulam bulam left a 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

@AppVeyorBot
Copy link

@AppVeyorBot
Copy link

@bulam
Copy link
Collaborator

bulam commented May 26, 2020

It's been a long time since this PR was updated and it looks like a lot of improvements to weasyprint have been made in the meantime? Maybe you can bump the pinned version.

Edit: oh, I saw the point about Python 2 compatibility. Just open another PR dropping Python 2 from the CI ;)

Ha yea maybe for the next PR :P

@AppVeyorBot
Copy link

@bulam bulam merged commit d386671 into master May 26, 2020
@naoyak naoyak mentioned this pull request May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants