{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Create a Template" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "PDF(HTML) templates are shown [here](https://github.com/iwasakishuto/Translation-Gummy/tree/master/gummy/templates)." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[32m[success]\u001b[0m local driver can be built.\n", "\u001b[31m[failure]\u001b[0m remote driver can't be built.\n", "DRIVER_TYPE: \u001b[32mlocal\u001b[0m\n" ] } ], "source": [ "from gummy.utils import tohtml" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "code_folding": [] }, "outputs": [], "source": [ "contents = [\n", " {\n", " \"en\": \"English\",\n", " \"ja\": \"日本語\",\n", " \"head\": \"見出し\",\n", " \"subhead\": \"小見出し\"\n", " }\n", "]" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Save HTML file at \u001b[34mexample.html\u001b[0m\n" ] } ], "source": [ "_ = tohtml(\n", " path=\"example.html\", \n", " title=\"Title\", \n", " contents=contents,\n", " template=\"paper.html\",\n", ")" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "scrolled": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\r\n", "\r\n", "
\r\n", " \r\n", " \r\n", " \r\n", " \r\n", " \r\n", " \r\n", " \r\n", " \r\n", " \r\n", "