show wkhtmltopdf output when logging verbose
This commit is contained in:
parent
b01532e7d3
commit
851a215762
1 changed files with 3 additions and 1 deletions
|
@ -4,6 +4,7 @@ from md_pdf.build.cover import OUTPUT_COVER_FILE
|
|||
import os
|
||||
import logging
|
||||
|
||||
|
||||
logger = logging.getLogger(__file__)
|
||||
|
||||
|
||||
|
@ -14,7 +15,6 @@ STYLE_FILE = os.path.join(STATIC_DIR, 'style.css')
|
|||
HEADER_FILE = os.path.join(TEMPLATES_DIR, 'header.html')
|
||||
FOOTER_FILE = os.path.join(TEMPLATES_DIR, 'footer.html')
|
||||
PDF_OPTIONS = {
|
||||
"quiet": "",
|
||||
"no-pdf-compression": "",
|
||||
"enable-internal-links": "",
|
||||
|
||||
|
@ -28,6 +28,8 @@ PDF_OPTIONS = {
|
|||
|
||||
|
||||
def export_pdf(content, config):
|
||||
if logger.getEffectiveLevel() > logging.DEBUG:
|
||||
PDF_OPTIONS['quiet'] = ""
|
||||
PDF_OPTIONS['title'] = config.get('title', 'Output')
|
||||
PDF_OPTIONS['replace'] = [(key, str(value)) for key, value in config['context'].items()]
|
||||
|
||||
|
|
Reference in a new issue