Sphinx - rst2pdf:是否可以在 conf.py 文件中指定文档页脚?

Sphinx - rst2pdf: is it possible to specify the document footer in the conf.py file?

我从 The Rst2pdf Handbook 了解到,当您独立使用 rst2pdf 时,您可以在其配置文件中指定默认页脚。通过 Sphinx 使用它时是否可以做类似的事情,例如通过将所需的页脚指定为 pdf_footerconf.py 文件中的类似条目?我确实在我的一个项目中尝试过 pdf_footer,但没有成功。

是的。它需要了解如何使用 Jinja2 templating. There is a block footer 在您可以修改的每个主题的 layout.html 中自定义主题。

自定义主题时,不要直接修改主题,而是在Jinja/Sphinx Templating Primer中提到"files with the same name as the original filename into the template directory of the structure the Sphinx quickstart generated for you"。