Skip to content

Commit

Permalink
Add a warning about latest documentation compatibility
Browse files Browse the repository at this point in the history
Not everything in the `latest` branch applies to Godot 3.2.x.
Read the Docs adds a warning notice for old versions automatically,
but it doesn't offer an option to do so for the `latest`/unstable
branch so we have to add it ourselves.
  • Loading branch information
Calinou committed Sep 21, 2020
1 parent 5a5fb6c commit 419cf72
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,21 @@ def godot_get_image_filename_for_language(filename, env):

sphinx.util.i18n.get_image_filename_for_language = godot_get_image_filename_for_language

# Read the Docs adds a note at the top of the page when reading documentation
# for an old stable version, but not when reading the latest unstable version.
# We want to add a warning note as the `latest` documentation may not always
# apply to Godot 3.2.x.
rst_prolog = """
.. attention::
You are reading the ``latest`` (unstable) version of this documentation,
which may document features not available or compatible with Godot 3.2.x.
See `this page <https://docs.godotengine.org/{locale}/stable/>`__
for the stable version of this documentation.
""".format(
locale=language,
)

# Couldn't find a way to retrieve variables nor do advanced string
# concat from reST, so had to hardcode this in the "epilog" added to
# all pages. This is used in index.rst to display the Weblate badge.
Expand Down

0 comments on commit 419cf72

Please sign in to comment.