{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Weasyprint" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from weasyprint import HTML, CSS\n", "from weasyprint.fonts import FontConfiguration" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "https://weasyprint.readthedocs.io/en/latest/tutorial.html" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "# If you use @font-face in your stylesheet, you would need Weasyprint's FontConfiguration()\n", "font_config = FontConfiguration()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## HTML" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "# small example HTML object\n", "html = HTML(string='