Skip to content

Commit

Permalink
drop confluence_link_transform
Browse files Browse the repository at this point in the history
This capability is no longer supported due to it never being used (by
both users and development). Removing it to help cleanup this extension.

Signed-off-by: James Knight <james.d.knight@live.com>
  • Loading branch information
jdknight committed Jul 14, 2024
1 parent bfc742a commit 220f880
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 38 deletions.
9 changes: 0 additions & 9 deletions doc/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2163,15 +2163,6 @@ Deprecated options

This option has been replaced by |confluence_lang_overrides|_.

.. confval:: confluence_link_transform

.. versionchanged:: 2.6

A function to override the translation of a document name to a (partial)
URI. The provided function is used to perform translations for both Sphinx's
get_relative_uri_ method. The default translation will be the combination of
"``docname`` + |confluence_link_suffix|_".

.. confval:: confluence_master_homepage

.. versionchanged:: 1.6
Expand Down
2 changes: 0 additions & 2 deletions sphinxcontrib/confluencebuilder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,6 @@ def setup(app):
cm.add_conf('confluence_latex_macro', 'confluence')
# Link suffix for generated files.
cm.add_conf('confluence_link_suffix', 'confluence')
# Translation of docname to a (partial) URI.
cm.add_conf('confluence_link_transform', 'confluence')
# Mappings for documentation mentions to Confluence keys.
cm.add_conf('confluence_mentions', 'confluence')
# Inject navigational hints into the documentation.
Expand Down
5 changes: 1 addition & 4 deletions sphinxcontrib/confluencebuilder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,7 @@ def link_transform(docname):
return docname + self.link_suffix

self.file_transform = file_transform
if self.config.confluence_link_transform is not None:
self.link_transform = self.config.confluence_link_transform
else:
self.link_transform = link_transform
self.link_transform = link_transform

if self.config.confluence_lang_overrides is not None:
if isinstance(self.config.confluence_lang_overrides, dict):
Expand Down
6 changes: 0 additions & 6 deletions sphinxcontrib/confluencebuilder/config/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,6 @@ def validate_configuration(builder):

# ##################################################################

# confluence_link_transform
validator.conf('confluence_link_transform') \
.callable_()

# ##################################################################

# confluence_mentions
validator.conf('confluence_mentions') \
.dict_str_str()
Expand Down
2 changes: 0 additions & 2 deletions sphinxcontrib/confluencebuilder/config/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
'to be removed in a future version',
'confluence_adv_writer_no_section_cap':
'to be removed in a future version',
'confluence_link_transform':
'capability to be dropped (please report if required)',
'confluence_master_homepage':
'use "confluence_root_homepage" instead',
'confluence_max_doc_depth':
Expand Down
15 changes: 0 additions & 15 deletions tests/unit-tests/test_config_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,21 +550,6 @@ def test_config_check_link_suffix(self):
self.config['confluence_link_suffix'] = '.conf'
self._try_config()

def test_config_check_link_transform(self):
self.config['suppress_warnings'] = [
'confluence.deprecated',
]

def mock_transform(docname):
return docname + '.conf'

self.config['confluence_link_transform'] = mock_transform
self._try_config()

self.config['confluence_link_transform'] = 'invalid'
with self.assertRaises(ConfluenceConfigError):
self._try_config()

def test_config_check_mentions(self):
self.config['confluence_mentions'] = {}
self._try_config()
Expand Down

0 comments on commit 220f880

Please sign in to comment.