From a9038e9315643ba760109dc7988d2b8bbc973fcc Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 17 May 2017 21:25:06 +0100 Subject: [PATCH] Better log output --- md_pdf/build/templates.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/md_pdf/build/templates.py b/md_pdf/build/templates.py index eca1a29..3c8c4ef 100644 --- a/md_pdf/build/templates.py +++ b/md_pdf/build/templates.py @@ -15,7 +15,7 @@ TEMPLATE_FORMAT = os.path.join(TEMPLATES_DIR, "{}-template.html") def render_page(input_file, output_file, context): - logger.debug("Rendering {}...") + logger.debug("Rendering {}...".format(os.path.splitext(os.path.basename(output_file))[0].title())) with open(input_file) as f: template = Template(f.read()) with open(output_file, "w") as f: @@ -34,4 +34,5 @@ def render_templates(config): 'footer' ]: render_page(TEMPLATE_FORMAT.format(template), FILE_NAME_FORMAT.format(template), context) - render_page(os.path.join(TEMPLATES_DIR, 'toc-template.xsl'), os.path.join(TEMPLATES_DIR, 'toc.xsl'), context) + if config.get('toc', False): + render_page(os.path.join(TEMPLATES_DIR, 'toc-template.xsl'), os.path.join(TEMPLATES_DIR, 'toc.xsl'), context)