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)