diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-03-13 17:10:50 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-03-13 17:15:12 +0900 |
commit | a523a896635b5fc5e48cd12a7c034ebcbc71a43b (patch) | |
tree | 3b8a6d41d3de3cdd2392ed2efa02b5e2f8ed7dec /sphinx/directives/patches.py | |
parent | c817c206265f545529b5fabe43fdf162bbc9bea2 (diff) | |
download | sphinx-git-a523a896635b5fc5e48cd12a7c034ebcbc71a43b.tar.gz |
refactor: Add a type alias for the option_spec of directives; OptionSpec
Diffstat (limited to 'sphinx/directives/patches.py')
-rw-r--r-- | sphinx/directives/patches.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sphinx/directives/patches.py b/sphinx/directives/patches.py index 1c3cfd853..b4c978474 100644 --- a/sphinx/directives/patches.py +++ b/sphinx/directives/patches.py @@ -25,6 +25,7 @@ from sphinx.util import logging from sphinx.util.docutils import SphinxDirective from sphinx.util.nodes import set_source_info from sphinx.util.osutil import SEP, os_path, relpath +from sphinx.util.typing import OptionSpec if TYPE_CHECKING: from sphinx.application import Sphinx @@ -140,7 +141,7 @@ class Code(SphinxDirective): This is compatible with docutils' :rst:dir:`code` directive. """ optional_arguments = 1 - option_spec = { + option_spec: OptionSpec = { 'class': directives.class_option, 'force': directives.flag, 'name': directives.unchanged, @@ -184,7 +185,7 @@ class MathDirective(SphinxDirective): required_arguments = 0 optional_arguments = 1 final_argument_whitespace = True - option_spec = { + option_spec: OptionSpec = { 'label': directives.unchanged, 'name': directives.unchanged, 'class': directives.class_option, |