From 5c644266170a34d9ae6f850cdebae5797197db4b Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Sun, 26 Jan 2025 14:13:57 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Remove=20back=20link=20man?= =?UTF-8?q?ipulation=20from=20`needextend`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Back links are computed at the end of the need post-processing, after `needextend` have been applied. Back links should always be in-sync with forward links, therefore it doesn't make sense to modify back links in this way. Thankfully, the current availability of back link options in `needextend` directives is not documented, and so are unlikely to have been actually used. --- sphinx_needs/needs.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/sphinx_needs/needs.py b/sphinx_needs/needs.py index 0306eb597..17a8cc7a5 100644 --- a/sphinx_needs/needs.py +++ b/sphinx_needs/needs.py @@ -499,21 +499,9 @@ def load_config(app: Sphinx, *_args: Any) -> None: key: value, f"+{key}": value, f"-{key}": directives.flag, - f"{key}_back": value, - f"+{key}_back": value, - f"-{key}_back": directives.flag, } ) - # "links" is not part of the extra_links-dict, so we need - # to set the links_back values by hand - NeedextendDirective.option_spec.update( - { - "links_back": NEED_DEFAULT_OPTIONS["links"], - "+links_back": NEED_DEFAULT_OPTIONS["links"], - "-links_back": directives.flag, - } - ) for key, value in _NEEDS_CONFIG.extra_options.items(): NeedextendDirective.option_spec.update( {