Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0fe8e1e

Browse files
authored
Merge pull request #11088 from matplotlib/auto-backport-of-pr-10211
Backport PR #10211 on branch v2.2.2-doc
2 parents 7e6922d + 48db85e commit 0fe8e1e

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)