Skip to content

Commit b303775

Browse files
authored
Add exclude-doctools option (#1069)
1 parent bdc57b3 commit b303775

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

docs/source/configuration/page.rst

+11
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,14 @@ If set, hides the version warning from the page.
8888
.. code-block:: none
8989
9090
:hide-version-warning:
91+
92+
Exclude doctools
93+
----------------
94+
95+
Excludes ``doctools.js`` from specific documentation pages.
96+
97+
Required to make the toolchain compatible with Swagger UI.
98+
99+
.. code-block:: none
100+
101+
:exclude-doctools:

sphinx_scylladb_theme/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def update_context(app, pagename, templatename, context, doctree):
5151
context["hide_version_warning"] = "hide-version-warning" in file_meta
5252
context["hide_sidebar"] = "hide-sidebar" in file_meta
5353
context["hide_secondary_sidebar"] = "hide-secondary-sidebar" in file_meta
54+
context["exclude_doctools"] = "exclude-doctools" in file_meta
5455
context["landing"] = "landing" in file_meta
5556

5657
if (

sphinx_scylladb_theme/layout.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
<script type="text/javascript" src="{{ pathto('_static/js/runtime.bundle.js', 1) }}"></script>
77
<script type="text/javascript" src="{{ pathto('_static/js/main.bundle.js', 1) }}"></script>
88
{% for js in script_files %}
9-
{{ js_tag(js) }}
9+
{% if not (exclude_doctools and 'doctools.js' in js_tag(js)) %}
10+
{{ js_tag(js) }}
11+
{% endif %}
1012
{% endfor %}
1113
{% endmacro %}
1214
{% macro css() %}

0 commit comments

Comments
 (0)