doc: Show banner for prereleases

This commit is contained in:
Kurt Griffiths
2016-10-18 17:24:56 -06:00
parent 1ba7bb68f4
commit d6ca45dc66
3 changed files with 19 additions and 0 deletions

View File

@@ -30,6 +30,13 @@
/*margin: -4px -4px 0 0;*/
}
#dev-warning {
background: #ffe;
border: 1px solid #aaa;
padding: 10px;
margin-bottom: 1em;
}
div.body h1,
div.body h2,
div.body h3,

View File

@@ -1,6 +1,14 @@
<link href='http://fonts.googleapis.com/css?family=Amethysta:400' rel='stylesheet'>
<script async defer src="https://buttons.github.io/buttons.js"></script>
{% if prerelease %}
<script>
$(document).ready(function() {
$('div.body').prepend('<div id="dev-warning">Warning: This is the documentation for the development version of Falcon.</div>')
});
</script>
{% endif %}
<div id="logo">
<div id="logo-text"><a href="{{ pathto(master_doc) }}">Falcon</a></div>
<a href="{{ pathto(master_doc) }}"><img src="{{ pathto('_static/img/logo.png', 1) }}" width="163" height="211" alt="Falcon Web Framework Logo"/></a>

View File

@@ -77,6 +77,10 @@ cfg = configparser.SafeConfigParser()
cfg.read('../setup.cfg')
tag = cfg.get('egg_info', 'tag_build')
html_context = {
'prerelease': bool(tag), # True if tag is not the empty string
}
# The short X.Y version.
version = '.'.join(falcon.__version__.split('.')[0:2]) + tag