Skip to content
Closed
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
8 changes: 8 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions python_docs_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
{% if theme_root_include_title %}
<a href="{{ pathto('index') }}">{{ shorttitle }}</a>{{ reldelim1 }}
{% endif %}

{% endblock %}

{%- macro searchbox() %}
{# modified from sphinx/themes/basic/searchbox.html #}
{%- if builder != "htmlhelp" %}
<div class="flex-container">
<div class="inline-search" style="display: none" role="search">
<form class="inline-search" action="{{ pathto('search') }}" method="get">
<input placeholder="{{ _('Quick search') }}" type="text" name="q" />
Expand All @@ -20,6 +22,7 @@
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<script type="text/javascript">$('.inline-search').show(0);</script>
{%- endif %}
{%- endmacro %}
Expand All @@ -37,6 +40,7 @@

{% block extrahead %}
<link rel="shortcut icon" type="image/png" href="{{ pathto('_static/' + theme_root_icon, 1) }}" />
<meta name="viewport" content="width=device-width,initial-scale=0.8">
{% if builder != "htmlhelp" %}
{% if not embedded %}<script type="text/javascript" src="{{ pathto('_static/copybutton.js', 1) }}"></script>{% endif %}
{% endif %}
Expand All @@ -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 %}<a href="{{ theme_issues_url }}">Found a bug</a>?{% endtrans %}{% endif %}
{% if python_version %}<a href ="{{ python_version_recent }}"> This document is about an unsupported version of Python. Please check the doc about Python 3.7. </a>{% endif %}
<br />

{% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
Expand Down
8 changes: 8 additions & 0 deletions python_docs_theme/static/pydoctheme.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 3 additions & 1 deletion python_docs_theme/static/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down