-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extensions: deprecate hawkmoth.ext.transformations and hawkmoth.util.…
…doccompat The introduction of the cautodoc_transformations config option was a mistake to begin with. The right way forward is the hawkmoth-process-docstring event. The hawkmoth.ext.transformations extension was introduced as a temporary solution to not immediately pull the plug on cautodoc_transformations. It's time to deprecate the cautodoc_transformations config, the hawkmoth.ext.transformations extension, and the hawkmoth.util.doccompat module. Everyone should move to either the hawkmoth.ext.javadoc or hawkmoth.ext.napoleon extensions, or if they're not enough, implement their own extensions through the hawkmoth-process-docstring event. The javadoc/doxygen helpers in doccompat are inferior to the hawkmoth.ext.javadoc extension, and the kernel-doc "support" is two regexes in a row. Functionally, the deprecation means 1) not loading hawkmoth.ext.transformations automatically, i.e. you have to manually add it to extensions in conf.py, and 2) deprecation messages on loading the extension and the module.
- Loading branch information
Showing
6 changed files
with
33 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# Copyright (c) 2023, Jani Nikula <[email protected]> | ||
# Licensed under the terms of BSD 2-Clause, see LICENSE for details. | ||
|
||
from sphinx.util import logging | ||
|
||
def _process_docstring(app, lines, transform, options): | ||
transformations = app.config.cautodoc_transformations | ||
tropt = options.get('transform') | ||
|
@@ -22,6 +24,9 @@ def _process_docstring(app, lines, transform, options): | |
lines[:] = comment.splitlines()[:] | ||
|
||
def setup(app): | ||
logger = logging.getLogger(__name__) | ||
logger.warning('hawkmoth.ext.transformations extension has been deprecated.') | ||
|
||
app.add_config_value('cautodoc_transformations', None, 'env', [dict]) | ||
|
||
# Run before event handlers with default priority. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters