From 1bd168a605c2a0fa5e887c3e78bd37844b307709 Mon Sep 17 00:00:00 2001 From: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com> Date: Mon, 8 May 2023 14:32:11 -0600 Subject: [PATCH] Fix docs to work with Sphinx Theme 1.11 (#867) * Fix docs to work with Sphinx Theme 1.11 * Update docs/source/_templates/sidebar.html Co-authored-by: Matthew Treinish --- docs/source/_templates/layout.html | 300 +++++++++------------------ docs/source/_templates/page.html | 14 -- docs/source/_templates/sidebar.html | 99 +++++++++ docs/source/_templates/versions.html | 25 --- docs/source/conf.py | 12 +- docs/source/requirements.txt | 3 +- 6 files changed, 205 insertions(+), 248 deletions(-) delete mode 100644 docs/source/_templates/page.html create mode 100644 docs/source/_templates/sidebar.html delete mode 100644 docs/source/_templates/versions.html diff --git a/docs/source/_templates/layout.html b/docs/source/_templates/layout.html index 102d6029e..515164542 100644 --- a/docs/source/_templates/layout.html +++ b/docs/source/_templates/layout.html @@ -1,48 +1,25 @@ -{# TEMPLATE VAR SETTINGS #} -{%- set url_root = pathto('', 1) %} -{%- if url_root == '#' %}{% set url_root = '' %}{% endif %} +{# Sphinx template variable setup #} {%- if not embedded and docstitle %} {%- set titlesuffix = " — "|safe + docstitle|e %} {%- else %} {%- set titlesuffix = "" %} {%- endif %} -{%- set lang_attr = 'en' if language == None else (language | replace('_', '-')) %} -{% import 'theme_variables.jinja' as theme_variables %} +{%- set lang_attr = 'en' if language == None else (language | replace('_', '-')) -%} - - + - - {{ metatags }} + - {% block htmltitle %} + {{ metatags }} + {%- block htmltitle %} {{ title|striptags|e }}{{ titlesuffix }} - {% endblock %} - - {# FAVICON #} - {% if favicon %} - - {% endif %} - {# CANONICAL URL #} - {% if theme_canonical_url %} - - {% endif %} - - {# CSS #} - - {# OPENSEARCH #} - {% if not embedded %} - {% if use_opensearch %} - - {% endif %} - - {% endif %} + {%- endblock %} + {%- if favicon_url %} + + {%- endif %} - - + {#- CSS #} {%- for css in css_files %} {%- if css|attr("rel") %} @@ -51,124 +28,108 @@ {%- endif %} {%- endfor %} {%- for cssfile in extra_css_files %} - - {%- endfor %} - - {%- block linktags %} - {%- if hasdoc('about') %} - - {%- endif %} - {%- if hasdoc('genindex') %} - - {%- endif %} - {%- if hasdoc('search') %} - - {%- endif %} - {%- if hasdoc('copyright') %} - - {%- endif %} - {%- if next %} - - {%- endif %} - {%- if prev %} - - {%- endif %} - {%- endblock %} - {%- block extrahead %} {% endblock %} - - {# Keep modernizr in head - http://modernizr.com/docs/#installing #} - + + {%- endfor -%} + + + {%- if analytics_enabled %} + + + + {%- endif -%} - - {% block extrabody %} {% endblock %} - {# SIDE NAV, TOGGLES ON MOBILE #} + - {% include "versions.html" %} + + {% include "languages.html" %} + - + + {% include "sidebar.html" %}
+ +
{% include "breadcrumbs.html" %}
- -
- Shortcuts -
+
-
+
{%- block content %} - {% if theme_style_external_links|tobool %} -
- {% if not embedded %} +{%- block footer %} {% endblock %} - {% if sphinx_version >= "1.8.0" %} - - {%- for scriptfile in script_files %} - {{ js_tag(scriptfile) }} - {%- endfor %} - {% else %} - - {%- for scriptfile in script_files %} - - {%- endfor %} - {% endif %} + + + {%- for scriptfile in script_files %} + {{ js_tag(scriptfile) }} + {%- endfor %} - {% endif %} + + + + - - - - + + -{%- block footer %} {% endblock %} - -
-
-
- - - -
-
-
-
- - -
-
-
- - -
- - - - - + diff --git a/docs/source/_templates/page.html b/docs/source/_templates/page.html deleted file mode 100644 index 429a7dedd..000000000 --- a/docs/source/_templates/page.html +++ /dev/null @@ -1,14 +0,0 @@ -{% extends "!page.html" %} - -{% block footer %} - -{% endblock %} \ No newline at end of file diff --git a/docs/source/_templates/sidebar.html b/docs/source/_templates/sidebar.html new file mode 100644 index 000000000..13c36ae8a --- /dev/null +++ b/docs/source/_templates/sidebar.html @@ -0,0 +1,99 @@ + + + +{% if expandable_sidebar %} + +{% endif %} + + + \ No newline at end of file diff --git a/docs/source/_templates/versions.html b/docs/source/_templates/versions.html deleted file mode 100644 index 7e445164d..000000000 --- a/docs/source/_templates/versions.html +++ /dev/null @@ -1,25 +0,0 @@ -
- - {{ version_label }} - - -
-
-
Versions
-
Current Release
-
Development
-
Previous Releases
- {% for version in version_list %} -
{{ version }}
- {% endfor %} -
-
- -
diff --git a/docs/source/conf.py b/docs/source/conf.py index be034aca7..23faf0b94 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -19,8 +19,8 @@ # General configuration: -project = u'rustworkx' -copyright = u'2021, rustworkx Contributors' +project = 'rustworkx' +copyright = '2021, rustworkx Contributors' # The short X.Y version. @@ -40,6 +40,7 @@ 'sphinx.ext.intersphinx', 'sphinxemoji.sphinxemoji', 'sphinx_reredirects', + 'qiskit_sphinx_theme', ] html_static_path = ['_static'] templates_path = ['_templates'] @@ -86,30 +87,25 @@ .. note:: - This is the documnetation for the current state of the development branch + This is the documentation for the current state of the development branch of rustworkx. The documentation or APIs here can change prior to being released. """ # HTML Output Options - html_theme = 'qiskit_sphinx_theme' - html_theme_options = { 'logo_only': False, 'display_version': True, 'prev_next_buttons_location': 'bottom', 'style_external_links': True, } - htmlhelp_basename = 'rustworkx' # Latex options - latex_elements = {} - latex_documents = [ ('index', 'rustworkx.tex', u'rustworkx Documentation', u'rustworkx Contributors', 'manual'), diff --git a/docs/source/requirements.txt b/docs/source/requirements.txt index a960d2883..57816784a 100644 --- a/docs/source/requirements.txt +++ b/docs/source/requirements.txt @@ -1,11 +1,10 @@ m2r2 sphinx>=3.0.0 -sphinx_rtd_theme jupyter-sphinx pydot pillow>=4.2.1 reno>=3.4.0 -qiskit-sphinx-theme>=1.7 +qiskit-sphinx-theme~=1.11.1 matplotlib>=3.4 sphinx-reredirects sphinxemoji