开发者

How can I add a custom footer to Sphinx documentation?

If I have some documentation, like for example Galleria's documentation, how can I set it up so that when I run the make html command it开发者_运维问答 will add a custom footer to each page?

I saw that I could potentially use the LaTeX preamble section of conf.py if I was outputting it to a PDF format.


You have to extend the default layout by providing an html file like this:

{% extends '!layout.html' %}

{% block footer %}
        <!-- your html code here -->
{% endblock %}

Save this in a _templates/ subdirectory as layout.html and make sure to tell conf.py where to find this directory:

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

More information on templating can be found here: https://www.sphinx-doc.org/en/master/templating.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜