From 479c1755a9030f816fb4d57ecb6c8e330e3ea44c Mon Sep 17 00:00:00 2001 From: Kodi Arfer Date: Tue, 23 May 2017 11:29:48 -0700 Subject: [PATCH] Show a version number at the top of each docs page --- docs/_templates/breadcrumbs.html | 5 +++++ docs/conf.py | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 docs/_templates/breadcrumbs.html diff --git a/docs/_templates/breadcrumbs.html b/docs/_templates/breadcrumbs.html new file mode 100644 index 0000000..0c05fea --- /dev/null +++ b/docs/_templates/breadcrumbs.html @@ -0,0 +1,5 @@ +{% extends "!breadcrumbs.html" %} +{% block breadcrumbs_aside %} +
  • Hy version {{ hy_descriptive_version }}
  • + {{ super() }} +{% endblock %} diff --git a/docs/conf.py b/docs/conf.py index 9ba78f6..3a9c66c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -2,7 +2,7 @@ # # This file is execfile()d with the current directory set to its containing dir. -import os, sys, time +import os, sys, time, cgi sys.path.append(os.path.abspath("..")) from get_version import __version__ as hy_version @@ -27,6 +27,9 @@ copyright = u'%s the authors' % time.strftime('%Y') version = ".".join(hy_version.split(".")[:-1]) # The full version, including alpha/beta/rc tags. release = hy_version +hy_descriptive_version = cgi.escape(hy_version) +if "+" in hy_version: + hy_descriptive_version += " (unstable)" exclude_patterns = ['_build', 'coreteam.rst'] @@ -43,3 +46,6 @@ html_static_path = ['_static'] html_use_smartypants = False html_show_sphinx = False + +html_context = dict( + hy_descriptive_version = hy_descriptive_version)