summaryrefslogtreecommitdiff
path: root/sphinx/application.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-01-08 01:11:17 +0900
committerGitHub <noreply@github.com>2021-01-08 01:11:17 +0900
commitca9342cc440bd3842dff26841d146beaf7b8c4b3 (patch)
tree286bfd6736d7971eaa9a51f7b07cad2dee34417c /sphinx/application.py
parent2d53b7cd6638a579fea23186762b1a561dadeb14 (diff)
parentaf4e615a8a25c15df844cf51a2eb2647111bd472 (diff)
downloadsphinx-git-ca9342cc440bd3842dff26841d146beaf7b8c4b3.tar.gz
Merge pull request #8631 from tk0miya/6241_assets_for_specific_page
Close #6241: html: Allow to add JS/CSS files to the specific page
Diffstat (limited to 'sphinx/application.py')
-rw-r--r--sphinx/application.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/sphinx/application.py b/sphinx/application.py
index 2252705c0..54a2603aa 100644
--- a/sphinx/application.py
+++ b/sphinx/application.py
@@ -958,6 +958,9 @@ class Sphinx:
* - 800
- default priority for :confval:`html_js_files`
+ A JavaScript file can be added to the specific HTML page when on extension
+ calls this method on :event:`html-page-context` event.
+
.. versionadded:: 0.5
.. versionchanged:: 1.8
@@ -965,7 +968,7 @@ class Sphinx:
And it allows keyword arguments as attributes of script tag.
.. versionchanged:: 3.5
- Take priority argument.
+ Take priority argument. Allow to add a JavaScript file to the specific page.
"""
self.registry.add_js_file(filename, priority=priority, **kwargs)
if hasattr(self.builder, 'add_js_file'):
@@ -1004,6 +1007,9 @@ class Sphinx:
* - 800
- default priority for :confval:`html_css_files`
+ A CSS file can be added to the specific HTML page when on extension calls
+ this method on :event:`html-page-context` event.
+
.. versionadded:: 1.0
.. versionchanged:: 1.6
@@ -1018,7 +1024,7 @@ class Sphinx:
And it allows keyword arguments as attributes of link tag.
.. versionchanged:: 3.5
- Take priority argument.
+ Take priority argument. Allow to add a CSS file to the specific page.
"""
logger.debug('[app] adding stylesheet: %r', filename)
self.registry.add_css_files(filename, priority=priority, **kwargs)