PDF(HTML) templates are shown here.
from gummy.utils import tohtml
[success] local driver can be built. [failure] remote driver can't be built. DRIVER_TYPE: local
contents = [
{
"en": "English",
"ja": "日本語",
"head": "見出し",
"subhead": "小見出し"
}
]
_ = tohtml(
path="example.html",
title="Title",
contents=contents,
template="paper.html",
)
Save HTML file at example.html
!cat example.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="twitter:card" content="summary" /> <meta name="twitter:site" content="@cabernet_rock" /> <meta property="og:url" content="https://github.com/iwasakishuto/Translation-Gummy" /> <meta property="og:title" content="Translation-Gummy" /> <meta property="og:description" content="Translation Gummy is a magical gadget which enables user to be able to speak and understand other languages." /> <meta property="og:image" content="https://github.com/iwasakishuto/Translation-Gummy/blob/master/image/header.png?raw=true" /> <meta name="slack-app-id" content="A017FQB5GV9"> <title>Title</title> <style> body { font-family: "Times New Roman", "Helvetica Neue", Meiryo, monospace, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, IPAexMincho, "Open Sans", "Helvetica Neue", sans-serif, serif; margin: 0; } span.title { text-align: center; font-size: 2.5em; font-weight: bold; } h2.head { border-bottom: 2px solid #d5d5d5; font-size: 1.5em; margin: 0.75em 0; } h3.subhead { font-size: 1.1em; margin: 0.75em 0; position: relative; padding: 0 1em; display: inline-block; top:0; } h3.subhead:before, h3.subhead:after { position: absolute; top: 0; content:''; width: 8px; height: 100%; display: inline-block; } h3.subhead:before { border-top: solid 1px #d5d5d5; border-left: solid 1px #d5d5d5; border-bottom: solid 1px #d5d5d5; left: 0; } h3.subhead:after { content: ''; border-top: solid 1px #d5d5d5; border-right: solid 1px #d5d5d5; border-bottom: solid 1px #d5d5d5; right: 0; } table { width: 100%; border-collapse: collapse; table-layout: fixed; } thead { font-size: 1.15em; font-weight: bold; } td, th { width: 50%; vertical-align: top; } .raw { line-height: 1.6em; } .translated { font-size: 0.85em; line-height: 2.25em; } p.img_center { text-align: center; border: 5px solid #d5d5d5; padding: 20px 10px; max-width: 100%; margin: 10px 10%; } img { max-width: 80%; } span.odd { background-color: #fff!important; } span.even { background-color: #ddd!important; } sup { color: #777; font-size: .75em; } @media print { * { -webkit-print-color-adjust: exact; } span.odd { background-color: #fff!important; } span.even { background-color: #ddd!important; } } </style> </head> <body> <span class="title"> Title </span> <h2 class="head">見出し</h2> <h3 class="subhead">小見出し</h3> </body> </html>