diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-01-01 17:33:34 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-01-01 20:06:34 +0300 |
commit | c5f03980107e123210fb602f4c31f5ae950e2af4 (patch) | |
tree | 49ac5014a6eca178eadffe63a6f3b396cad3259e /sphinx/registry.py | |
parent | 7ecf6b88aa5ddaed552527d2ef60f1bd35e98ddc (diff) |
Close #8634: html: Allow to change the order of JS/CSS
`Sphinx.add_js_file()` and `Sphinx.add_css_file()` take `priority`
argument to change the order of JS/CSS files.
Diffstat (limited to 'sphinx/registry.py')
-rw-r--r-- | sphinx/registry.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sphinx/registry.py b/sphinx/registry.py index 8a988cb98..c6a249e74 100644 --- a/sphinx/registry.py +++ b/sphinx/registry.py @@ -63,7 +63,7 @@ class SphinxComponentRegistry: self.documenters = {} # type: Dict[str, Type[Documenter]] #: css_files; a list of tuple of filename and attributes - self.css_files = [] # type: List[Tuple[str, Dict[str, str]]] + self.css_files = [] # type: List[Tuple[str, Dict[str, Any]]] #: domains; a dict of domain name -> domain class self.domains = {} # type: Dict[str, Type[Domain]] @@ -94,7 +94,7 @@ class SphinxComponentRegistry: self.html_block_math_renderers = {} # type: Dict[str, Tuple[Callable, Callable]] #: js_files; list of JS paths or URLs - self.js_files = [] # type: List[Tuple[str, Dict[str, str]]] + self.js_files = [] # type: List[Tuple[str, Dict[str, Any]]] #: LaTeX packages; list of package names and its options self.latex_packages = [] # type: List[Tuple[str, str]] @@ -361,10 +361,10 @@ class SphinxComponentRegistry: attrgetter: Callable[[Any, str, Any], Any]) -> None: self.autodoc_attrgettrs[typ] = attrgetter - def add_css_files(self, filename: str, **attributes: str) -> None: + def add_css_files(self, filename: str, **attributes: Any) -> None: self.css_files.append((filename, attributes)) - def add_js_file(self, filename: str, **attributes: str) -> None: + def add_js_file(self, filename: str, **attributes: Any) -> None: logger.debug('[app] adding js_file: %r, %r', filename, attributes) self.js_files.append((filename, attributes)) |