]> Shamusworld >> Repos - ardour-manual/commitdiff
Made PDF generation work again
authorEd Ward <edwsaintesprit@hotmail.com>
Sun, 18 Apr 2021 10:03:22 +0000 (12:03 +0200)
committerEd Ward <edwsaintesprit@hotmail.com>
Sun, 18 Apr 2021 10:03:22 +0000 (12:03 +0200)
build.py
pdf-template.html
source/css/common.css
source/css/junge-regular-webfont.woff [deleted file]
source/css/junge-regular-webfont.woff2 [deleted file]

index 3056faf919f61311d654281042ae28b93b65e497..775e3f800f76b1966d3a43781ecc8eab34f78cc3 100755 (executable)
--- a/build.py
+++ b/build.py
@@ -29,7 +29,6 @@ global_pdf_template = 'pdf-template.html'
 global_master_doc = 'master-doc.txt'
 global_pdflink = '<button class="btn btn-default" type="button" onclick="window.location.href=\'/manual.pdf\'"><span class="glyphicon glyphicon-book" aria-hidden="true"></span></button>'
 from datetime import datetime
-global_today_iso = datetime.today().strftime('%Y-%m-%dT%H%M%S')
 global_today = datetime.today().strftime('%Y-%m-%d')
 
 # This matches all *non* letter/number, ' ', '.', '-', and '_' chars
@@ -697,12 +696,14 @@ onepageFile.close()
 if pdf:
        if noisy:
                print('Generating the PDF...')
+               import logging
+               logger = logging.getLogger('weasyprint')
+               logger.addHandler(logging.StreamHandler())
 
        # Create the PDF version of the documentation
        pdfpage = pdfpage.replace('{% tree %}', opsidebar) # create the TOC
        pdfpage = pdfpage.replace('{{ content }}', '') # cleans up the last spaceholder
        pdfpage = pdfpage.replace('{{ today }}', global_today)
-       pdfpage = pdfpage.replace('{{ today_iso }}', global_today_iso)
        pdfpage = pdfpage.replace('src="/images/', 'src="images/') # makes images links relative
        pdfpage = pdfpage.replace('url(\'/images/', 'url(\'images/') # CSS images links relative
        # Write it to disk (optional, can be removed)
@@ -713,6 +714,7 @@ if pdf:
        # Generating the actual PDF with weasyprint (https://weasyprint.org/)
        from weasyprint import HTML
        from weasyprint.fonts import FontConfiguration
+       
        html_font_config = FontConfiguration()
        doc = HTML(string = pdfpage, base_url = global_site_dir)
        doc.write_pdf(global_site_dir + 'manual.pdf', font_config = html_font_config)
index b90d28d53e16ef6181047cd205d0167bf33c038f..fd40564238c0658f271574587c57952adecb8c83 100644 (file)
@@ -8,8 +8,8 @@
        <meta name="description" content="Official manual for Ardour (www.ardour.org) generated from the online manual (manual.ardour.org)">
        <meta name="keywords" content="Ardour digital audio workstation manual">
        <meta name="generator" content="Weasyprint (weasyprint.org)">
-       <meta name="dcterms.created" content="{{ today_iso }}">
-       <meta name="dcterms.modified" content="{{ today_iso }}">
+       <meta name="dcterms.created" content="{{ today }}">
+       <meta name="dcterms.modified" content="{{ today }}">
        <link href="css/common.css" rel="stylesheet">
        <link href="css/luadoc.css" rel="stylesheet">
        <link href="css/pdf.css" rel="stylesheet">
index 1accfc75e5b19ec11283ef51a88702e1f6362177..98d12e580ef06f133d604085b912527012d245a9 100644 (file)
@@ -1,7 +1,6 @@
 @font-face {
     font-family: 'junge-regular';
-    src: url('junge-regular-webfont.woff') format('woff'),
-         url('junge-regular-webfont.ttf')  format('truetype');
+    src: url('../css/junge-regular-webfont.ttf')  format('truetype');
     font-weight: normal;
     font-style: normal;
 }
@@ -78,11 +77,11 @@ kbd.option {
 }
 
 kbd.optoff:before {
-  content: url('/images/checkbox-unchecked.png');
+  content: url('../images/checkbox-unchecked.png');
 }
 
 kbd.option:before {
-  content: url('/images/checkbox-checked.png');
+  content: url('../images/checkbox-checked.png');
 }
 
 kbd.menu {
diff --git a/source/css/junge-regular-webfont.woff b/source/css/junge-regular-webfont.woff
deleted file mode 100644 (file)
index 4a74925..0000000
Binary files a/source/css/junge-regular-webfont.woff and /dev/null differ
diff --git a/source/css/junge-regular-webfont.woff2 b/source/css/junge-regular-webfont.woff2
deleted file mode 100644 (file)
index 331d75e..0000000
Binary files a/source/css/junge-regular-webfont.woff2 and /dev/null differ