diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-10-05 18:48:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-05 18:48:37 +0300 |
commit | ca87e47b7dbdcf2991cf9c396db548ae668cac31 (patch) | |
tree | b22e0683a7e749f1e54bc97f7c8900f65f49467c /sphinx/application.py | |
parent | dd7c50f366035dbec138d3922296109e79bffa03 (diff) | |
parent | 129e09c6e3c591e1376c164672220ced3f3cee12 (diff) |
Merge pull request #8280 from tk0miya/refactor_add_source_parser
refactor: Change signature of app.add_source_parser()
Diffstat (limited to 'sphinx/application.py')
-rw-r--r-- | sphinx/application.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sphinx/application.py b/sphinx/application.py index daab09058..4a3db25e7 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -22,6 +22,7 @@ from typing import Any, Callable, Dict, IO, List, Optional, Tuple, Union from docutils import nodes from docutils.nodes import Element, TextElement +from docutils.parsers import Parser from docutils.parsers.rst import Directive, roles from docutils.transforms import Transform from pygments.lexer import Lexer @@ -1118,7 +1119,7 @@ class Sphinx: """ self.registry.add_source_suffix(suffix, filetype, override=override) - def add_source_parser(self, *args: Any, **kwargs: Any) -> None: + def add_source_parser(self, parser: "Type[Parser]", override: bool = False) -> None: """Register a parser class. If *override* is True, the given *parser* is forcedly installed even if @@ -1131,7 +1132,7 @@ class Sphinx: .. versionchanged:: 1.8 Add *override* keyword. """ - self.registry.add_source_parser(*args, **kwargs) + self.registry.add_source_parser(parser, override=override) def add_env_collector(self, collector: "Type[EnvironmentCollector]") -> None: """Register an environment collector class. |