Skip to content

Commit

Permalink
Merge pull request #156 from mormahr/presentational-hints
Browse files Browse the repository at this point in the history
Enable HTML presentational hints
  • Loading branch information
mormahr authored Sep 2, 2021
2 parents 0df5e0d + 824cbcd commit 3c2362f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Summary: WeasyPrint v53, alpine and much smaller image.
[#115](https://github.com/mormahr/pdf-service/pull/115)
- Switched base image from debian buster to alpine v3.14 (includes visual changes)
[#119](https://github.com/mormahr/pdf-service/pull/119)
- Enable [HTML presentational hints][whatwg-presentational-hints] [option in WeasyPrint][weasyprint-presentational-hints]
[#156](https://github.com/mormahr/pdf-service/pull/156)

### Improvements
- Reduced Docker image size from 363.98 MB (v1.1) to 176.67 MB (v2)
Expand Down Expand Up @@ -41,3 +43,6 @@ Summary: WeasyPrint v53, alpine and much smaller image.
**WeasyPrint: v52.5**

Initial public release 🎉

[whatwg-presentational-hints]: https://html.spec.whatwg.org/multipage/rendering.html#the-css-user-agent-style-sheet-and-presentational-hints
[weasyprint-presentational-hints]: https://doc.courtbouillon.org/weasyprint/stable/api_reference.html#weasyprint.HTML.render
2 changes: 1 addition & 1 deletion pdf_service/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def generate() -> Response:
)

with start_span(op='render'):
doc = html.render()
doc = html.render(presentational_hints=True)

with start_span(op='write-pdf'):
pdf = doc.write_pdf()
Expand Down

0 comments on commit 3c2362f

Please sign in to comment.