mirror of
https://github.com/readthedocs/sphinx_rtd_theme.git
synced 2025-02-25 18:55:21 -06:00
Merge branch 'master' into manifast_tests
This commit is contained in:
commit
b3d090e3e4
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1,6 +1,7 @@
|
||||
# Document global line endings settings
|
||||
# https://help.github.com/articles/dealing-with-line-endings/
|
||||
* text eol=lf
|
||||
*.bat text eol=crlf
|
||||
|
||||
|
||||
# Denote all files that are truly binary and should not be modified.
|
||||
|
@ -8,7 +8,6 @@ matrix:
|
||||
include:
|
||||
- python: 2.7
|
||||
env: TOXENV=docs
|
||||
sudo: false
|
||||
install:
|
||||
- pip install tox-travis
|
||||
script:
|
||||
|
@ -3,6 +3,27 @@
|
||||
Changelog
|
||||
*********
|
||||
|
||||
master
|
||||
======
|
||||
|
||||
:Date: TBD
|
||||
|
||||
New Features
|
||||
-------------
|
||||
|
||||
|
||||
Fixes
|
||||
-----
|
||||
|
||||
* Fix scrolling to active item in sidebar on load (#214)
|
||||
* Style caption link for code and literal blocks
|
||||
* Fix inconsistent font size and line height for autodoc "raises" and "returns" (#267)
|
||||
|
||||
|
||||
Other Changes
|
||||
--------------
|
||||
|
||||
|
||||
v0.4.2
|
||||
======
|
||||
|
||||
|
@ -19,7 +19,7 @@ file of this repository, and can be defined in your project's ``conf.py`` via
|
||||
|
||||
html_theme_options = {
|
||||
'canonical_url': '',
|
||||
'analytics_id': '',
|
||||
'analytics_id': 'UA-XXXXXXX-1', # Provided by Google in your dashboard
|
||||
'logo_only': False,
|
||||
'display_version': True,
|
||||
'prev_next_buttons_location': 'bottom',
|
||||
|
@ -87,7 +87,3 @@ you should do the following:
|
||||
$ rm -rf dist/
|
||||
$ python setup.py sdist bdist_wheel
|
||||
$ twine upload --sign --identity security@readthedocs.org dist/*
|
||||
|
||||
#. In the ``readthedocs.org`` repo, edit the ``bower.json`` file to point at the correct version
|
||||
(``sphinx-rtd-theme": "https://github.com/rtfd/sphinx-rtd-theme.git#$NEW_VERSION"``).
|
||||
#. In the ``readthedocs.org`` repo, run ``gulp build`` to update the distributed theme files.
|
||||
|
@ -1,38 +1,38 @@
|
||||
@ECHO OFF
|
||||
|
||||
pushd %~dp0
|
||||
|
||||
REM Command file for Sphinx documentation
|
||||
|
||||
if "%SPHINXBUILD%" == "" (
|
||||
set SPHINXBUILD=python -msphinx
|
||||
)
|
||||
set SPHINXOPTS=
|
||||
set SPHINXBUILD=sphinx-build
|
||||
set SOURCEDIR=.
|
||||
set BUILDDIR=build
|
||||
set SPHINXPROJ=ReadtheDocsSphinxTheme
|
||||
|
||||
if "%1" == "" goto help
|
||||
|
||||
%SPHINXBUILD% >NUL 2>NUL
|
||||
if errorlevel 9009 (
|
||||
echo.
|
||||
echo.The Sphinx module was not found. Make sure you have Sphinx installed,
|
||||
echo.then set the SPHINXBUILD environment variable to point to the full
|
||||
echo.path of the 'sphinx-build' executable. Alternatively you may add the
|
||||
echo.Sphinx directory to PATH.
|
||||
echo.
|
||||
echo.If you don't have Sphinx installed, grab it from
|
||||
echo.http://sphinx-doc.org/
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
|
||||
goto end
|
||||
|
||||
:help
|
||||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
|
||||
|
||||
:end
|
||||
popd
|
||||
@ECHO OFF
|
||||
|
||||
pushd %~dp0
|
||||
|
||||
REM Command file for Sphinx documentation
|
||||
|
||||
if "%SPHINXBUILD%" == "" (
|
||||
set SPHINXBUILD=python -msphinx
|
||||
)
|
||||
set SPHINXOPTS=
|
||||
set SPHINXBUILD=sphinx-build
|
||||
set SOURCEDIR=.
|
||||
set BUILDDIR=build
|
||||
set SPHINXPROJ=ReadtheDocsSphinxTheme
|
||||
|
||||
if "%1" == "" goto help
|
||||
|
||||
%SPHINXBUILD% >NUL 2>NUL
|
||||
if errorlevel 9009 (
|
||||
echo.
|
||||
echo.The Sphinx module was not found. Make sure you have Sphinx installed,
|
||||
echo.then set the SPHINXBUILD environment variable to point to the full
|
||||
echo.path of the 'sphinx-build' executable. Alternatively you may add the
|
||||
echo.Sphinx directory to PATH.
|
||||
echo.
|
||||
echo.If you don't have Sphinx installed, grab it from
|
||||
echo.http://sphinx-doc.org/
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
|
||||
goto end
|
||||
|
||||
:help
|
||||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
|
||||
|
||||
:end
|
||||
popd
|
||||
|
@ -152,6 +152,7 @@ function ThemeNav () {
|
||||
link.closest('li.toctree-l2').addClass('current');
|
||||
link.closest('li.toctree-l3').addClass('current');
|
||||
link.closest('li.toctree-l4').addClass('current');
|
||||
link[0].scrollIntoView();
|
||||
}
|
||||
}
|
||||
catch (err) {
|
||||
|
@ -36,6 +36,7 @@
|
||||
&.shift-up
|
||||
height: auto
|
||||
max-height: 100%
|
||||
overflow-y: scroll
|
||||
&.shift-up .rst-other-versions
|
||||
display: block
|
||||
.rst-other-versions
|
||||
@ -64,6 +65,7 @@
|
||||
left: auto
|
||||
border: none
|
||||
max-width: $nav-desktop-width
|
||||
max-height: 90%
|
||||
.icon-book
|
||||
float: none
|
||||
.fa-book
|
||||
|
@ -31,15 +31,16 @@ html
|
||||
width: $nav-desktop-width
|
||||
|
||||
header, p.caption
|
||||
color: $nav-caption
|
||||
height: $base-font-size * 2
|
||||
display: inline-block
|
||||
line-height: $base-font-size * 2
|
||||
padding: 0 $gutter
|
||||
margin-bottom: 0
|
||||
margin: $base-line-height / 2 0 0 0
|
||||
display: block
|
||||
font-weight: bold
|
||||
text-transform: uppercase
|
||||
font-size: 80%
|
||||
font-size: 85%
|
||||
white-space: nowrap
|
||||
|
||||
ul
|
||||
@ -362,6 +363,8 @@ footer
|
||||
color: $text-medium
|
||||
font-size: 90%
|
||||
|
||||
.genindextable li > ul
|
||||
margin-left: $base-line-height
|
||||
|
||||
+media($tablet)
|
||||
.wy-body-for-nav
|
||||
|
@ -95,6 +95,13 @@
|
||||
font-size: 12px
|
||||
line-height: 1.4
|
||||
|
||||
.code-block-caption
|
||||
font-style: italic
|
||||
font-size: 85%
|
||||
line-height: 1
|
||||
padding: 1em 0
|
||||
text-align: center
|
||||
|
||||
@media print
|
||||
.codeblock, div[class^='highlight'], div[class^='highlight'] pre
|
||||
white-space: pre-wrap
|
||||
@ -165,7 +172,7 @@
|
||||
@extend h2
|
||||
|
||||
// This is the #href that shows up on hover. Sphinx's is terrible so I hack it away.
|
||||
h1, h2, h3, h4, h5, h6, dl dt, p.caption, table > caption
|
||||
h1, h2, h3, h4, h5, h6, dl dt, p.caption, table > caption, .code-block-caption
|
||||
.headerlink
|
||||
visibility: hidden
|
||||
font-size: 14px
|
||||
@ -263,6 +270,9 @@
|
||||
border: none
|
||||
td
|
||||
border: none
|
||||
p
|
||||
font-size: inherit
|
||||
line-height: inherit
|
||||
td > strong
|
||||
display: inline-block
|
||||
.field-name
|
||||
|
@ -51,6 +51,7 @@ $nav-link-color: $blue
|
||||
$nav-link-color-visited: $purple
|
||||
$nav-link-color-hover: lighten($nav-link-color, 6%) !default
|
||||
$nav-link-color-alt: hsl(33, 100%, 51%)
|
||||
$nav-caption: desaturate($blue, 15%)
|
||||
|
||||
// Sidebar colors
|
||||
$sidebar-background-color: $table-stripe-color
|
||||
|
@ -74,7 +74,7 @@
|
||||
<a href="{{ next.link|e }}" class="btn btn-neutral float-right" title="{{ next.title|striptags|e }}" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
|
||||
{% endif %}
|
||||
{% if prev %}
|
||||
<a href="{{ prev.link|e }}" class="btn btn-neutral" title="{{ prev.title|striptags|e }}" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
<a href="{{ prev.link|e }}" class="btn btn-neutral float-left" title="{{ prev.title|striptags|e }}" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@ -5,7 +5,7 @@
|
||||
<a href="{{ next.link|e }}" class="btn btn-neutral float-right" title="{{ next.title|striptags|e }}" accesskey="n" rel="next">{{ _('Next') }} <span class="fa fa-arrow-circle-right"></span></a>
|
||||
{% endif %}
|
||||
{% if prev %}
|
||||
<a href="{{ prev.link|e }}" class="btn btn-neutral" title="{{ prev.title|striptags|e }}" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> {{ _('Previous') }}</a>
|
||||
<a href="{{ prev.link|e }}" class="btn btn-neutral float-left" title="{{ prev.title|striptags|e }}" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> {{ _('Previous') }}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@ -28,18 +28,42 @@
|
||||
<link rel="canonical" href="{{ theme_canonical_url }}{{ pagename }}.html"/>
|
||||
{% endif %}
|
||||
|
||||
{# CSS #}
|
||||
|
||||
{# OPENSEARCH #}
|
||||
{% if not embedded %}
|
||||
{% 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) }}"/>
|
||||
{# JAVASCRIPTS #}
|
||||
<script type="text/javascript" src="{{ pathto('_static/js/modernizr.min.js', 1) }}"></script>
|
||||
{%- 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="{{ pathto('', 1) }}" 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" src="{{ pathto('_static/js/theme.js', 1) }}"></script>
|
||||
|
||||
{% endif %}
|
||||
{# OPENSEARCH #}
|
||||
{%- 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 %}
|
||||
{%- endif %}
|
||||
|
||||
{# CSS #}
|
||||
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
|
||||
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
|
||||
{%- for css in css_files %}
|
||||
@ -49,6 +73,7 @@
|
||||
<link rel="stylesheet" href="{{ pathto(css, 1) }}" type="text/css" />
|
||||
{%- endif %}
|
||||
{%- endfor %}
|
||||
|
||||
{%- for cssfile in extra_css_files %}
|
||||
<link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
|
||||
{%- endfor %}
|
||||
@ -74,10 +99,6 @@
|
||||
{%- endif %}
|
||||
{%- endblock %}
|
||||
{%- block extrahead %} {% endblock %}
|
||||
|
||||
{# Keep modernizr in head - http://modernizr.com/docs/#installing #}
|
||||
<script src="{{ pathto('_static/js/modernizr.min.js', 1) }}"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="wy-body-for-nav">
|
||||
@ -186,41 +207,29 @@
|
||||
</div>
|
||||
{% include "versions.html" %}
|
||||
|
||||
{% 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="{{ pathto('', 1) }}" 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 %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
<script type="text/javascript" src="{{ pathto('_static/js/theme.js', 1) }}"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function () {
|
||||
SphinxRtdTheme.Navigation.enable({{ 'true' if theme_sticky_navigation|tobool else 'false' }});
|
||||
});
|
||||
</script>
|
||||
|
||||
{# Do not conflict with RTD insertion of analytics script #}
|
||||
{% if not READTHEDOCS %}
|
||||
{% if theme_analytics_id %}
|
||||
<!-- Theme Analytics -->
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', '{{ theme_analytics_id }}', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{%- block footer %} {% endblock %}
|
||||
|
||||
</body>
|
||||
|
Loading…
Reference in New Issue
Block a user