useblocks / sphinx-simplepdf

A simple PDF builder for Sphinx documentations
https://sphinx-simplepdf.readthedocs.io
MIT License
32 stars 14 forks source link

Unable to modify 'Table of Contents' text in PDF #78

Open sachin-suresh-rapyuta opened 1 year ago

sachin-suresh-rapyuta commented 1 year ago

I am trying all workarounds to modify the 'Table of Contents' text. But seems like a bug in extension, that is preventing the setting from being respected.

Following are some workarounds:

Try 1: Dint work

# conf.py

# Set the title of the table of contents for SimplePDF output
simplepdf_toc_title = 'My Custom TOC Title'

Try 2: Specifyied the simplepdf_toc_title setting in your command line argument - Dint work

sphinx-build -b simplepdf -D simplepdf_toc_title="My Custom TOC Title" . _build/simplepdf

Try 3: Using new file called simplepdf_toc.html -- Dint work

  1. In _templates folder, create a new simplepdf_toc.html and added the following content to the file:

    <div class="contents">
    <h1>My Custom TOC Title</h1>
    {{ toc }}
    </div>
  2. In conf:

# conf.py

# Override the SimplePDF table of contents template
simplepdf_toc_template = 'simplepdf_toc.html'

Also, what is the variable in simplepdf for modifying the toctree caption?