It would be useful (for me at least) to know which version of Sphinx
generated an HTML file, when debugging differences between my own
output and someone else's that may be broken. (We have an auto-
documentation generator that I don't have access, so it would be nice
to know what version of Sphinx it is running without needing to bug
the guy that maintains that machine).
I've attached a patch for your consideration that will add the Sphinx
version to the HTML footer. If making this visible isn't preferred,
putting it in an HTML comment would still meet my needs.
Index: sphinx/templates/layout.html
===================================================================
--- sphinx/templates/layout.html (revision 65490)
+++ sphinx/templates/layout.html (working copy)
@@ -181,7 +181,8 @@
Last updated on {{ last_updated }}.
{%- endif %}
{%- if show_sphinx %}
- Created using <a href="
http://sphinx.pocoo.org/">Sphinx</a>.
+ Created using <a href="
http://sphinx.pocoo.org/">Sphinx</a>
+ {{ sphinx_version }}.
{%- endif %}
</div>
{%- endblock %}
Index: sphinx/builder.py
===================================================================
--- sphinx/builder.py (revision 65490)
+++ sphinx/builder.py (working copy)
@@ -34,6 +34,7 @@
from sphinx.environment import BuildEnvironment, NoUri
from sphinx.highlighting import PygmentsBridge
from sphinx.util.console import bold, purple, darkgreen
+from sphinx import __version__ as sphinx_version
# side effect: registers roles and directives
from sphinx import roles
@@ -385,12 +386,13 @@
docstitle = self.config.html_title,
shorttitle = self.config.html_short_title,
show_sphinx = self.config.html_show_sphinx,
- file_suffix = self.config.html_file_suffix,
+ file_suffix = self.out_suffix,
rellinks = rellinks,
builder =
self.name,
parents = [],
logo = logo,
- favicon = favicon
+ favicon = favicon,
+ sphinx_version = sphinx_version
)
def get_doc_context(self, docname, body):
Cheers,
Mike