From b2715d4a236c3aa8a24472427cccdd637a802fea Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Wed, 17 May 2017 14:46:11 +0100 Subject: [PATCH] Add basic TOC file --- md_pdf/assets/templates/toc.xsl | 61 +++++++++++++++++++++++++++++++++ md_pdf/build/pdf.py | 6 ++++ 2 files changed, 67 insertions(+) create mode 100644 md_pdf/assets/templates/toc.xsl 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": "",