From 1eebceccc330d3708e55d112a8a884bffbd1df0c Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Mon, 8 Apr 2024 00:47:06 -0500 Subject: [PATCH] Fix :cfg:prop: and :cmake:prop: being confused This was data accidentally shared between the custom Sphinx domains. --- docs/devguide/run_time_configuration.rst | 2 ++ docs/sphinx_extensions/config_domain.py | 10 ++++++++-- docs/sphinx_extensions/custom_domain.py | 19 ++++++++++--------- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/docs/devguide/run_time_configuration.rst b/docs/devguide/run_time_configuration.rst index 882ebf8bdcb..65f358d36d8 100644 --- a/docs/devguide/run_time_configuration.rst +++ b/docs/devguide/run_time_configuration.rst @@ -25,6 +25,8 @@ OpenDDS configuration is concerned with three main areas: Each pluggable transport can be configured separately. See :ref:`config-transport` for details. +.. _config-store-keys: + ********************** Configuration Approach ********************** diff --git a/docs/sphinx_extensions/config_domain.py b/docs/sphinx_extensions/config_domain.py index 6728b076426..a405df42132 100644 --- a/docs/sphinx_extensions/config_domain.py +++ b/docs/sphinx_extensions/config_domain.py @@ -224,8 +224,14 @@ def transform_content(self, contentnode: addnodes.desc_content) -> None: rst = ViewList() # Config store key - key = key_canonicalize(ctx.get(-2, 'sec_name'), ctx.get(-2, 'arguments'), ctx.get_name()) - rst.append(f'| **Config store key**: ``{key}``', f'{__name__}', 1) + try: + key = key_canonicalize( + ctx.get(-2, 'sec_name'), ctx.get(-2, 'arguments'), ctx.get_name()) + rst.append(f'| :ref:`Config store key `: ``{key}``', + f'{__name__}', 1) + except Exception as e: + e = ValueError(f'Something went wrong with key_canonicalize: {e}') + ConfigDomain.logger.warning(e, location=self.get_location()) # :required: flag required = 'required' in self.options diff --git a/docs/sphinx_extensions/custom_domain.py b/docs/sphinx_extensions/custom_domain.py index 6d6147a2647..2c7d4100597 100644 --- a/docs/sphinx_extensions/custom_domain.py +++ b/docs/sphinx_extensions/custom_domain.py @@ -187,15 +187,16 @@ class CustomDomain(Domain): label = None logger = None - object_types = { - } - directives = { - } - roles = { - } - initial_data: dict[str, dict[tuple[str, str], str]] = { - 'objects': {}, # fullname -> docname, objtype - } + def __init_subclass__(cls): + cls.object_types = { + } + cls.directives = { + } + cls.roles = { + } + cls.initial_data = { + 'objects': {}, # fullname -> docname, objtype + } @property def objects(self) -> dict[tuple[str, str], tuple[str, str]]: