Skip to content

Commit 4958e02

Browse files
Adding sexy doc theme ;)
[ci skip]
1 parent 31efb0c commit 4958e02

26 files changed

+12373
-0
lines changed

docs/_static/custom.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.section {
2+
margin-bottom: 30px !important;
3+
}
4+
5+
div.tip {
6+
color: #3a87ad; /* Basicstrap CSS was messed up so override it */
7+
}

docs/_themes/basicstrap/layout.html

Lines changed: 325 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,325 @@
1+
{#
2+
basicstrap/layout.html
3+
~~~~~~~~~~~~~~~~~~~~~~~~~
4+
5+
Master layout template for Sphinx themes. on Twitter Bootstrap
6+
7+
:copyright: Copyright 2012 by tell-k.
8+
:license: MIT Licence, see LICENSE for details.
9+
#}
10+
{%- block doctype -%}
11+
<!DOCTYPE html>
12+
{%- endblock %}
13+
{%- set reldelim1 = reldelim1 is not defined and ' &raquo;' or reldelim1 %}
14+
{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %}
15+
{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and
16+
(sidebars != []) %}
17+
{%- set url_root = pathto('', 1) %}
18+
{# XXX necessary? #}
19+
{%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
20+
{%- if not embedded and docstitle %}
21+
{%- set titlesuffix = " &mdash; "|safe + docstitle|e %}
22+
{%- else %}
23+
{%- set titlesuffix = "" %}
24+
{%- endif %}
25+
26+
{%- macro relbar() %}
27+
<div class="related navbar {% if (theme_relbar_inverse|tobool) %}navbar-inverse{% endif %}">
28+
<div class="navbar-inner">
29+
<ul class="nav pull-right">
30+
{% if not (theme_nosidebar|tobool) %}
31+
{%- for rellink in rellinks %}
32+
<li><a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}" {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a></li>
33+
{%- endfor %}
34+
{%- block rootrellink %}
35+
<li><a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a></li>
36+
{%- endblock %}
37+
{%- for parent in parents %}
38+
<li><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a></li>
39+
{%- endfor %}
40+
{%- block relbaritems %} {% endblock %}
41+
{% else %}
42+
{%- if prev %}
43+
<li><a href="{{ prev.link|e }}"><i class="icon icon-double-angle-left"></i>&nbsp;{{ prev.title }}</a></li>
44+
{%- endif %}
45+
<li><a class="uplink" href="{{ pathto(master_doc) }}">{{ _('Contents') }}</a></li>
46+
{%- if next %}
47+
<li><a href="{{ next.link|e }}">{{ next.title }}&nbsp;<i class="icon icon-double-angle-right"></i></a></li>
48+
{%- endif %}
49+
{%- endif %}
50+
</ul>
51+
</div>
52+
</div>
53+
{%- endmacro %}
54+
55+
{%- macro sidebar(for_mobile=False) %}
56+
{%- if render_sidebar %}
57+
<div class="span{{ theme_sidebar_span }} {% if not (for_mobile|tobool) %}visible-desktop visible-tablet{% endif %}">
58+
{%- if (for_mobile|tobool) and (not theme_noresponsive|tobool) %}
59+
<a class="visible-phone btn btn-small show-sidebar" data-toggle="collapse" data-target=".for-mobile">Open Table Of Contents</a>
60+
{%- endif %}
61+
<div class="{% if (for_mobile|tobool) %}for-mobile{% endif %} sidebar hidden-phone">
62+
{%- block sidebarlogo %}
63+
{%- if logo %}
64+
<p class="logo"><a href="{{ pathto(master_doc) }}">
65+
<img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
66+
</a></p>
67+
{%- endif %}
68+
{%- endblock %}
69+
{%- if sidebars != None %}
70+
{#- new style sidebar: explicitly include/exclude templates #}
71+
{%- for sidebartemplate in sidebars %}
72+
{%- include sidebartemplate %}
73+
{%- endfor %}
74+
{%- else %}
75+
{#- old style sidebars: using blocks -- should be deprecated #}
76+
{%- block sidebartoc %}
77+
{%- include "localtoc.html" %}
78+
{%- endblock %}
79+
{%- block sidebarrel %}
80+
{%- include "relations.html" %}
81+
{%- endblock %}
82+
{%- block sidebarsourcelink %}
83+
{%- include "sourcelink.html" %}
84+
{%- endblock %}
85+
{%- if customsidebar %}
86+
{%- include customsidebar %}
87+
{%- endif %}
88+
{%- block sidebarsearch %}
89+
{%- include "searchbox.html" %}
90+
{%- endblock %}
91+
{%- endif %}
92+
</div>
93+
</div>
94+
{%- endif %}
95+
{%- endmacro %}
96+
97+
{% set script_files = script_files + ['_static/js/bootstrap.min.js'] %}
98+
{%- macro script() %}
99+
<script type="text/javascript">
100+
var DOCUMENTATION_OPTIONS = {
101+
URL_ROOT: '{{ url_root }}',
102+
VERSION: '{{ release|e }}',
103+
COLLAPSE_INDEX: false,
104+
FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
105+
HAS_SOURCE: {{ has_source|lower }}
106+
};
107+
</script>
108+
{%- for scriptfile in script_files %}
109+
{%- if scriptfile == '_static/jquery.js' %}
110+
<script type="text/javascript" src="{{ pathto('_static/js/jquery.min.js', 1) }}"></script>
111+
{%- else %}
112+
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
113+
{%- endif %}
114+
{%- endfor %}
115+
<script type="text/javascript">
116+
$(document).ready(function(){
117+
$('.show-sidebar').click(function(e) {
118+
e.preventDefault();
119+
if ($(".show-sidebar").html() == "Open Table Of Contents") {
120+
$('.for-mobile').removeClass('hidden-phone');
121+
$(".show-sidebar").html("Close Table Of Contents");
122+
} else {
123+
$(".show-sidebar").html("Open Table Of Contents");
124+
}
125+
});
126+
});
127+
</script>
128+
{%- endmacro %}
129+
130+
{%- macro css() %}
131+
{%- if (theme_googlewebfont|tobool) %}
132+
<link rel="stylesheet" href="{{ pathto(theme_googlewebfont_url, 1) }}" type="text/css" />
133+
{%- endif %}
134+
<link rel="stylesheet" href="{{ pathto('_static/css/basicstrap-base.css', 1) }}" type="text/css" />
135+
{%- if (theme_inner_theme|tobool) %}
136+
<link rel="stylesheet" href="{{ pathto('_static/css/' + theme_inner_theme_name + '.css', 1) }}" type="text/css" />
137+
{%- else %}
138+
<link rel="stylesheet" href="{{ pathto('_static/css/bootstrap.min.css', 1) }}" type="text/css" />
139+
{%- endif %}
140+
<link rel="stylesheet" href="{{ pathto('_static/css/font-awesome.min.css', 1) }}">
141+
<!--[if IE 7]>
142+
<link rel="stylesheet" href="{{ pathto('_static/css/font-awesome-ie7.min.css', 1) }}">
143+
<![endif]-->
144+
<style type="text/css">
145+
body {
146+
padding-top: 60px;
147+
padding-bottom: 40px;
148+
}
149+
}
150+
</style>
151+
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
152+
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
153+
<link rel="stylesheet" href="{{ pathto('_static/custom.css', 1) }}">
154+
{%- for cssfile in css_files %}
155+
<link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
156+
{%- endfor %}
157+
{%- if (not theme_noresponsive|tobool) %}
158+
<link rel="stylesheet" href="{{ pathto('_static/css/bootstrap-responsive.min.css', 1) }}" type="text/css" />
159+
{%- endif %}
160+
{%- endmacro %}
161+
162+
<html lang="{{ theme_lang }}">
163+
<head>
164+
<meta charset="{{ encoding }}" />
165+
{{ metatags }}
166+
{%- block htmltitle %}
167+
<title>{{ title|striptags|e }}{{ titlesuffix }}</title>
168+
{%- endblock %}
169+
170+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
171+
<meta name="description" content="">
172+
<meta name="author" content="">
173+
174+
{{ css() }}
175+
{%- if not embedded %}
176+
{{ script() }}
177+
{%- if use_opensearch %}
178+
<link rel="search" type="application/opensearchdescription+xml"
179+
title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}"
180+
href="{{ pathto('_static/opensearch.xml', 1) }}"/>
181+
{%- endif %}
182+
{%- if favicon %}
183+
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
184+
{%- endif %}
185+
{%- endif %}
186+
{%- block linktags %}
187+
{%- if hasdoc('about') %}
188+
<link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" />
189+
{%- endif %}
190+
{%- if hasdoc('genindex') %}
191+
<link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" />
192+
{%- endif %}
193+
{%- if hasdoc('search') %}
194+
<link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" />
195+
{%- endif %}
196+
{%- if hasdoc('copyright') %}
197+
<link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" />
198+
{%- endif %}
199+
<link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}" />
200+
{%- if parents %}
201+
<link rel="up" title="{{ parents[-1].title|striptags|e }}" href="{{ parents[-1].link|e }}" />
202+
{%- endif %}
203+
{%- if next %}
204+
<link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}" />
205+
{%- endif %}
206+
{%- if prev %}
207+
<link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" />
208+
{%- endif %}
209+
{%- endblock %}
210+
{%- block extrahead %} {% endblock %}
211+
</head>
212+
<body>
213+
214+
{%- block header %}
215+
<div class="navbar navbar-fixed-top {% if (theme_header_inverse|tobool) %}navbar-inverse{% endif %}">
216+
<div class="navbar-inner">
217+
<div class="{% if (not theme_nav_fixed|tobool) %}container-fluid{% else %}container{% endif %}">
218+
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
219+
<span class="icon-bar"></span>
220+
<span class="icon-bar"></span>
221+
<span class="icon-bar"></span>
222+
</a>
223+
<a class="brand" href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>
224+
<div class="nav-collapse collapse">
225+
<ul class="nav pull-right">
226+
{% if not (theme_nosidebar|tobool) %}
227+
{%- for rellink in rellinks %}
228+
<li>
229+
<a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}" {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
230+
</li>
231+
{%- endfor %}
232+
{%- for parent in parents %}
233+
<li>
234+
<a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>
235+
</li>
236+
{%- endfor %}
237+
{% else %}
238+
{%- if prev %}
239+
<li><a href="{{ prev.link|e }}"><i class="icon icon-double-angle-left"></i>&nbsp;{{ prev.title }}</a></li>
240+
{%- endif %}
241+
<li><a class="uplink" href="{{ pathto(master_doc) }}">{{ _('Contents') }}</a></li>
242+
{%- if next %}
243+
<li><a href="{{ next.link|e }}">{{ next.title }}&nbsp;<i class="icon icon-double-angle-right"></i></a></li>
244+
{%- endif %}
245+
{%- endif %}
246+
</ul>
247+
</div>
248+
</div>
249+
</div>
250+
</div>
251+
{% endblock %}
252+
253+
<!-- container -->
254+
<div class="{% if (not theme_content_fixed|tobool) %}container-fluid{% else %}container{% endif %}">
255+
256+
257+
{% if not theme_noresponsive|tobool %}
258+
<div class="{% if (not theme_row_fixed|tobool) %}row-fluid{% else %}row{% endif %} hidden-desktop hidden-tablet">
259+
{{ sidebar(for_mobile=True) }}
260+
</div>
261+
{% endif %}
262+
263+
<!-- row -->
264+
<div class="{% if (not theme_row_fixed|tobool) %}row-fluid{% else %}row{% endif %}">
265+
{%- block content %}
266+
267+
{%- block sidebar1 %}
268+
{% if (not theme_rightsidebar|tobool) %} {{ sidebar() }} {% endif %}
269+
{% endblock %}
270+
271+
<div class="{% if (not theme_nosidebar|tobool) %}span{{ 12 - theme_sidebar_span|int }}{% else %}span12{% endif %}">
272+
<div class="document">
273+
{%- block document %}
274+
<div class="documentwrapper">
275+
{%- if render_sidebar %}
276+
<div class="bodywrapper">
277+
{%- endif %}
278+
<div class="body">
279+
{% block body %} {% endblock %}
280+
</div>
281+
{%- if render_sidebar %}
282+
</div>
283+
{%- endif %}
284+
</div>
285+
{%- endblock %}
286+
</div>
287+
</div>
288+
289+
{%- block sidebar2 %}
290+
{% if (theme_rightsidebar|tobool) %} {{ sidebar() }} {% endif %}
291+
{% endblock %}
292+
293+
{%- endblock %}{# /content block #}
294+
</div><!-- /row -->
295+
296+
<!-- row -->
297+
<div class="{% if (not theme_row_fixed|tobool) %}row-fluid{% else %}row{% endif %}">
298+
{%- block relbar2 %}{{ relbar() }}{% endblock %}
299+
</div><!-- /row -->
300+
301+
<!-- footer -->
302+
{%- block footer %}
303+
<footer>
304+
{%- if show_copyright %}
305+
{%- if hasdoc('copyright') %}
306+
{% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %}
307+
{%- else %}
308+
{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}.{% endtrans %}
309+
{%- endif %}
310+
{%- endif %}
311+
{%- if last_updated %}
312+
{% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
313+
{%- endif %}
314+
{%- if show_sphinx %}
315+
{% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}
316+
{%- endif %}
317+
</footer>
318+
{%- endblock %}
319+
<!-- /footer -->
320+
321+
</div>
322+
<!-- /container -->
323+
324+
</body>
325+
</html>

docs/_themes/basicstrap/search.html

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{#
2+
basicstrap/search.html
3+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
4+
5+
Template for the search page.
6+
7+
:copyright: Copyright 2012 by tell-k.
8+
:license: MIT Licence, see LICENSE for details.
9+
#}
10+
{% extends "layout.html" %}
11+
{% set title = _('Search') %}
12+
{% set script_files = script_files + ['_static/searchtools.js'] %}
13+
{% block extrahead %}
14+
<script type="text/javascript">
15+
jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });
16+
</script>
17+
{{ super() }}
18+
{% endblock %}
19+
{% block body %}
20+
<h1 id="search-documentation">{{ _('Search') }}</h1>
21+
<div id="fallback" class="admonition warning">
22+
<script type="text/javascript">$('#fallback').hide();</script>
23+
<p>
24+
{% trans %}Please activate JavaScript to enable the search
25+
functionality.{% endtrans %}
26+
</p>
27+
</div>
28+
<p>
29+
{% trans %}From here you can search these documents. Enter your search
30+
words into the box below and click "search". Note that the search
31+
function will automatically search for all of the words. Pages
32+
containing fewer words won't appear in the result list.{% endtrans %}
33+
</p>
34+
<form class="form-search" action="" method="get">
35+
<div class="input-append">
36+
<input type="text" class="search-query" name="q" value="">
37+
<input type="submit" class="btn" value="{{ _('search') }}" />
38+
</div>
39+
<span id="search-progress" style="padding-left: 10px"></span>
40+
</form>
41+
{% if search_performed %}
42+
<h2>{{ _('Search Results') }}</h2>
43+
{% if not search_results %}
44+
<p>{{ _('Your search did not match any results.') }}</p>
45+
{% endif %}
46+
{% endif %}
47+
<div id="search-results">
48+
{% if search_results %}
49+
<ul>
50+
{% for href, caption, context in search_results %}
51+
<li><a href="{{ pathto(item.href) }}">{{ caption }}</a>
52+
<div class="context">{{ context|e }}</div>
53+
</li>
54+
{% endfor %}
55+
</ul>
56+
{% endif %}
57+
</div>
58+
{% endblock %}

0 commit comments

Comments
 (0)