Skip to content

Commit

Permalink
docs: _isso theme: Simplify js macros, fix search
Browse files Browse the repository at this point in the history
A few things got refactored in sphinx, especially for 4.x.
Therefore, use provided helpers.

As a reference for the future, always look at what the
"basic" sphinx theme (bundled as `sphinx/themes/basic`)
does.

See:
- sphinx-doc/sphinx@a957d6f710
- sphinx-doc/sphinx#4916
- sphinx-doc/sphinx#4915
- readthedocs/sphinx_rtd_theme#1021
  • Loading branch information
ix5 committed Mar 28, 2022
1 parent 79a7746 commit a79f611
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
18 changes: 2 additions & 16 deletions docs/_isso/layout.html
@@ -1,26 +1,12 @@
<!DOCTYPE html>
{%- set url_root = pathto('', 1) %}
{# XXX necessary? #}
{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}

{%- macro script() %}
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '{{ url_root }}',
VERSION: '{{ release|e }}',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
HAS_SOURCE: {{ has_source|lower }},
SOURCELINK_SUFFIX: '{{ sourcelink_suffix }}'
};
</script>
{%- for scriptfile in script_files %}
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
{%- for js in script_files %}
{{ js_tag(js) }}
{%- endfor %}
{%- endmacro %}

{%- macro css() %}
<!--link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" /-->
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/css/site.css', 1) }}"/>
{%- for cssfile in css_files %}
Expand Down
2 changes: 1 addition & 1 deletion docs/_isso/search.html
Expand Up @@ -5,7 +5,7 @@ <h1>Search</h1>
</header>
{% endblock %}
{% set title = _('Search') %}
{% set script_files = script_files + ['_static/searchtools.js'] %}
{% set script_files = script_files + ['_static/searchtools.js'] + ['_static/language_data.js'] %}
{% block extrahead %}
<script type="text/javascript">
jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });
Expand Down

0 comments on commit a79f611

Please sign in to comment.