mirror of
https://github.com/readthedocs/sphinx_rtd_theme.git
synced 2026-10-15 02:42:01 -05:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70a0d7ad75 | ||
|
|
50c7fefbe5 | ||
|
|
97b9430ab6 | ||
|
|
82b326926e | ||
|
|
f9471186d6 |
No files matched your search
@@ -8,7 +8,7 @@ commands:
|
||||
type: string
|
||||
sphinx-version:
|
||||
type: string
|
||||
default: "16,17,18,20,21,22,23,24,30,31,32,33,34,latest"
|
||||
default: "20,21,22,23,24,30,31,32,33,34,latest"
|
||||
steps:
|
||||
- checkout
|
||||
- run: pip install --user tox
|
||||
|
||||
@@ -117,7 +117,7 @@ setup(
|
||||
]
|
||||
},
|
||||
install_requires=[
|
||||
'sphinx>=1.6'
|
||||
'sphinx>=2.0'
|
||||
],
|
||||
tests_require=[
|
||||
'pytest',
|
||||
@@ -137,7 +137,6 @@ setup(
|
||||
'Environment :: Console',
|
||||
'Environment :: Web Environment',
|
||||
'Intended Audience :: Developers',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3.6',
|
||||
'Programming Language :: Python :: 3.7',
|
||||
|
||||
@@ -6,7 +6,6 @@ From https://github.com/ryan-roemer/sphinx-bootstrap-theme.
|
||||
|
||||
from os import path
|
||||
|
||||
from sphinx import version_info
|
||||
from sphinx.locale import _
|
||||
from sphinx.util.logging import getLogger
|
||||
|
||||
@@ -33,22 +32,17 @@ def config_initiated(app, config):
|
||||
|
||||
# See http://www.sphinx-doc.org/en/stable/theming.html#distribute-your-theme-as-a-python-package
|
||||
def setup(app):
|
||||
app.require_sphinx('1.6')
|
||||
if version_info <= (2, 0, 0):
|
||||
if not app.config.html_experimental_html5_writer:
|
||||
logger.warning("'html4_writer' is deprecated with sphinx_rtd_theme")
|
||||
else:
|
||||
if app.config.html4_writer:
|
||||
logger.warning("'html4_writer' is deprecated with sphinx_rtd_theme")
|
||||
app.require_sphinx('2.0')
|
||||
if app.config.html4_writer:
|
||||
logger.warning("'html4_writer' is deprecated with sphinx_rtd_theme")
|
||||
|
||||
# Register the theme that can be referenced without adding a theme path
|
||||
app.add_html_theme('sphinx_rtd_theme', path.abspath(path.dirname(__file__)))
|
||||
|
||||
if version_info >= (1, 8, 0):
|
||||
# Add Sphinx message catalog for newer versions of Sphinx
|
||||
# See http://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_message_catalog
|
||||
rtd_locale_path = path.join(path.abspath(path.dirname(__file__)), 'locale')
|
||||
app.add_message_catalog('sphinx', rtd_locale_path)
|
||||
app.connect('config-inited', config_initiated)
|
||||
# Add Sphinx message catalog for newer versions of Sphinx
|
||||
# See http://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_message_catalog
|
||||
rtd_locale_path = path.join(path.abspath(path.dirname(__file__)), 'locale')
|
||||
app.add_message_catalog('sphinx', rtd_locale_path)
|
||||
app.connect('config-inited', config_initiated)
|
||||
|
||||
return {'parallel_read_safe': True, 'parallel_write_safe': True}
|
||||
@@ -55,28 +55,10 @@
|
||||
<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 inherert more blocks directly from sphinx #}
|
||||
{%- if sphinx_version >= "1.8.0" -%}
|
||||
<script type="text/javascript" id="documentation_options" data-url_root="{{ url_root }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script>
|
||||
{%- for scriptfile in script_files %}
|
||||
{{ js_tag(scriptfile) }}
|
||||
{%- endfor %}
|
||||
{%- else %}
|
||||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT:'{{ url_root }}',
|
||||
VERSION:'{{ release|e }}',
|
||||
LANGUAGE:'{{ language }}',
|
||||
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>
|
||||
{%- endfor %}
|
||||
{%- endif %}
|
||||
<script type="text/javascript" id="documentation_options" data-url_root="{{ url_root }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script>
|
||||
{%- for scriptfile in script_files %}
|
||||
{{ js_tag(scriptfile) }}
|
||||
{%- endfor %}
|
||||
<script type="text/javascript" src="{{ pathto('_static/js/theme.js', 1) }}"></script>
|
||||
|
||||
{#- OPENSEARCH #}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[tox]
|
||||
envlist = py{27,36,37,38,39}-sphinx{16,17,18,20,21,22,23,24,30,31,32,33,34,latest}
|
||||
envlist = py{36,37,38,39}-sphinx{20,21,22,23,24,30,31,32,33,34,latest}
|
||||
|
||||
[testenv]
|
||||
setev =
|
||||
@@ -9,9 +9,6 @@ deps =
|
||||
readthedocs-sphinx-ext
|
||||
pytest
|
||||
sphinxcontrib-httpdomain
|
||||
sphinx16: Sphinx < 1.7
|
||||
sphinx17: Sphinx < 1.8
|
||||
sphinx18: Sphinx < 1.9
|
||||
sphinx20: Sphinx < 2.1
|
||||
sphinx21: Sphinx < 2.2
|
||||
sphinx22: Sphinx < 2.3
|
||||
|
||||
Reference in new issue
Block a user