From: Kefu Chai Date: Mon, 10 May 2021 03:40:11 +0000 (+0800) Subject: doc/_ext: add "module" option to confval X-Git-Tag: v17.1.0~1986^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c1d6fc0f5dd0edc2e5b0d62a2f7113bb1a176d72;p=ceph.git doc/_ext: add "module" option to confval in addition to "mgr_module" directive, add the "module" option to confval. this allows a certain option to specify its own module without being nested in a "mgr_module" directive pair. Signed-off-by: Kefu Chai --- diff --git a/doc/_ext/ceph_confval.py b/doc/_ext/ceph_confval.py index 8883f4f5d9be..3d02559c1904 100644 --- a/doc/_ext/ceph_confval.py +++ b/doc/_ext/ceph_confval.py @@ -199,7 +199,10 @@ class CephOption(ObjectDescription): required_arguments = 1 optional_arguments = 0 final_argument_whitespace = False - option_spec = {'default': directives.unchanged} + option_spec = { + 'module': directives.unchanged, + 'default': directives.unchanged + } doc_field_types = [ @@ -372,7 +375,8 @@ class CephOption(ObjectDescription): signode += addnodes.desc_name(sig, sig) # normalize whitespace like XRefRole does name = ws_re.sub(' ', sig) - cur_module = self.env.ref_context.get('ceph:module') + cur_module = self.options.get('module', + self.env.ref_context.get('ceph:module')) if cur_module: return '/'.join(['mgr', cur_module, name]) else: