Fix #6550: Emit a deprecation warning for html_add_permalinks

Let's start to emit a deprecation warning for html_add_permalinks since
the major release v4.0.
This commit is contained in:
Takeshi KOMIYA
2021-01-24 14:34:29 +09:00
parent 502c4ee5fb
commit 90ced6c4b7

View File

@@ -1210,6 +1210,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