diff --git a/README.rst b/README.rst index 1ba79624..3c3d3d4c 100644 --- a/README.rst +++ b/README.rst @@ -13,3 +13,11 @@ trust. To use the theme, install it into your docs build environment via ``pip``:: pip install python-docs-theme + +Configuring the options the conf.py holds +------------------------------------------ + +For implementing the theme you should +- enable `html_theme = 'python_docs_theme'` +- html_sidebars: + - Defaults taken from http://www.sphinx-doc.org/en/stable/config.html#confval-html_sidebars diff --git a/python_docs_theme/layout.html b/python_docs_theme/layout.html index 822e6eda..9c6ab3ed 100644 --- a/python_docs_theme/layout.html +++ b/python_docs_theme/layout.html @@ -7,11 +7,13 @@ {% if theme_root_include_title %} {{ shorttitle }}{{ reldelim1 }} {% endif %} + {% endblock %} {%- macro searchbox() %} {# modified from sphinx/themes/basic/searchbox.html #} {%- if builder != "htmlhelp" %} +
+
{%- endif %} {%- endmacro %} @@ -37,6 +40,7 @@ {% block extrahead %} + {% if builder != "htmlhelp" %} {% if not embedded %}{% endif %} {% endif %} @@ -53,6 +57,7 @@ {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %} {% if theme_issues_url %}{% trans pathto_bugs=theme_issues_url %}Found a bug?{% endtrans %}{% endif %} + {% if python_version %} This document is about an unsupported version of Python. Please check the doc about Python 3.7. {% endif %}
{% trans sphinx_version=sphinx_version|e %}Created using Sphinx {{ sphinx_version }}.{% endtrans %} diff --git a/python_docs_theme/static/pydoctheme.css b/python_docs_theme/static/pydoctheme.css index 33f74d79..f85f405d 100644 --- a/python_docs_theme/static/pydoctheme.css +++ b/python_docs_theme/static/pydoctheme.css @@ -22,6 +22,14 @@ div.related:first-child { border-bottom: 1px solid #ccc; } +.flex.container { + display: flex; +} + +.fill-width { + flex: 1; +} + .inline-search { display: inline; } diff --git a/python_docs_theme/static/sidebar.js b/python_docs_theme/static/sidebar.js index 0680c6c8..8ed2d229 100644 --- a/python_docs_theme/static/sidebar.js +++ b/python_docs_theme/static/sidebar.js @@ -160,7 +160,9 @@ $(function() { add_sidebar_button(); var sidebarbutton = $('#sidebarbutton'); - set_position_from_cookie(); + if (jwindow.width > 768) { + set_position_from_cookie(); + } /* intelligent scrolling */