Skip to content

Update integrated sphinx_rtd_theme #1500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions media/css/sphinx_rtd_theme.css

Large diffs are not rendered by default.

Binary file added media/font/fonts/FontAwesome.otf
Binary file not shown.
Binary file added media/font/fonts/Inconsolata-Bold.ttf
Binary file not shown.
Binary file added media/font/fonts/Inconsolata.ttf
Binary file not shown.
Binary file added media/font/fonts/Lato-Bold.ttf
Binary file not shown.
Binary file added media/font/fonts/Lato-Regular.ttf
Binary file not shown.
Binary file added media/font/fonts/RobotoSlab-Bold.ttf
Binary file not shown.
Binary file added media/font/fonts/RobotoSlab-Regular.ttf
Binary file not shown.
Binary file added media/font/fonts/fontawesome-webfont.eot
Binary file not shown.
414 changes: 414 additions & 0 deletions media/font/fonts/fontawesome-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/font/fonts/fontawesome-webfont.ttf
Binary file not shown.
Binary file added media/font/fonts/fontawesome-webfont.woff
Binary file not shown.
16 changes: 15 additions & 1 deletion readthedocs/templates/sphinx/sphinx_rtd_theme/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,23 @@
{%- endif %}
{%- endif %}

{%- if last_updated %}
{%- if build_id and build_url %}
{% trans build_url=build_url, build_id=build_id %}
<span class="build">
Build
<a href="{{ build_url }}">{{ build_id }}</a>.
</span>
{% endtrans %}
{%- elif commit %}
{% trans commit=commit %}
<span class="commit">
Revision <code>{{ commit }}</code>.
</span>
{% endtrans %}
{%- elif last_updated %}
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
{%- endif %}

</p>
</div>

Expand Down
20 changes: 17 additions & 3 deletions readthedocs/templates/sphinx/sphinx_rtd_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
{%- block extrahead %} {% endblock %}

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

</head>

Expand All @@ -100,14 +100,26 @@
{% endif %}
</a>

{% if theme_display_version %}
{%- set nav_version = version %}
{% if READTHEDOCS and current_version %}
{%- set nav_version = current_version %}
{% endif %}
{% if nav_version %}
<div class="version">
{{ nav_version }}
</div>
{% endif %}
{% endif %}

{% include "searchbox.html" %}

{% endblock %}
</div>

<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
{% block menu %}
{% set toctree = toctree(maxdepth=4, collapse=False, includehidden=True) %}
{% set toctree = toctree(maxdepth=4, collapse=theme_collapse_navigation, includehidden=True) %}
{% if toctree %}
{{ toctree }}
{% else %}
Expand All @@ -132,8 +144,10 @@
<div class="wy-nav-content">
<div class="rst-content">
{% include "breadcrumbs.html" %}
<div role="main" class="document">
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
{% block body %}{% endblock %}
</div>
</div>
{% include "footer.html" %}
</div>
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

42 changes: 30 additions & 12 deletions readthedocs/templates/sphinx/sphinx_rtd_theme/static/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ $(document).ready(function() {
$("table.docutils:not(.field-list)").wrap("<div class='wy-table-responsive'></div>");

// Add expand links to all parents of nested ul
$('.wy-menu-vertical ul').siblings('a').each(function () {
$('.wy-menu-vertical ul').not('.simple').siblings('a').each(function () {
var link = $(this);
expand = $('<span class="toctree-expand"></span>');
expand.on('click', function (ev) {
Expand All @@ -49,29 +49,30 @@ window.SphinxRtdTheme = (function (jquery) {
var navBar,
win,
winScroll = false,
winResize = false,
linkScroll = false,
winPosition = 0,
winHeight,
docHeight,
enable = function () {
init();
reset();
win.on('hashchange', reset);

// Set scrolling
// Set scroll monitor
win.on('scroll', function () {
if (!linkScroll) {
winScroll = true;
}
});
setInterval(function () {
if (winScroll) {
winScroll = false;
var newWinPosition = win.scrollTop(),
navPosition = navBar.scrollTop(),
newNavPosition = navPosition + (newWinPosition - winPosition);
navBar.scrollTop(newNavPosition);
winPosition = newWinPosition;
}
}, 25);
setInterval(function () { if (winScroll) scroll(); }, 25);

// Set resize monitor
win.on('resize', function () {
winResize = true;
});
setInterval(function () { if (winResize) resize(); }, 25);
resize();
},
init = function () {
navBar = jquery('nav.wy-nav-side:first');
Expand All @@ -95,6 +96,23 @@ window.SphinxRtdTheme = (function (jquery) {
}
}
},
scroll = function () {
winScroll = false;
var newWinPosition = win.scrollTop(),
winBottom = newWinPosition + winHeight,
navPosition = navBar.scrollTop(),
newNavPosition = navPosition + (newWinPosition - winPosition);
if (newWinPosition < 0 || winBottom > docHeight) {
return;
}
navBar.scrollTop(newNavPosition);
winPosition = newWinPosition;
},
resize = function () {
winResize = false;
winHeight = win.height();
docHeight = $(document).height();
},
hashChange = function () {
linkScroll = true;
win.one('hashchange', function () {
Expand Down
2 changes: 2 additions & 0 deletions readthedocs/templates/sphinx/sphinx_rtd_theme/theme.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ typekit_id = hiw1hhg
analytics_id =
sticky_navigation = False
logo_only =
collapse_navigation = False
display_version = True