From: Kefu Chai Date: Mon, 10 May 2021 03:43:41 +0000 (+0800) Subject: doc/_ext: do not require "mgr_module" at end of document X-Git-Tag: v17.1.0~1986^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f948b5acf772d263fe032dfe2222fa20e57e2bd5;p=ceph.git 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 --- diff --git a/doc/_ext/ceph_confval.py b/doc/_ext/ceph_confval.py index d824f384ef99..44ef0bbf3faa 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',