Giter Site home page Giter Site logo

joonas-fi / emergency-details-printout Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 2.59 MB

Website for printing an "emergency details" paper for helping deal with situations that need quick attention

Home Page: https://joonas.fi/emergency-details-printout/

License: Apache License 2.0

Go 47.15% HTML 52.85%
emergency-situation emergency-numbers emergency-contacts emergency

emergency-details-printout's Introduction

emergency-details-printout's People

Contributors

crystal-rainslide avatar joonas-fi avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

emergency-details-printout's Issues

Migrate to better html2pdf backend

Related to regression in #4 (regressed due to external runtime dep breaking, and the external dep was required due to wkhtmltopdf not supporting emoji fonts without external JS dep)

Best to migrate away from wkhtmltopdf soon. The pain in using that is accumulating.

wkhtmltopdf documents WeasyPrint as free alternative.

A quick Google reveals no quick alternatives that would be better.

WeasyPrint doesn't seem to have any official Docker packaging, however 3rd party option reveals minidocks/weasyprint (at DockerHub) as the most promising alternative (small size + updated recently)

That in itself doesn't support emojis out of the box due to missing emoji font, so need to extend the Dockerfile:

FROM minidocks/weasyprint:latest

RUN apk add --no-cache font-noto-emoji

With that taking the HTML as generated by emergency-details-printout renders acceptably out of the box:

image

This result was generated based on these commands:

# precondition: have our HTML in testhtml.html
$ docker build -t weasyprint .
$ docker run --rm -v `pwd`:/app -w /app weasyprint testhtml.html testhtml.pdf

TODO:

  • Publish weasyprint with the emoji font
  • Figure out how Lambda works with containers (if it needs AWS's miserable Container Registry might not be worth the trouble..) and how to overlay our Go-based func on top of that
  • Ship weasyprint as new rendering engine to html2pdf
  • Remove twemoji crutch from our HTML
  • Possibly change html2pdf API to take in our heimlick / resuscitation drawings in the req (repay technical debt: not require downloading images over external HTTP deps)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.