From c1d6fc0f5dd0edc2e5b0d62a2f7113bb1a176d72 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 10 May 2021 11:40:11 +0800 Subject: [PATCH] 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 --- doc/_ext/ceph_confval.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/_ext/ceph_confval.py b/doc/_ext/ceph_confval.py index 8883f4f5d9b..3d02559c190 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: -- 2.39.5