Browse Source

Update sphinx_rtd_theme

Tatsuhiro Tsujikawa 10 years ago
parent
commit
c63e315d3b
21 changed files with 256 additions and 171 deletions
  1. 1 1
      doc/sphinx_themes/sphinx_rtd_theme/__init__.py
  2. 21 13
      doc/sphinx_themes/sphinx_rtd_theme/breadcrumbs.html
  3. 17 1
      doc/sphinx_themes/sphinx_rtd_theme/footer.html
  4. 43 28
      doc/sphinx_themes/sphinx_rtd_theme/layout.html
  5. 0 0
      doc/sphinx_themes/sphinx_rtd_theme/static/css/badge_only.css.map
  6. 0 0
      doc/sphinx_themes/sphinx_rtd_theme/static/css/theme.css
  7. 0 0
      doc/sphinx_themes/sphinx_rtd_theme/static/css/theme.css.map
  8. BIN
      doc/sphinx_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf
  9. BIN
      doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Inconsolata-Bold.ttf
  10. BIN
      doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Inconsolata-Regular.ttf
  11. BIN
      doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Inconsolata.ttf
  12. BIN
      doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Lato-Bold.ttf
  13. BIN
      doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Lato-Regular.ttf
  14. BIN
      doc/sphinx_themes/sphinx_rtd_theme/static/fonts/RobotoSlab-Bold.ttf
  15. BIN
      doc/sphinx_themes/sphinx_rtd_theme/static/fonts/RobotoSlab-Regular.ttf
  16. BIN
      doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot
  17. 22 21
      doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.svg
  18. BIN
      doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf
  19. BIN
      doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff
  20. 150 107
      doc/sphinx_themes/sphinx_rtd_theme/static/js/theme.js
  21. 2 0
      doc/sphinx_themes/sphinx_rtd_theme/theme.conf

+ 1 - 1
doc/sphinx_themes/sphinx_rtd_theme/__init__.py

@@ -5,7 +5,7 @@ From https://github.com/ryan-roemer/sphinx-bootstrap-theme.
 """
 import os
 
-VERSION = (0, 1, 8)
+VERSION = (0, 1, 9)
 
 __version__ = ".".join(str(v) for v in VERSION)
 __version_full__ = __version__

+ 21 - 13
doc/sphinx_themes/sphinx_rtd_theme/breadcrumbs.html

@@ -1,23 +1,31 @@
+{# Support for Sphinx 1.3+ page_source_suffix, but don't break old builds. #}
+
+{% if page_source_suffix %} 
+{% set suffix = page_source_suffix %}
+{% else %}
+{% set suffix = source_suffix %}
+{% endif %}
+
 <div role="navigation" aria-label="breadcrumbs navigation">
   <ul class="wy-breadcrumbs">
     <li><a href="{{ pathto(master_doc) }}">Docs</a> &raquo;</li>
       {% for doc in parents %}
-          <li><a href="{{ doc.link|e }}">{{ doc.title }}</a> &raquo;</li>
+        <li><a href="{{ doc.link|e }}">{{ doc.title }}</a> &raquo;</li>
       {% endfor %}
     <li>{{ title }}</li>
-      <li class="wy-breadcrumbs-aside">
-        {% if pagename != "search" %}
-          {% if display_github %}
-            <a href="https://{{ github_host|default("github.com") }}/{{ github_user }}/{{ github_repo }}/blob/{{ github_version }}{{ conf_py_path }}{{ pagename }}{{ source_suffix }}" class="fa fa-github"> Edit on GitHub</a>
-          {% elif display_bitbucket %}
-            <a href="https://bitbucket.org/{{ bitbucket_user }}/{{ bitbucket_repo }}/src/{{ bitbucket_version}}{{ conf_py_path }}{{ pagename }}{{ source_suffix }}" class="fa fa-bitbucket"> Edit on Bitbucket</a>
-          {% elif show_source and source_url_prefix %}
-            <a href="{{ source_url_prefix }}{{ pagename }}{{ source_suffix }}">View page source</a>
-          {% elif show_source and has_source and sourcename %}
-            <a href="{{ pathto('_sources/' + sourcename, true)|e }}" rel="nofollow"> View page source</a>
-          {% endif %}
+    <li class="wy-breadcrumbs-aside">
+      {% if pagename != "search" %}
+        {% if display_github %}
+          <a href="https://{{ github_host|default("github.com") }}/{{ github_user }}/{{ github_repo }}/blob/{{ github_version }}{{ conf_py_path }}{{ pagename }}{{ suffix }}" class="fa fa-github"> Edit on GitHub</a>
+        {% elif display_bitbucket %}
+          <a href="https://bitbucket.org/{{ bitbucket_user }}/{{ bitbucket_repo }}/src/{{ bitbucket_version}}{{ conf_py_path }}{{ pagename }}{{ suffix }}" class="fa fa-bitbucket"> Edit on Bitbucket</a>
+        {% elif show_source and source_url_prefix %}
+          <a href="{{ source_url_prefix }}{{ pagename }}{{ suffix }}">View page source</a>
+        {% elif show_source and has_source and sourcename %}
+          <a href="{{ pathto('_sources/' + sourcename, true)|e }}" rel="nofollow"> View page source</a>
         {% endif %}
-      </li>
+      {% endif %}
+    </li>
   </ul>
   <hr/>
 </div>

+ 17 - 1
doc/sphinx_themes/sphinx_rtd_theme/footer.html

@@ -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>
 
@@ -32,5 +46,7 @@
   {% trans %}Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>{% endtrans %}.
   {%- endif %}
 
+  {%- block extrafooter %} {% endblock %}
+
 </footer>
 

+ 43 - 28
doc/sphinx_themes/sphinx_rtd_theme/layout.html

@@ -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>
 
@@ -85,38 +85,51 @@
 
     {# SIDE NAV, TOGGLES ON MOBILE #}
     <nav data-toggle="wy-nav-shift" class="wy-nav-side">
-      <div class="wy-side-nav-search">
-        {% block sidebartitle %}
+      <div class="wy-side-scroll">
+        <div class="wy-side-nav-search">
+          {% block sidebartitle %}
 
-        {% if logo and theme_logo_only %}
-          <a href="{{ pathto(master_doc) }}">
-        {% else %}
-          <a href="{{ pathto(master_doc) }}" class="icon icon-home"> {{ project }}
-        {% endif %}
+          {% if logo and theme_logo_only %}
+            <a href="{{ pathto(master_doc) }}">
+          {% else %}
+            <a href="{{ pathto(master_doc) }}" class="icon icon-home"> {{ project }}
+          {% endif %}
 
-        {% if logo %}
-          {# Not strictly valid HTML, but it's the only way to display/scale it properly, without weird scripting or heaps of work #}
-          <img src="{{ pathto('_static/' + logo, 1) }}" class="logo" />
-        {% endif %}
-        </a>
+          {% if logo %}
+            {# Not strictly valid HTML, but it's the only way to display/scale it properly, without weird scripting or heaps of work #}
+            <img src="{{ pathto('_static/' + logo, 1) }}" class="logo" />
+          {% 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" %}
+          {% include "searchbox.html" %}
 
-        {% endblock %}
-      </div>
+          {% 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) %}
-          {% if toctree %}
-              {{ toctree }}
-          {% else %}
-              <!-- Local TOC -->
-              <div class="local-toc">{{ toc }}</div>
-          {% endif %}
-        {% endblock %}
+        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
+          {% block menu %}
+            {% set toctree = toctree(maxdepth=4, collapse=theme_collapse_navigation, includehidden=True) %}
+            {% if toctree %}
+                {{ toctree }}
+            {% else %}
+                <!-- Local TOC -->
+                <div class="local-toc">{{ toc }}</div>
+            {% endif %}
+          {% endblock %}
+        </div>
       </div>
-      &nbsp;
     </nav>
 
     <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
@@ -132,8 +145,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>

File diff suppressed because it is too large
+ 0 - 0
doc/sphinx_themes/sphinx_rtd_theme/static/css/badge_only.css.map


File diff suppressed because it is too large
+ 0 - 0
doc/sphinx_themes/sphinx_rtd_theme/static/css/theme.css


File diff suppressed because it is too large
+ 0 - 0
doc/sphinx_themes/sphinx_rtd_theme/static/css/theme.css.map


BIN
doc/sphinx_themes/sphinx_rtd_theme/static/fonts/FontAwesome.otf


BIN
doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Inconsolata-Bold.ttf


BIN
doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Inconsolata-Regular.ttf


BIN
doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Inconsolata.ttf


BIN
doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Lato-Bold.ttf


BIN
doc/sphinx_themes/sphinx_rtd_theme/static/fonts/Lato-Regular.ttf


BIN
doc/sphinx_themes/sphinx_rtd_theme/static/fonts/RobotoSlab-Bold.ttf


BIN
doc/sphinx_themes/sphinx_rtd_theme/static/fonts/RobotoSlab-Regular.ttf


BIN
doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.eot


File diff suppressed because it is too large
+ 22 - 21
doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.svg


BIN
doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.ttf


BIN
doc/sphinx_themes/sphinx_rtd_theme/static/fonts/fontawesome-webfont.woff


+ 150 - 107
doc/sphinx_themes/sphinx_rtd_theme/static/js/theme.js

@@ -1,113 +1,156 @@
-function toggleCurrent (elem) {
-    var parent_li = elem.closest('li');
-    parent_li.siblings('li.current').removeClass('current');
-    parent_li.siblings().find('li.current').removeClass('current');
-    parent_li.find('> ul li.current').removeClass('current');
-    parent_li.toggleClass('current');
-}
+require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"sphinx-rtd-theme":[function(require,module,exports){
+var jQuery = (typeof(window) != 'undefined') ? window.jQuery : require('jquery');
 
-$(document).ready(function() {
-    // Shift nav in mobile when clicking the menu.
-    $(document).on('click', "[data-toggle='wy-nav-top']", function() {
-        $("[data-toggle='wy-nav-shift']").toggleClass("shift");
-        $("[data-toggle='rst-versions']").toggleClass("shift");
-    });
-    // Nav menu link click operations
-    $(document).on('click', ".wy-menu-vertical .current ul li a", function() {
-        var target = $(this);
-        // Close menu when you click a link.
-        $("[data-toggle='wy-nav-shift']").removeClass("shift");
-        $("[data-toggle='rst-versions']").toggleClass("shift");
-        // Handle dynamic display of l3 and l4 nav lists
-        toggleCurrent(target);
-        if (typeof(window.SphinxRtdTheme) != 'undefined') {
-            window.SphinxRtdTheme.StickyNav.hashChange();
-        }
-    });
-    $(document).on('click', "[data-toggle='rst-current-version']", function() {
-        $("[data-toggle='rst-versions']").toggleClass("shift-up");
-    });
-    // Make tables responsive
-    $("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 () {
-        var link = $(this);
-            expand = $('<span class="toctree-expand"></span>');
-        expand.on('click', function (ev) {
-            toggleCurrent(link);
-            ev.stopPropagation();
-            return false;
-        });
-        link.prepend(expand);
-    });
-});
-
-// Sphinx theme state
-window.SphinxRtdTheme = (function (jquery) {
-    var stickyNav = (function () {
-        var navBar,
-            win,
-            winScroll = false,
-            linkScroll = false,
-            winPosition = 0,
-            enable = function () {
-                init();
-                reset();
-                win.on('hashchange', reset);
-
-                // Set scrolling
-                win.on('scroll', function () {
-                    if (!linkScroll) {
-                        winScroll = true;
+// Sphinx theme nav state
+function ThemeNav () {
+
+    var nav = {
+        navBar: null,
+        win: null,
+        winScroll: false,
+        winResize: false,
+        linkScroll: false,
+        winPosition: 0,
+        winHeight: null,
+        docHeight: null,
+        isRunning: false
+    };
+
+    nav.enable = function () {
+        var self = this;
+
+        if (!self.isRunning) {
+            self.isRunning = true;
+            jQuery(function ($) {
+                self.init($);
+
+                self.reset();
+                self.win.on('hashchange', self.reset);
+
+                // Set scroll monitor
+                self.win.on('scroll', function () {
+                    if (!self.linkScroll) {
+                        self.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);
-            },
-            init = function () {
-                navBar = jquery('nav.wy-nav-side:first');
-                win = jquery(window);
-            },
-            reset = function () {
-                // Get anchor from URL and open up nested nav
-                var anchor = encodeURI(window.location.hash);
-                if (anchor) {
-                    try {
-                        var link = $('.wy-menu-vertical')
-                            .find('[href="' + anchor + '"]');
-                        $('.wy-menu-vertical li.toctree-l1 li.current')
-                            .removeClass('current');
-                        link.closest('li.toctree-l2').addClass('current');
-                        link.closest('li.toctree-l3').addClass('current');
-                        link.closest('li.toctree-l4').addClass('current');
-                    }
-                    catch (err) {
-                        console.log("Error expanding nav for anchor", err);
-                    }
-                }
-            },
-            hashChange = function () {
-                linkScroll = true;
-                win.one('hashchange', function () {
-                    linkScroll = false;
+                setInterval(function () { if (self.winScroll) self.onScroll(); }, 25);
+
+                // Set resize monitor
+                self.win.on('resize', function () {
+                    self.winResize = true;
                 });
-            };
-        jquery(init);
-        return {
-            enable: enable,
-            hashChange: hashChange
+                setInterval(function () { if (self.winResize) self.onResize(); }, 25);
+                self.onResize();
+            });
         };
-    }());
-    return {
-        StickyNav: stickyNav
     };
-}($));
+
+    nav.init = function ($) {
+        var doc = $(document),
+            self = this;
+
+        this.navBar = $('div.wy-side-scroll:first');
+        this.win = $(window);
+
+        // Set up javascript UX bits
+        $(document)
+            // Shift nav in mobile when clicking the menu.
+            .on('click', "[data-toggle='wy-nav-top']", function() {
+                $("[data-toggle='wy-nav-shift']").toggleClass("shift");
+                $("[data-toggle='rst-versions']").toggleClass("shift");
+            })
+
+            // Nav menu link click operations
+            .on('click', ".wy-menu-vertical .current ul li a", function() {
+                var target = $(this);
+                // Close menu when you click a link.
+                $("[data-toggle='wy-nav-shift']").removeClass("shift");
+                $("[data-toggle='rst-versions']").toggleClass("shift");
+                // Handle dynamic display of l3 and l4 nav lists
+                self.toggleCurrent(target);
+                self.hashChange();
+            })
+            .on('click', "[data-toggle='rst-current-version']", function() {
+                $("[data-toggle='rst-versions']").toggleClass("shift-up");
+            })
+
+        // Make tables responsive
+        $("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').not('.simple').siblings('a').each(function () {
+            var link = $(this);
+                expand = $('<span class="toctree-expand"></span>');
+            expand.on('click', function (ev) {
+                self.toggleCurrent(link);
+                ev.stopPropagation();
+                return false;
+            });
+            link.prepend(expand);
+        });
+    };
+
+    nav.reset = function () {
+        // Get anchor from URL and open up nested nav
+        var anchor = encodeURI(window.location.hash);
+        if (anchor) {
+            try {
+                var link = $('.wy-menu-vertical')
+                    .find('[href="' + anchor + '"]');
+                $('.wy-menu-vertical li.toctree-l1 li.current')
+                    .removeClass('current');
+                link.closest('li.toctree-l2').addClass('current');
+                link.closest('li.toctree-l3').addClass('current');
+                link.closest('li.toctree-l4').addClass('current');
+            }
+            catch (err) {
+                console.log("Error expanding nav for anchor", err);
+            }
+        }
+    };
+
+    nav.onScroll = function () {
+        this.winScroll = false;
+        var newWinPosition = this.win.scrollTop(),
+            winBottom = newWinPosition + this.winHeight,
+            navPosition = this.navBar.scrollTop(),
+            newNavPosition = navPosition + (newWinPosition - this.winPosition);
+        if (newWinPosition < 0 || winBottom > this.docHeight) {
+            return;
+        }
+        this.navBar.scrollTop(newNavPosition);
+        this.winPosition = newWinPosition;
+    };
+
+    nav.onResize = function () {
+        this.winResize = false;
+        this.winHeight = this.win.height();
+        this.docHeight = $(document).height();
+    };
+
+    nav.hashChange = function () {
+        this.linkScroll = true;
+        this.win.one('hashchange', function () {
+            this.linkScroll = false;
+        });
+    };
+
+    nav.toggleCurrent = function (elem) {
+        var parent_li = elem.closest('li');
+        parent_li.siblings('li.current').removeClass('current');
+        parent_li.siblings().find('li.current').removeClass('current');
+        parent_li.find('> ul li.current').removeClass('current');
+        parent_li.toggleClass('current');
+    }
+
+    return nav;
+};
+
+module.exports.ThemeNav = ThemeNav();
+
+if (typeof(window) != 'undefined') {
+    window.SphinxRtdTheme = { StickyNav: module.exports.ThemeNav };
+}
+
+},{"jquery":"jquery"}]},{},["sphinx-rtd-theme"]);

+ 2 - 0
doc/sphinx_themes/sphinx_rtd_theme/theme.conf

@@ -7,3 +7,5 @@ typekit_id = hiw1hhg
 analytics_id = 
 sticky_navigation = False
 logo_only =
+collapse_navigation = False
+display_version = True

Some files were not shown because too many files changed in this diff