From f948b5acf772d263fe032dfe2222fa20e57e2bd5 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 10 May 2021 11:43:41 +0800 Subject: [PATCH] doc/_ext: do not require "mgr_module" at end of document before this change, .. mgr_module:: None is required at end of a mgr module document to reset the context, so the builder env is not polluted when processing the next document. after this change, this ending directive is not needed anymore. Signed-off-by: Kefu Chai --- doc/_ext/ceph_confval.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/_ext/ceph_confval.py b/doc/_ext/ceph_confval.py index d824f384ef99b..44ef0bbf3faa6 100644 --- a/doc/_ext/ceph_confval.py +++ b/doc/_ext/ceph_confval.py @@ -398,6 +398,10 @@ class CephOption(ObjectDescription): std.note_object(self.objtype, name, node_id, location=signode) +def _reset_ref_context(app, env, docname): + env.ref_context.pop('ceph:module', None) + + def setup(app) -> Dict[str, Any]: app.add_config_value('ceph_confval_imports', default=[], @@ -430,6 +434,7 @@ def setup(app) -> Dict[str, Any]: ) app.add_directive_to_domain('std', 'mgr_module', CephModule) app.add_directive_to_domain('std', 'confval', CephOption, override=True) + app.connect('env-purge-doc', _reset_ref_context) return { 'version': 'builtin', -- 2.39.5