Commit 1145b3d3 authored by Jason Madden's avatar Jason Madden

Fix Sphinx 2.0 warnings.

Inherit the default search.html template since ours was broken. Visibly it's pretty much the same, but this one works.

Fix a CSS error that made the search boxes look really bad.

Tested on 1.8 with Python 2.7 and 2.x with Python 3.7. Requires 1.8

[skip ci]
parent 4164db28
...@@ -28,6 +28,10 @@ sys.path.append(os.path.dirname(__file__)) # for mysphinxext ...@@ -28,6 +28,10 @@ sys.path.append(os.path.dirname(__file__)) # for mysphinxext
# -- General configuration ----------------------------------------------------- # -- General configuration -----------------------------------------------------
# 1.8 was the last version that runs on Python 2; 2.0+ requires Python 3.
# `autodoc_default_options` was new in 1.8
needs_sphinx = "1.8"
# Add any Sphinx extension module names here, as strings. They can be extensions # Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [ extensions = [
...@@ -53,7 +57,13 @@ extlinks = {'issue': ('https://github.com/gevent/gevent/issues/%s', ...@@ -53,7 +57,13 @@ extlinks = {'issue': ('https://github.com/gevent/gevent/issues/%s',
'pr': ('https://github.com/gevent/gevent/pull/%s', 'pr': ('https://github.com/gevent/gevent/pull/%s',
'pull request #')} 'pull request #')}
autodoc_default_flags = ['members', 'show-inheritance'] # Sphinx 1.8+ prefers this to `autodoc_default_flags`. It's documented that
# either True or None mean the same thing as just setting the flag, but
# only None works in 1.8 (True works in 2.0)
autodoc_default_options = {
'members': None,
'show-inheritance': None,
}
autodoc_member_order = 'groupwise' autodoc_member_order = 'groupwise'
autoclass_content = 'both' autoclass_content = 'both'
...@@ -71,7 +81,7 @@ master_doc = 'contents' ...@@ -71,7 +81,7 @@ master_doc = 'contents'
# General information about the project. # General information about the project.
project = u'gevent' project = u'gevent'
copyright = u'2009-2018, gevent contributors' copyright = u'2009-2019, gevent contributors'
# The version info for the project you're documenting, acts as replacement for # The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the # |version| and |release|, also used in various other places throughout the
......
...@@ -105,6 +105,13 @@ ...@@ -105,6 +105,13 @@
{%- endif %}{% endif %} {%- endif %}{% endif %}
{%- endmacro %} {%- endmacro %}
{%- macro script() %}
<script type="text/javascript" id="documentation_options" data-url_root="{{ pathto('', 1) }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script>
{%- for js in script_files %}
{{ js_tag(js) }}
{%- endfor %}
{%- endmacro %}
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<head> <head>
...@@ -119,28 +126,17 @@ ...@@ -119,28 +126,17 @@
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/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/pygments.css', 1) }}" type="text/css" />
{%- if not embedded %} {%- if not embedded %}
{# <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { {%- block scripts %}
URL_ROOT: '{{ url_root }}', {{- script() }}
VERSION: '{{ release|e }}', {%- endblock %}
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '{{ file_suffix }}',
HAS_SOURCE: {{ has_source|lower }}
};
</script>
{%- for scriptfile in script_files %}
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
{%- endfor %}
{%- if use_opensearch %}
<link rel="search" type="application/opensearchdescription+xml"
title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}"
href="{{ pathto('_static/opensearch.xml', 1) }}"/>
{%- endif %} #}
{%- if favicon %} {%- if favicon %}
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/> <link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
{%- endif %} {%- endif %}
{%- endif %} {%- endif %}
{%- block linktags %}
{%- block linktags %}
{%- if hasdoc('about') %} {%- if hasdoc('about') %}
<link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" /> <link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" />
{%- endif %} {%- endif %}
...@@ -163,7 +159,7 @@ ...@@ -163,7 +159,7 @@
{%- if prev %} {%- if prev %}
<link rel="prev" title="{{ prev.title|striptags }}" href="{{ prev.link|e }}" /> <link rel="prev" title="{{ prev.title|striptags }}" href="{{ prev.link|e }}" />
{%- endif %} {%- endif %}
{%- endblock %} {%- endblock %}
{%- block extrahead %} {% endblock %} {%- block extrahead %} {% endblock %}
</head> </head>
...@@ -232,7 +228,7 @@ ...@@ -232,7 +228,7 @@
<div class="left" id="footer-left"> <div class="left" id="footer-left">
<p>version {{theme_gevent_version}} <a href="http://denisbilenko.com" class="quiet-link">&copy; 2009-2018 Denis Bilenko, gevent contributors</a></p> <p>version {{theme_gevent_version}} <a href="http://denisbilenko.com" class="quiet-link">&copy; 2009-2019 Denis Bilenko, gevent contributors</a></p>
<div class="clearer">&nbsp;</div> <div class="clearer">&nbsp;</div>
......
{% extends "layout.html" %}
{% set title = _('Search') %}
{% set script_files = script_files + ['_static/searchtools.js'] %}
{% block body %}
<h1 id="search-documentation">{{ _('Search') }}</h1>
<div id="fallback" class="admonition warning">
<script type="text/javascript">$('#fallback').hide();</script>
<p>
{% trans %}Please activate JavaScript to enable the search
functionality.{% endtrans %}
</p>
</div>
<p>
{% trans %}From here you can search these documents. Enter your search
words into the box below and click "search". Note that the search
function will automatically search for all of the words. Pages
containing fewer words won't appear in the result list.{% endtrans %}
</p>
<form action="" method="get">
<input type="text" name="q" value="" />
<input type="submit" value="{{ _('search') }}" />
<span id="search-progress" style="padding-left: 10px"></span>
</form>
{% if search_performed %}
<h2>{{ _('Search Results') }}</h2>
{% if not search_results %}
<p>{{ _('Your search did not match any results.') }}</p>
{% endif %}
{% endif %}
<div id="search-results">
{% if search_results %}
<ul>
{% for href, caption, context in search_results %}
<li><a href="{{ pathto(item.href) }}">{{ caption }}</a>
<div class="context">{{ context|e }}</div>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endblock %}
{% block footer %}
{{ super() }}
<script type="text/javascript" src="{{ pathto('searchindex.js', 1) }}"></script>
{% endblock %}
...@@ -16,7 +16,7 @@ http://templates.arcsin.se/license/ ...@@ -16,7 +16,7 @@ http://templates.arcsin.se/license/
Reset Reset
------------------------------------------------------------------- */ ------------------------------------------------------------------- */
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, /*pre,*/ a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, textarea, input, select {margin: 0; padding: 0; border: 0; font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline;} html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, /*pre,*/ a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, textarea, select {margin: 0; padding: 0; border: 0; font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline;}
table {border-collapse: collapse; border-spacing: 0;} table {border-collapse: collapse; border-spacing: 0;}
caption, th, td {text-align: left; font-weight: normal;} caption, th, td {text-align: left; font-weight: normal;}
table, td, th {vertical-align: middle;} table, td, th {vertical-align: middle;}
......
[theme] [theme]
inherit = none inherit = basic
stylesheet = basic.css stylesheet = basic.css
pygments_style = sphinx pygments_style = sphinx
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment