I have inherited a user guide that is built using reStructuredText and Sphinx, from which we want to (and can) produce a PDF using rst2pdf integration with Sphinx. The one thing that we'd like to do is apply custom headers and footers to each page of the document (a'la "Draft - Not for Release" or "Version x.y.z"), but there isn't an obvious (to me) way to do this. The rst2pdf command supports specifying --footer="..."
and --header="..."
, but there doesn't seem to be an analogous option in the PDF configuration directives that one can specify in the Sphinx conf.py
. Although RST does support header and foot directives, the Sphinx documentation explicitly warns against using them.
I think it might be possible to set this up using rst2pdf stylesheets, but I'm also having a bit of a time understanding how custom stylesheets interact with / extend / override existing stylesheets (if at all).
So what I am looking for is some guidance on how to get headers and footers added to each page cleanly using rst2pdf and Sphinx.