mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #6093 from tk0miya/6088_better_warning_for_script_files
Update warning messages for script_files
This commit is contained in:
commit
35f4edb8fc
@ -109,24 +109,24 @@ class JSContainer(list):
|
|||||||
"""The container for JavaScript scripts."""
|
"""The container for JavaScript scripts."""
|
||||||
def insert(self, index, obj):
|
def insert(self, index, obj):
|
||||||
# type: (int, str) -> None
|
# type: (int, str) -> None
|
||||||
warnings.warn('builder.script_files is deprecated. '
|
warnings.warn('To modify script_files in the theme is deprecated. '
|
||||||
'Please use app.add_js_file() instead.',
|
'Please insert a <script> tag directly in your theme instead.',
|
||||||
RemovedInSphinx30Warning, stacklevel=2)
|
RemovedInSphinx30Warning, stacklevel=3)
|
||||||
super().insert(index, obj)
|
super().insert(index, obj)
|
||||||
|
|
||||||
def extend(self, other): # type: ignore
|
def extend(self, other): # type: ignore
|
||||||
# type: (List[str]) -> None
|
# type: (List[str]) -> None
|
||||||
warnings.warn('builder.script_files is deprecated. '
|
warnings.warn('To modify script_files in the theme is deprecated. '
|
||||||
'Please use app.add_js_file() instead.',
|
'Please insert a <script> tag directly in your theme instead.',
|
||||||
RemovedInSphinx30Warning, stacklevel=2)
|
RemovedInSphinx30Warning, stacklevel=3)
|
||||||
for item in other:
|
for item in other:
|
||||||
self.append(item)
|
self.append(item)
|
||||||
|
|
||||||
def __iadd__(self, other): # type: ignore
|
def __iadd__(self, other): # type: ignore
|
||||||
# type: (List[str]) -> JSContainer
|
# type: (List[str]) -> JSContainer
|
||||||
warnings.warn('builder.script_files is deprecated. '
|
warnings.warn('To modify script_files in the theme is deprecated. '
|
||||||
'Please use app.add_js_file() instead.',
|
'Please insert a <script> tag directly in your theme instead.',
|
||||||
RemovedInSphinx30Warning, stacklevel=2)
|
RemovedInSphinx30Warning, stacklevel=3)
|
||||||
for item in other:
|
for item in other:
|
||||||
self.append(item)
|
self.append(item)
|
||||||
return self
|
return self
|
||||||
|
Loading…
Reference in New Issue
Block a user