From: Kefu Chai Date: Tue, 1 Dec 2020 06:49:56 +0000 (+0800) Subject: doc/conf: find the latest stable release in releases.yml X-Git-Tag: v16.1.0~427^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=94488f911a4977ae003ff33f58d8266e4fe80d6a;p=ceph.git doc/conf: find the latest stable release in releases.yml instead of hardwiring the "|stable-release|" to "octopus" use the latest release name found in 'doc/releases/releases.yml' Signed-off-by: Kefu Chai --- diff --git a/doc/conf.py b/doc/conf.py index 9fb5479ba01d..ea5c9f24735d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -23,6 +23,13 @@ def parse_ceph_release(): return version, codename, status +def latest_stable_release(): + with open(os.path.join(top_level, 'doc/releases/releases.yml')) as input: + releases = yaml.safe_load(input)['releases'] + # get the first release + return next(iter(releases.keys())) + + # project information project = 'Ceph' copyright = ('2016, Ceph authors and contributors. ' @@ -114,9 +121,8 @@ if build_with_rtd: todo_include_todos = True # sphinx_substitution_extensions options -# TODO: read from doc/releases/releases.yml -rst_prolog = """ -.. |stable-release| replace:: octopus +rst_prolog = f""" +.. |stable-release| replace:: {latest_stable_release()} """ # breath options