8000 Backport PR #10211: Doc add sha to footer · matplotlib/matplotlib@48db85e · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 48db85e

Browse files
dstansbyMeeseeksDev[bot]
authored andcommitted
Backport PR #10211: Doc add sha to footer
1 parent 7e6922d commit 48db85e

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

doc/_templates/layout.html

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,13 +237,16 @@ <h3>{{ _('Navigation') }}</h3>
237237
endtrans %}
238238
{%- endif %}
239239
{%- endif %}
240+
<br />
240241
{%- if last_updated %}
241-
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated
242-
}}.{% endtrans %}
242+
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
243243
{%- endif %}
244244
{%- if show_sphinx %}
245-
{% trans sphinx_version=sphinx_version|e %}Created using <a
246-
href="http://sphinx-doc.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
245+
{% trans sphinx_version=sphinx_version|e %}Created using
246+
<ahref="http://sphinx-doc.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
247+
{%- endif %}
248+
{%- if sha %}
249+
Doc version {{ sha }}.
247250
{%- endif %}
248251
</div>
249252
{%- endblock %}

doc/conf.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,18 @@ def _check_deps():
152152
master_doc = 'contents'
153153

154154
# General substitutions.
155+
from matplotlib.compat.subprocess import check_output
156+
SHA = check_output(['git', 'describe', '--dirty']).decode('utf-8').strip()
157+
158+
html_context = {'sha': SHA}
159+
155160
project = 'Matplotlib'
156161
copyright = ('2002 - 2012 John Hunter, Darren Dale, Eric Firing, '
157162
'Michael Droettboom and the Matplotlib development '
158163
'team; 2012 - 2018 The Matplotlib development team')
159164

165+
166+
160167
# The default replacements for |version| and |release|, also used in various
161168
# other places throughout the built documents.
162169
#

0 commit comments

Comments
 (0)
0