diff --git a/print.css b/print.css index 5350c23..5978f28 100644 --- a/print.css +++ b/print.css @@ -1,32 +1,50 @@ +@font-face { + font-family: DuctusRegular; + font-style: normal; + font-weight: normal; + src: url("../fonts/DuctusRegular.woff"); +} +@font-face { + font-family: "CascadiaCode VTT"; + font-weight: normal; + src: url("../fonts/CascadiaCode-Light.ttf"); +} + +@font-face { + font-family: "CascadiaCode VTT"; + font-weight: bold; + src: url("../fonts/CascadiaCode-Bold.ttf"); +} + body { - font-family: Eurostile; + font-family: "CascadiaCode VTT"; } ul { - list-style-type: none; - padding: 0 0; - margin-bottom: 1cm; + list-style-type: none; + padding: 0 0; + margin-bottom: 1cm; } -dfn, samp, dd { - text-align: center; +dfn, +samp, +dd { + text-align: center; } mark { - background: yellow; - display: block; - clear:both; - padding-left: 0.5cm; - font-family: DuctusRegular; -} -h1{ - font-family: DuctusRegular; + background: yellow; + display: block; + clear: both; + padding-left: 0.5cm; + font-family: "DuctusRegular"; } -code { - font-family: monospace; +h1, +h2, +h3, +h4, +h5, +h6 { + font-family: "DuctusRegular"; } - -p { - font-family:CascadiaCode_VTT; -} \ No newline at end of file diff --git a/script.py b/script.py index 93edbea..9a8a393 100644 --- a/script.py +++ b/script.py @@ -99,7 +99,14 @@ print("Output the files"); # Export the html as book.html, which is used as an input for pandoc with open("/home/xpub/www/html/tl-dr/book.html", "w") as f: print(output, file=f) - subprocess.run(["pandoc", "/home/xpub/www/html/tl-dr/book.html", "-o", "/home/xpub/www/html/tl-dr/logged_book.epub", "-c", "print.css", "--metadata", "title="+log_file_name, "--epub-cover-image=cover.jpg" ,"--epub-embed-font='fonts/Cascadia/ttf/CascadiaCode-*.ttf'" "--epub-embed-font='fonts/Ductus/Ductus*.woff'"], capture_output=True) + print("execute the bash script now to create the books"); + subprocess.run(["pandoc", "/home/xpub/www/html/tl-dr/book.html", + "-o", "/home/xpub/www/html/tl-dr/logged_book.epub", + "-c", "print.css", "--metadata", + "title="+log_file_name, + "--epub-cover-image=cover.jpg" , + "--epub-embed-font='/home/xpub/www/html/tl-dr/fonts/Cascadia/ttf/CascadiaCode-*.ttf'" + "--epub-embed-font='/home/xpub/www/html/tl-dr/fonts/Ductus/Ductus*.woff'"], capture_output=True) print("just generated a new book, also put it in the backlog of logs") subprocess.run(["cp", "/home/xpub/www/html/tl-dr/logged_book.epub", "/home/xpub/www/html/tl-dr/log-books/log_" + now.strftime("%Y-%m-%d_%H%M%S") + ".epub"], capture_output=True) create_all_logs_file();