Skip to content

Commit 26abb6b

Browse files
committed
Merge pull request #1500 from rtfd/update-sphinx-theme
Update integrated sphinx_rtd_theme
2 parents 5695f78 + 06694d0 commit 26abb6b

18 files changed

+483
-21
lines changed

media/css/sphinx_rtd_theme.css

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

media/font/fonts/FontAwesome.otf

61.4 KB
Binary file not shown.

media/font/fonts/Inconsolata-Bold.ttf

46 KB
Binary file not shown.

media/font/fonts/Inconsolata.ttf

61.7 KB
Binary file not shown.

media/font/fonts/Lato-Bold.ttf

80.4 KB
Binary file not shown.

media/font/fonts/Lato-Regular.ttf

80.1 KB
Binary file not shown.

media/font/fonts/RobotoSlab-Bold.ttf

35.7 KB
Binary file not shown.
35.4 KB
Binary file not shown.
37.3 KB
Binary file not shown.

media/font/fonts/fontawesome-webfont.svg

+414
Loading
78.8 KB
Binary file not shown.
43.4 KB
Binary file not shown.

readthedocs/templates/sphinx/sphinx_rtd_theme/footer.html

+15-1
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,23 @@
2222
{%- endif %}
2323
{%- endif %}
2424

25-
{%- if last_updated %}
25+
{%- if build_id and build_url %}
26+
{% trans build_url=build_url, build_id=build_id %}
27+
<span class="build">
28+
Build
29+
<a href="{{ build_url }}">{{ build_id }}</a>.
30+
</span>
31+
{% endtrans %}
32+
{%- elif commit %}
33+
{% trans commit=commit %}
34+
<span class="commit">
35+
Revision <code>{{ commit }}</code>.
36+
</span>
37+
{% endtrans %}
38+
{%- elif last_updated %}
2639
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
2740
{%- endif %}
41+
2842
</p>
2943
</div>
3044

readthedocs/templates/sphinx/sphinx_rtd_theme/layout.html

+17-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
{%- block extrahead %} {% endblock %}
7676

7777
{# Keep modernizr in head - http://modernizr.com/docs/#installing #}
78-
<script src="_static/js/modernizr.min.js"></script>
78+
<script src="{{ pathto('_static/js/modernizr.min.js', 1) }}"></script>
7979

8080
</head>
8181

@@ -100,14 +100,26 @@
100100
{% endif %}
101101
</a>
102102

103+
{% if theme_display_version %}
104+
{%- set nav_version = version %}
105+
{% if READTHEDOCS and current_version %}
106+
{%- set nav_version = current_version %}
107+
{% endif %}
108+
{% if nav_version %}
109+
<div class="version">
110+
{{ nav_version }}
111+
</div>
112+
{% endif %}
113+
{% endif %}
114+
103115
{% include "searchbox.html" %}
104116

105117
{% endblock %}
106118
</div>
107119

108120
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
109121
{% block menu %}
110-
{% set toctree = toctree(maxdepth=4, collapse=False, includehidden=True) %}
122+
{% set toctree = toctree(maxdepth=4, collapse=theme_collapse_navigation, includehidden=True) %}
111123
{% if toctree %}
112124
{{ toctree }}
113125
{% else %}
@@ -132,8 +144,10 @@
132144
<div class="wy-nav-content">
133145
<div class="rst-content">
134146
{% include "breadcrumbs.html" %}
135-
<div role="main" class="document">
147+
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
148+
<div itemprop="articleBody">
136149
{% block body %}{% endblock %}
150+
</div>
137151
</div>
138152
{% include "footer.html" %}
139153
</div>

readthedocs/templates/sphinx/sphinx_rtd_theme/static/css/theme.css

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

readthedocs/templates/sphinx/sphinx_rtd_theme/static/css/theme.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

readthedocs/templates/sphinx/sphinx_rtd_theme/static/js/theme.js

+30-12
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ $(document).ready(function() {
3131
$("table.docutils:not(.field-list)").wrap("<div class='wy-table-responsive'></div>");
3232

3333
// Add expand links to all parents of nested ul
34-
$('.wy-menu-vertical ul').siblings('a').each(function () {
34+
$('.wy-menu-vertical ul').not('.simple').siblings('a').each(function () {
3535
var link = $(this);
3636
expand = $('<span class="toctree-expand"></span>');
3737
expand.on('click', function (ev) {
@@ -49,29 +49,30 @@ window.SphinxRtdTheme = (function (jquery) {
4949
var navBar,
5050
win,
5151
winScroll = false,
52+
winResize = false,
5253
linkScroll = false,
5354
winPosition = 0,
55+
winHeight,
56+
docHeight,
5457
enable = function () {
5558
init();
5659
reset();
5760
win.on('hashchange', reset);
5861

59-
// Set scrolling
62+
// Set scroll monitor
6063
win.on('scroll', function () {
6164
if (!linkScroll) {
6265
winScroll = true;
6366
}
6467
});
65-
setInterval(function () {
66-
if (winScroll) {
67-
winScroll = false;
68-
var newWinPosition = win.scrollTop(),
69-
navPosition = navBar.scrollTop(),
70-
newNavPosition = navPosition + (newWinPosition - winPosition);
71-
navBar.scrollTop(newNavPosition);
72-
winPosition = newWinPosition;
73-
}
74-
}, 25);
68+
setInterval(function () { if (winScroll) scroll(); }, 25);
69+
70+
// Set resize monitor
71+
win.on('resize', function () {
72+
winResize = true;
73+
});
74+
setInterval(function () { if (winResize) resize(); }, 25);
75+
resize();
7576
},
7677
init = function () {
7778
navBar = jquery('nav.wy-nav-side:first');
@@ -95,6 +96,23 @@ window.SphinxRtdTheme = (function (jquery) {
9596
}
9697
}
9798
},
99+
scroll = function () {
100+
winScroll = false;
101+
var newWinPosition = win.scrollTop(),
102+
winBottom = newWinPosition + winHeight,
103+
navPosition = navBar.scrollTop(),
104+
newNavPosition = navPosition + (newWinPosition - winPosition);
105+
if (newWinPosition < 0 || winBottom > docHeight) {
106+
return;
107+
}
108+
navBar.scrollTop(newNavPosition);
109+
winPosition = newWinPosition;
110+
},
111+
resize = function () {
112+
winResize = false;
113+
winHeight = win.height();
114+
docHeight = $(document).height();
115+
},
98116
hashChange = function () {
99117
linkScroll = true;
100118
win.one('hashchange', function () {

readthedocs/templates/sphinx/sphinx_rtd_theme/theme.conf

+2
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ typekit_id = hiw1hhg
77
analytics_id =
88
sticky_navigation = False
99
logo_only =
10+
collapse_navigation = False
11+
display_version = True

0 commit comments

Comments
 (0)