diff --git a/md_pdf/assets/templates/toc.xsl b/md_pdf/assets/templates/toc.xsl new file mode 100644 index 0000000..20b6cc2 --- /dev/null +++ b/md_pdf/assets/templates/toc.xsl @@ -0,0 +1,61 @@ + + + + + + + Table of Contents + + + + +

Table of Contents

+
+ + +
+ +
  • + + + +
      + added to prevent self-closing tags in QtXmlPatterns + +
    +
  • +
    +
    diff --git a/md_pdf/build/pdf.py b/md_pdf/build/pdf.py index 12d7352..b84409d 100644 --- a/md_pdf/build/pdf.py +++ b/md_pdf/build/pdf.py @@ -14,6 +14,12 @@ DEFAULT_MARGIN_HORIZONTAL = '2.5cm' 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') +TOC_TEMPLATE_FILE = os.path.join(TEMPLATES_DIR, 'toc.xsl') + +TOC_OPTIONS = { + 'xsl-style-sheet': TOC_TEMPLATE_FILE +} + PDF_OPTIONS = { "no-pdf-compression": "", "enable-internal-links": "",