Context
I am using Sphinx to create technical documentation (not code-related). The input are several reStructuredText and SVG files. The output is created using the singlehtml
builder (which is converted to PDF using weasyprint in a later step).
Problem
I would like to include a table of contents (TOC) in the final document. The default location for the TOC (sidebar) is not an option. I have to disable/hide the sidebar to generate a useful PDF.
Solutions (I have considered / tried)
toctree
directive: Seems to only work with the sidebar, no matter what I try.- HTML Theming: I'm using it for styling the HTML output, but I would not know how to address the TOC issue.
- Sphinx extensions: I wrote my own, but it's not very flexible and I'm still sure that others have already solved this problem.
- Use
latexpdf
builder: Tried that and it solves the TOC problem, but it creates a few other problems and styling the document is so much easier for me using CSS. - Other tool than Sphinx: Is this a typical case of an XY problem? I would like to use reStructuredText and SVGs to generate a PDF, but I would be open to use something else than Sphinx.