Merge pull request #8748 from tk0miya/6550_deprecation_warning_for_html_add_permalinks

Fix #6550: Emit a deprecation warning for html_add_permalinks
This commit is contained in:
Takeshi KOMIYA 2021-01-25 20:34:09 +09:00 committed by GitHub
commit eaa14bb0b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1234,6 +1234,9 @@ def validate_html_favicon(app: Sphinx, config: Config) -> None:
def migrate_html_add_permalinks(app: Sphinx, config: Config) -> None:
"""Migrate html_add_permalinks to html_permalinks*."""
if config.html_add_permalinks:
# RemovedInSphinx60Warning
logger.warning(__('html_add_permalinks has been deprecated since v3.5.0. '
'Please use html_permalinks and html_permalinks_icon instead.'))
if (isinstance(config.html_add_permalinks, bool) and
config.html_add_permalinks is False):
config.html_permalinks = False # type: ignore