From: Kefu Chai Date: Sat, 17 Apr 2021 16:39:41 +0000 (+0800) Subject: doc/_ext: render see_also field X-Git-Tag: v17.1.0~2202^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d1c6182fa2e288faaf1f7c0421fdae9a19e57d8d;p=ceph-ci.git doc/_ext: render see_also field Signed-off-by: Kefu Chai --- diff --git a/doc/_ext/ceph_confval.py b/doc/_ext/ceph_confval.py index 88995423064..89aa6a22f73 100644 --- a/doc/_ext/ceph_confval.py +++ b/doc/_ext/ceph_confval.py @@ -50,6 +50,9 @@ TEMPLATE = ''' {%- elif opt.max is defined %} :max: ``{{ opt.max }}`` {%- endif %} +{%- if opt.see_also %} + :see also: {{ opt.see_also | map('ref_confval') | join(', ') }} +{%- endif %} {% if opt.note %} .. note:: {{ opt.note }} @@ -128,12 +131,17 @@ def literal(name) -> str: return f'' +def ref_confval(name) -> str: + return f':confval:`{name}`' + + def jinja_template() -> jinja2.Template: env = jinja2.Environment() env.filters['eval_size'] = eval_size env.filters['readable_duration'] = readable_duration env.filters['readable_num'] = readable_num env.filters['literal'] = literal + env.filters['ref_confval'] = ref_confval return env.from_string(TEMPLATE)