diff --git a/doc/_templates/layout.html b/doc/_templates/layout.html new file mode 100644 index 00000000..12022e98 --- /dev/null +++ b/doc/_templates/layout.html @@ -0,0 +1,26 @@ +{% extends "!layout.html" -%} +{# Refer to https://github.com/readthedocs/sphinx_rtd_theme/blob/master/sphinx_rtd_theme/layout.html #} + +{%- block document %} +{# + Adds a warning message on the 'latest' version. + The warning is only added on readthedocs, if the version is 'latest'. + For the 'dev' folder, no warning is shown since the 'latest' version is + usually the most up-to-date. +#} +{% if READTHEDOCS and polybar_is_latest and not pagename.startswith('dev/') %} +
+

Development Version

+

+ This is the latest + (unstable) version of this documentation, which may document features + not available in or compatible with released stable versions of polybar. +

+

+ See the stable version of this documentation page instead. +

+
+{% endif %} + +{{ super() }} +{%- endblock %} diff --git a/doc/conf.py b/doc/conf.py index b780f82d..a82c0e03 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -149,6 +149,10 @@ extlinks_detect_hardcoded_links = True # html_theme_options = {} +html_context = { + 'polybar_is_latest': version == 'latest', +} + # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. #