Skip to content

Commit

Permalink
docs: update versions and setup.py (#1256)
Browse files Browse the repository at this point in the history
  • Loading branch information
bilbeyt authored Jan 31, 2023
1 parent 7a51a8a commit af957ea
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 30 deletions.
51 changes: 27 additions & 24 deletions docs/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
{%- set lang_attr = 'en' if language == None else (language | replace('_', '-')) %}
{%- set sphinx_writer = 'writer-html5' if html5_doctype else 'writer-html4' -%}

{# Build sphinx_version_info tuple from sphinx_version string in pure Jinja #}
{%- set (_ver_major, _ver_minor) = (sphinx_version.split('.') | list)[:2] | map('int') -%}
{%- set sphinx_version_info = (_ver_major, _ver_minor, -1) -%}

<!DOCTYPE html>
<html class="{{ sphinx_writer }}" lang="{{ lang_attr }}" >
<head>
Expand All @@ -20,9 +24,6 @@
{%- endblock -%}

{#- CSS #}
<link rel="stylesheet" href="{{ fixpath(pathto('_static/' + style, 1)) }}" type="text/css" />
<link rel="stylesheet" href="{{ fixpath(pathto('_static/pygments.css', 1)) }}" type="text/css" />
<link rel="stylesheet" href="{{ fixpath(pathto('_static/custom.css', 1)) }}" type="text/css" />
{%- for css in css_files %}
{%- if css|attr("rel") %}
<link rel="{{ css.rel }}" href="{{ fixpath(pathto(css.filename, 1)) }}" type="text/css"{% if css.title is not none %} title="{{ css.title }}"{% endif %} />
Expand All @@ -35,10 +36,14 @@
<link rel="stylesheet" href="{{ fixpath(pathto(cssfile, 1)) }}" type="text/css" />
{%- endfor -%}

{#- FAVICON #}
{%- if favicon %}
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
{%- endif -%}
{#- FAVICON
favicon_url is the only context var necessary since Sphinx 4.
In Sphinx<4, we use favicon but need to prepend path info.
#}
{%- set _favicon_url = favicon_url | default(pathto('_static/' + (favicon or ""), 1)) %}
{%- if favicon_url or favicon %}
<link rel="shortcut icon" href="{{ _favicon_url }}"/>
{%- endif %}

{#- CANONICAL URL (deprecated) #}
{%- if theme_canonical_url and not pageurl %}
Expand All @@ -56,9 +61,8 @@
<script src="{{ pathto('_static/js/html5shiv.min.js', 1) }}"></script>
<![endif]-->
{%- if not embedded %}
{# XXX Sphinx 1.8.0 made this an external js-file, quick fix until we refactor the template to inherit more blocks directly from sphinx #}
{%- if sphinx_version >= "1.8.0" -%}
<script id="documentation_options" data-url_root="{{ url_root }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script>
{# XXX Sphinx 1.8.0 made this an external js-file, quick fix until we refactor the template to inherert more blocks directly from sphinx #}
{%- if sphinx_version_info >= (1, 8) -%}
{%- for scriptfile in script_files %}
{{ js_tag(scriptfile) }}
{%- endfor %}
Expand Down Expand Up @@ -125,18 +129,16 @@
<div class="wy-side-scroll">
<div class="wy-side-nav-search" {% if theme_style_nav_header_background %} style="background: {{theme_style_nav_header_background}}" {% endif %}>
{%- block sidebartitle %}
{%- if logo and theme_logo_only %}
<a href="{{ pathto(master_doc) }}">
{%- else %}
<a href="{{ pathto(master_doc) }}" class="icon icon-home"> {{ project }}
{%- endif %}

{%- if logo %}
{#- Not strictly valid HTML, but it's the only way to display/scale
it properly, without weird scripting or heaps of work
#}
<img src="{{ pathto('_static/' + logo, 1) }}" class="logo" alt="{{ _('Logo') }}"/>
{%- endif %}
{# the logo helper function was removed in Sphinx 6 and deprecated since Sphinx 4 #}
{# the master_doc variable was renamed to root_doc in Sphinx 4 (master_doc still exists in later Sphinx versions) #}
{%- set _logo_url = logo_url|default(pathto('_static/' + (logo or ""), 1)) %}
{%- set _root_doc = root_doc|default(master_doc) %}
<a href="{{ pathto(_root_doc) }}"{% if not theme_logo_only %} class="icon icon-home"{% endif %}>
{% if not theme_logo_only %}{{ project }}{% endif %}
{%- if logo or logo_url %}
<img src="{{ _logo_url }}" class="logo" alt="{{ _('Logo') }}"/>
{%- endif %}
</a>

{%- if theme_display_version %}
Expand Down Expand Up @@ -169,7 +171,8 @@
</div>

{%- block navigation %}
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="{{ _('Main') }}">
{#- Translators: This is an ARIA section label for the main navigation menu -#}
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="{{ _('Navigation menu') }}">
{%- block menu %}
{%- set toctree = toctree(maxdepth=theme_navigation_depth|int,
collapse=theme_collapse_navigation|tobool,
Expand All @@ -181,7 +184,6 @@
<!-- Local TOC -->
<div class="local-toc">{{ toc }}</div>
{%- endif %}

{%- endblock %}
</div>
{%- endblock %}
Expand All @@ -191,7 +193,8 @@
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

{#- MOBILE NAV, TRIGGLES SIDE NAV ON TOGGLE #}
<nav class="wy-nav-top" aria-label="{{ _('Top') }}" {% if theme_style_nav_header_background %} style="background: {{theme_style_nav_header_background}}" {% endif %}>
{#- Translators: This is an ARIA section label for the navigation menu that is visible when viewing the page on mobile devices -#}
<nav class="wy-nav-top" aria-label="{{ _('Mobile navigation menu') }}" {% if theme_style_nav_header_background %} style="background: {{theme_style_nav_header_background}}" {% endif %}>
{%- block mobile_nav %}
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="{{ pathto(master_doc) }}">{{ project }}</a>
Expand Down
13 changes: 7 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@
"mdformat-frontmatter>=0.4.1", # Needed for frontmatters-style headers in issue templates
],
"doc": [
"myst-parser>=0.17.0,<0.18", # Tools for parsing markdown files in the docs
"sphinx-click>=3.1.0,<4.0", # For documenting CLI
"Sphinx>=4.4.0,<5.0", # Documentation generator
"sphinx_rtd_theme>=1.0.0,<2", # Readthedocs.org theme
# Tools for parsing markdown files in the docs
"myst-parser @ git+https://github.com/executablebooks/MyST-Parser.git",
"sphinx-click>=4.4.0,<5.0", # For documenting CLI
"Sphinx>=6.1.3,<7.0", # Documentation generator
"sphinx_rtd_theme>=1.2.0rc3,<2", # Readthedocs.org theme
"sphinxcontrib-napoleon>=0.7", # Allow Google-style documentation
],
"release": [ # `release` GitHub Action job uses this
Expand Down Expand Up @@ -94,9 +95,9 @@
"ijson>=3.1.4,<4",
"importlib-metadata",
"ipython>=8.5.0,<9",
"packaging>=20.9,<21",
"packaging>=21,<22",
"pandas>=1.3.0,<2",
"pluggy>=1.0.0,<2",
"pluggy>=0.12,<2",
"pydantic>=1.9.2,<2",
"PyGithub>=1.54,<2",
"pytest>=6.0,<8.0",
Expand Down

0 comments on commit af957ea

Please sign in to comment.