Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-01-07 19:23:17 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-01-07 19:23:17 +0300
commit5460ea103bd91ce910e50e11e05c1e5340c2a9e0 (patch)
tree2009eec87f4ef7442cd29158c000bd12be17b999 /sphinx/application.py
parent5ba5602d7173d0da7adfb4f1e6279ff40c56ef47 (diff)
parentd9569a84a28b4720f9adf69ef9778961585ea19a (diff)
Merge branch '3.x'
Diffstat (limited to 'sphinx/application.py')
-rw-r--r--sphinx/application.py24
1 files changed, 17 insertions, 7 deletions
diff --git a/sphinx/application.py b/sphinx/application.py
index 40098e92d..710d7701a 100644
--- a/sphinx/application.py
+++ b/sphinx/application.py
@@ -917,9 +917,11 @@ class Sphinx:
Add *filename* to the list of JavaScript files that the default HTML
template will include in order of *priority* (ascending). The filename
must be relative to the HTML static path , or a full URI with scheme.
- If the keyword argument ``body`` is given, its value will be added
- between the ``<script>`` tags. Extra keyword arguments are included as
- attributes of the ``<script>`` tag.
+ If the priority of JavaScript file is the same as others, the JavaScript
+ files will be included in order of the registration. If the keyword
+ argument ``body`` is given, its value will be added between the
+ ``<script>`` tags. Extra keyword arguments are included as attributes of
+ the ``<script>`` tag.
Example::
@@ -944,6 +946,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
@@ -951,7 +956,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'):
@@ -962,8 +967,10 @@ class Sphinx:
Add *filename* to the list of CSS files that the default HTML template
will include in order of *priority* (ascending). The filename must be
- relative to the HTML static path, or a full URI with scheme. The
- eyword arguments are also accepted for attributes of ``<link>`` tag.
+ relative to the HTML static path, or a full URI with scheme. If the
+ priority of CSS file is the same as others, the CSS files will be
+ included in order of the registration. The keyword arguments are also
+ accepted for attributes of ``<link>`` tag.
Example::
@@ -990,6 +997,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
@@ -1004,7 +1014,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)