]> Shamusworld >> Repos - ardour-manual/commitdiff
Added metadata to the PDF
authorEd Ward <edwsaintesprit@hotmail.com>
Fri, 2 Aug 2019 09:06:35 +0000 (11:06 +0200)
committerEd Ward <edwsaintesprit@hotmail.com>
Fri, 2 Aug 2019 09:06:35 +0000 (11:06 +0200)
build.py
pdf-template.html

index 76eee46fbd6a116cc25ac911e5c54ceed1c1bf86..e9f4f279fee121e237aa9058a148b083179540e6 100755 (executable)
--- a/build.py
+++ b/build.py
@@ -27,6 +27,7 @@ global_onepage_template = 'onepage-template.html'
 global_pdf_template = 'pdf-template.html'
 global_master_doc = 'master-doc.txt'
 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
@@ -685,6 +686,7 @@ if not nopdf:
        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)
@@ -694,10 +696,10 @@ if not nopdf:
 
        # Generating the actual PDF with weasyprint (https://weasyprint.org/)
        from weasyprint import HTML
-       #from weasyprint.fonts import FontConfiguration
-       #html_font_config = FontConfiguration()
+       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)
+       doc.write_pdf(global_site_dir + 'manual.pdf', font_config = html_font_config)
 
 if not quiet:
        print('Processed ' + str(fileCount) + ' files.')
index 5ef5ffc742b5207ac22a4575a4290b7afd9ab66c..b90d28d53e16ef6181047cd205d0167bf33c038f 100644 (file)
@@ -3,8 +3,13 @@
 
 <head>
        <meta charset="utf-8">
-  <meta name="author" content="The Ardour Team">
        <title>{{page.page_title}}</title>
+  <meta name="author" content="The Ardour Team">
+       <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 }}">
        <link href="css/common.css" rel="stylesheet">
        <link href="css/luadoc.css" rel="stylesheet">
        <link href="css/pdf.css" rel="stylesheet">