add weasyprint function

that was actually for free, but maybe should we do imports inside the function so there is not another dependency added?

(sorry for bombing so many pr's ;) )