doc: Show banner for prereleases
This commit is contained in:
7
docs/_static/custom.css
vendored
7
docs/_static/custom.css
vendored
@@ -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,
|
||||
|
||||
8
docs/_templates/sidebar-top.html
vendored
8
docs/_templates/sidebar-top.html
vendored
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user