aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2018-10-03 19:33:42 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2018-10-03 19:33:42 -0400
commitbabbc711b02bb5c58e0bb50edc61ef3adc22d2a3 (patch)
treed5ea3afb1775a88b1ed52c628a681034666220d2
parent9055282a969fb92c7d28bcbf83e23c65000155df (diff)
downloadexternal_python_mako-babbc711b02bb5c58e0bb50edc61ef3adc22d2a3.tar.gz
external_python_mako-babbc711b02bb5c58e0bb50edc61ef3adc22d2a3.tar.bz2
external_python_mako-babbc711b02bb5c58e0bb50edc61ef3adc22d2a3.zip
Revert "Remove built-in theme and start using zzzeeksphinx."
This reverts commit 9055282a969fb92c7d28bcbf83e23c65000155df.
-rw-r--r--doc/build/builder/__init__.py0
-rw-r--r--doc/build/builder/builders.py97
-rw-r--r--doc/build/builder/util.py12
-rw-r--r--doc/build/conf.py18
-rw-r--r--doc/build/requirements.txt6
-rw-r--r--doc/build/static/docs.css438
-rw-r--r--doc/build/static/makoLogo.pngbin0 -> 11715 bytes
-rw-r--r--doc/build/static/python-logo.gifbin0 -> 2549 bytes
-rw-r--r--doc/build/static/site.css86
-rw-r--r--doc/build/templates/base.mako56
-rw-r--r--doc/build/templates/genindex.mako77
-rw-r--r--doc/build/templates/layout.mako205
-rw-r--r--doc/build/templates/page.mako2
-rw-r--r--doc/build/templates/rtd_layout.mako37
-rw-r--r--doc/build/templates/search.mako25
15 files changed, 1048 insertions, 11 deletions
diff --git a/doc/build/builder/__init__.py b/doc/build/builder/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/doc/build/builder/__init__.py
diff --git a/doc/build/builder/builders.py b/doc/build/builder/builders.py
new file mode 100644
index 0000000..57c88ee
--- /dev/null
+++ b/doc/build/builder/builders.py
@@ -0,0 +1,97 @@
+from sphinx.application import TemplateBridge
+from sphinx.builders.html import StandaloneHTMLBuilder
+from sphinx.highlighting import PygmentsBridge
+from sphinx.jinja2glue import BuiltinTemplateLoader
+from pygments import highlight
+from pygments.lexer import RegexLexer, bygroups, using
+from pygments.token import *
+from pygments.filter import Filter, apply_filters
+from pygments.lexers import PythonLexer, PythonConsoleLexer
+from pygments.formatters import HtmlFormatter, LatexFormatter
+import re
+import os
+from mako.lookup import TemplateLookup
+from mako.template import Template
+from mako.ext.pygmentplugin import MakoLexer
+
+rtd = os.environ.get('READTHEDOCS', None) == 'True'
+
+class MakoBridge(TemplateBridge):
+ def init(self, builder, *args, **kw):
+ self.jinja2_fallback = BuiltinTemplateLoader()
+ self.jinja2_fallback.init(builder, *args, **kw)
+
+ builder.config.html_context['site_base'] = builder.config['site_base']
+
+ self.lookup = TemplateLookup(
+ directories=builder.config.templates_path,
+ imports=[
+ "from builder import util"
+ ],
+ #format_exceptions=True,
+ )
+
+ def render(self, template, context):
+ template = template.replace(".html", ".mako")
+ context['prevtopic'] = context.pop('prev', None)
+ context['nexttopic'] = context.pop('next', None)
+
+ # RTD layout
+ if rtd:
+ # add variables if not present, such
+ # as if local test of READTHEDOCS variable
+ if 'MEDIA_URL' not in context:
+ context['MEDIA_URL'] = "http://media.readthedocs.org/"
+ if 'slug' not in context:
+ context['slug'] = "mako-test-slug"
+ if 'url' not in context:
+ context['url'] = "/some/test/url"
+ if 'current_version' not in context:
+ context['current_version'] = "some_version"
+ if 'versions' not in context:
+ context['versions'] = [('default', '/default/')]
+
+ context['docs_base'] = "http://readthedocs.org"
+ context['toolbar'] = True
+ context['layout'] = "rtd_layout.mako"
+ context['pdf_url'] = "%spdf/%s/%s/%s.pdf" % (
+ context['MEDIA_URL'],
+ context['slug'],
+ context['current_version'],
+ context['slug']
+ )
+ # local docs layout
+ else:
+ context['toolbar'] = False
+ context['docs_base'] = "/"
+ context['layout'] = "layout.mako"
+
+ context.setdefault('_', lambda x:x)
+ return self.lookup.get_template(template).render_unicode(**context)
+
+ def render_string(self, template, context):
+ # this is used for .js, .css etc. and we don't have
+ # local copies of that stuff here so use the jinja render.
+ return self.jinja2_fallback.render_string(template, context)
+
+class StripDocTestFilter(Filter):
+ def filter(self, lexer, stream):
+ for ttype, value in stream:
+ if ttype is Token.Comment and re.match(r'#\s*doctest:', value):
+ continue
+ yield ttype, value
+
+
+def autodoc_skip_member(app, what, name, obj, skip, options):
+ if what == 'class' and skip and name == '__init__':
+ return False
+ else:
+ return skip
+
+def setup(app):
+# app.connect('autodoc-skip-member', autodoc_skip_member)
+ # Mako is already in Pygments, adding the local
+ # lexer here so that the latest syntax is available
+ app.add_lexer('mako', MakoLexer())
+ app.add_config_value('site_base', "", True)
+
diff --git a/doc/build/builder/util.py b/doc/build/builder/util.py
new file mode 100644
index 0000000..75a5c72
--- /dev/null
+++ b/doc/build/builder/util.py
@@ -0,0 +1,12 @@
+import re
+
+def striptags(text):
+ return re.compile(r'<[^>]*>').sub('', text)
+
+def go(m):
+ # .html with no anchor if present, otherwise "#" for top of page
+ return m.group(1) or '#'
+
+def strip_toplevel_anchors(text):
+ return re.compile(r'(\.html)?#[-\w]+-toplevel').sub(go, text)
+
diff --git a/doc/build/conf.py b/doc/build/conf.py
index 89c95d6..605af5a 100644
--- a/doc/build/conf.py
+++ b/doc/build/conf.py
@@ -30,8 +30,9 @@ import mako
#extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode',
# 'sphinx.ext.doctest', 'builder.builders']
-extensions = ['sphinx.ext.autodoc',
- 'changelog', 'sphinx_paramlinks', 'zzzeeksphinx']
+extensions = ['sphinx.ext.autodoc','sphinx.ext.intersphinx',
+ 'changelog', 'sphinx_paramlinks',
+ 'builder.builders']
changelog_render_ticket = "https://bitbucket.org/zzzeek/mako/issue/%s/"
@@ -46,14 +47,13 @@ templates_path = ['templates']
nitpicky = True
-
-site_base = os.environ.get("RTD_SITE_BASE", "http://www.makotemplates.org")
-site_adapter_template = "docs_adapter.mako"
-site_adapter_py = "docs_adapter.py"
+site_base = "http://www.makotemplates.org"
# The suffix of source filenames.
source_suffix = '.rst'
+template_bridge = "builder.builders.MakoBridge"
+
# The encoding of source files.
#source_encoding = 'utf-8-sig'
@@ -112,7 +112,7 @@ pygments_style = 'sphinx'
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
-html_theme = 'zsmako'
+html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
@@ -290,3 +290,7 @@ epub_copyright = u'Mako authors'
# Allow duplicate toc entries.
#epub_tocdup = True
+intersphinx_mapping = {
+ 'dogpilecache':('http://dogpilecache.readthedocs.org/en/latest', None),
+ 'beaker':('http://beaker.readthedocs.org/en/latest',None),
+}
diff --git a/doc/build/requirements.txt b/doc/build/requirements.txt
index 7b271b5..cc5dfbd 100644
--- a/doc/build/requirements.txt
+++ b/doc/build/requirements.txt
@@ -1,4 +1,2 @@
-git+https://bitbucket.org/zzzeek/changelog.git@HEAD#egg=changelog
-git+https://bitbucket.org/zzzeek/sphinx-paramlinks.git@HEAD#egg=sphinx-paramlinks
-git+https://bitbucket.org/zzzeek/zzzeeksphinx.git@HEAD#egg=zzzeeksphinx
-
+changelog>=0.3.4
+sphinx-paramlinks>=0.2.0
diff --git a/doc/build/static/docs.css b/doc/build/static/docs.css
new file mode 100644
index 0000000..3d9e1c5
--- /dev/null
+++ b/doc/build/static/docs.css
@@ -0,0 +1,438 @@
+/* global */
+
+body {
+ background-color: #FDFBFC;
+ margin:38px;
+ color:#333333;
+}
+
+a {
+ font-weight:normal;
+ text-decoration:none;
+}
+
+form {
+ display:inline;
+}
+
+/* hyperlinks */
+
+a:link, a:visited, a:active {
+ color:#0000FF;
+}
+a:hover {
+ color:#700000;
+ text-decoration:underline;
+}
+
+/* paragraph links after sections.
+ These aren't visible until hovering
+ over the <h> tag, then have a
+ "reverse video" effect over the actual
+ link
+ */
+
+a.headerlink {
+ font-size: 0.8em;
+ padding: 0 4px 0 4px;
+ text-decoration: none;
+ visibility: hidden;
+}
+
+h1:hover > a.headerlink,
+h2:hover > a.headerlink,
+h3:hover > a.headerlink,
+h4:hover > a.headerlink,
+h5:hover > a.headerlink,
+h6:hover > a.headerlink,
+dt:hover > a.headerlink {
+ visibility: visible;
+}
+
+a.headerlink:hover {
+ background-color: #990000;
+ color: white;
+}
+
+
+/* Container setup */
+
+#docs-container {
+ max-width:1000px;
+}
+
+
+/* header/footer elements */
+
+#docs-header h1 {
+ font-size:20px;
+ color: #222222;
+ margin: 0;
+ padding: 0;
+}
+
+#docs-header {
+ font-family:Tahoma, Geneva,sans-serif;
+
+ font-size:.9em;
+
+}
+
+#docs-top-navigation,
+#docs-bottom-navigation {
+ font-family: Tahoma, Geneva, sans-serif;
+ background-color: #EEE;
+ border: solid 1px #CCC;
+ padding:10px;
+ font-size:.9em;
+}
+
+#docs-top-navigation {
+ margin:10px 0px 10px 0px;
+ line-height:1.2em;
+}
+
+.docs-navigation-links {
+ font-family:Tahoma, Geneva,sans-serif;
+}
+
+#docs-bottom-navigation {
+ float:right;
+ margin: 1em 0 1em 5px;
+}
+
+#docs-copyright {
+ font-size:.85em;
+ padding:5px 0px;
+}
+
+#docs-header h1,
+#docs-top-navigation h1,
+#docs-top-navigation h2 {
+ font-family:Tahoma,Geneva,sans-serif;
+ font-weight:normal;
+}
+
+#docs-top-navigation h2 {
+ margin:16px 4px 7px 5px;
+ font-size:2em;
+}
+
+#docs-search {
+ float:right;
+}
+
+#docs-top-page-control {
+ float:right;
+ width:350px;
+}
+
+#docs-top-page-control ul {
+ padding:0;
+ margin:0;
+}
+
+#docs-top-page-control li {
+ list-style-type:none;
+ padding:1px 8px;
+}
+
+
+#docs-container .version-num {
+ font-weight: bold;
+}
+
+
+/* content container, sidebar */
+
+#docs-body-container {
+ background-color:#EFEFEF;
+ border: solid 1px #CCC;
+
+}
+
+#docs-body,
+#docs-sidebar
+ {
+ /*font-family: helvetica, arial, sans-serif;
+ font-size:.9em;*/
+
+ font-family: Tahoma, Geneva, sans-serif;
+ /*font-size:.85em;*/
+ line-height:1.5em;
+
+}
+
+#docs-sidebar > ul {
+ font-size:.9em;
+}
+
+#docs-sidebar {
+ float:left;
+ width:212px;
+ padding: 10px 0 0 15px;
+ /*font-size:.85em;*/
+}
+
+#docs-sidebar h3, #docs-sidebar h4 {
+ background-color: #DDDDDD;
+ color: #222222;
+ font-family: Tahoma, Geneva,sans-serif;
+ font-size: 1.1em;
+ font-weight: normal;
+ margin: 10px 0 0 -15px;
+ padding: 5px 10px 5px 10px;
+ text-shadow: 1px 1px 0 white;
+ width:210px;
+}
+
+#docs-sidebar h3 a, #docs-sidebar h4 a {
+ color: #222222;
+}
+#docs-sidebar ul {
+ margin: 10px 10px 10px 0px;
+ padding: 0;
+ list-style: none outside none;
+}
+
+
+#docs-sidebar ul ul {
+ margin-bottom: 0;
+ margin-top: 0;
+ list-style: square outside none;
+ margin-left: 20px;
+}
+
+#docs-body {
+ background-color:#FFFFFF;
+ padding:1px 10px 10px 10px;
+}
+
+#docs-body.withsidebar {
+ margin: 0 0 0 230px;
+ border-left:3px solid #DFDFDF;
+}
+
+#docs-body h1,
+#docs-body h2,
+#docs-body h3,
+#docs-body h4 {
+ font-family:Tahoma, Geneva, sans-serif;
+}
+
+#docs-body h1 {
+ /* hide the <h1> for each content section. */
+ display:none;
+ font-size:1.8em;
+}
+
+#docs-body h2 {
+ font-size:1.6em;
+}
+
+#docs-body h3 {
+ font-size:1.4em;
+}
+
+/* SQL popup, code styles */
+
+.highlight {
+ background:none;
+}
+
+#docs-container pre {
+ font-size:1.2em;
+}
+
+#docs-container .pre {
+ font-size:1.1em;
+}
+
+#docs-container pre {
+ background-color: #f0f0f0;
+ border: solid 1px #ccc;
+ box-shadow: 2px 2px 3px #DFDFDF;
+ padding:10px;
+ margin: 5px 0px 5px 0px;
+ overflow:auto;
+ line-height:1.3em;
+}
+
+.popup_sql, .show_sql
+{
+ background-color: #FBFBEE;
+ padding:5px 10px;
+ margin:10px -5px;
+ border:1px dashed;
+}
+
+/* the [SQL] links used to display SQL */
+#docs-container .sql_link
+{
+ font-weight:normal;
+ font-family: arial, sans-serif;
+ font-size:.9em;
+ text-transform: uppercase;
+ color:#990000;
+ border:1px solid;
+ padding:1px 2px 1px 2px;
+ margin:0px 10px 0px 15px;
+ float:right;
+ line-height:1.2em;
+}
+
+#docs-container a.sql_link,
+#docs-container .sql_link
+{
+ text-decoration: none;
+ padding:1px 2px;
+}
+
+#docs-container a.sql_link:hover {
+ text-decoration: none;
+ color:#fff;
+ border:1px solid #900;
+ background-color: #900;
+}
+
+/* docutils-specific elements */
+
+th.field-name {
+ text-align:right;
+}
+
+div.note, div.warning, p.deprecated, div.topic {
+ background-color:#EEFFEF;
+}
+
+
+div.admonition, div.topic, p.deprecated, p.versionadded, p.versionchanged {
+ border:1px solid #CCCCCC;
+ padding:5px 10px;
+ font-size:.9em;
+ box-shadow: 2px 2px 3px #DFDFDF;
+}
+
+div.warning .admonition-title {
+ color:#FF0000;
+}
+
+div.admonition .admonition-title, div.topic .topic-title {
+ font-weight:bold;
+}
+
+.viewcode-back, .viewcode-link {
+ float:right;
+}
+
+dl.function > dt,
+dl.attribute > dt,
+dl.classmethod > dt,
+dl.method > dt,
+dl.class > dt,
+dl.exception > dt
+{
+ background-color:#F0F0F0;
+ margin:25px -10px 10px 10px;
+ padding: 0px 10px;
+}
+
+p.versionadded span.versionmodified,
+p.versionchanged span.versionmodified,
+p.deprecated span.versionmodified {
+ background-color: #F0F0F0;
+ font-style: italic;
+}
+
+dt:target, span.highlight {
+ background-color:#FBE54E;
+}
+
+a.headerlink {
+ font-size: 0.8em;
+ padding: 0 4px 0 4px;
+ text-decoration: none;
+ visibility: hidden;
+}
+
+h1:hover > a.headerlink,
+h2:hover > a.headerlink,
+h3:hover > a.headerlink,
+h4:hover > a.headerlink,
+h5:hover > a.headerlink,
+h6:hover > a.headerlink,
+dt:hover > a.headerlink {
+ visibility: visible;
+}
+
+a.headerlink:hover {
+ background-color: #00f;
+ color: white;
+}
+
+.clearboth {
+ clear:both;
+}
+
+tt.descname {
+ background-color:transparent;
+ font-size:1.2em;
+ font-weight:bold;
+}
+
+tt.descclassname {
+ background-color:transparent;
+}
+
+tt {
+ background-color:#ECF0F3;
+ padding:0 1px;
+}
+
+/* syntax highlighting overrides */
+.k, .kn {color:#0908CE;}
+.o {color:#BF0005;}
+.go {color:#804049;}
+
+
+/* special "index page" sections
+ with specific formatting
+*/
+
+div#sqlalchemy-documentation {
+ font-size:.95em;
+}
+div#sqlalchemy-documentation em {
+ font-style:normal;
+}
+div#sqlalchemy-documentation .rubric{
+ font-size:14px;
+ background-color:#EEFFEF;
+ padding:5px;
+ border:1px solid #BFBFBF;
+}
+div#sqlalchemy-documentation a, div#sqlalchemy-documentation li {
+ padding:5px 0px;
+}
+
+div#getting-started {
+ border-bottom:1px solid;
+}
+
+div#sqlalchemy-documentation div#sqlalchemy-orm {
+ float:left;
+ width:48%;
+}
+
+div#sqlalchemy-documentation div#sqlalchemy-core {
+ float:left;
+ width:48%;
+ margin:0;
+ padding-left:10px;
+ border-left:1px solid;
+}
+
+div#dialect-documentation {
+ border-top:1px solid;
+ /*clear:left;*/
+}
diff --git a/doc/build/static/makoLogo.png b/doc/build/static/makoLogo.png
new file mode 100644
index 0000000..c43c087
--- /dev/null
+++ b/doc/build/static/makoLogo.png
Binary files differ
diff --git a/doc/build/static/python-logo.gif b/doc/build/static/python-logo.gif
new file mode 100644
index 0000000..01c7bf3
--- /dev/null
+++ b/doc/build/static/python-logo.gif
Binary files differ
diff --git a/doc/build/static/site.css b/doc/build/static/site.css
new file mode 100644
index 0000000..5b12b22
--- /dev/null
+++ b/doc/build/static/site.css
@@ -0,0 +1,86 @@
+body {
+ font-family: Tahoma, Geneva, sans-serif;
+ line-height:1.4em;
+ margin:15px;
+ background-color:#FFFFFF;
+}
+img {border:none;}
+a { text-decoration: none;}
+a:visited { color: #2929ff;}
+a:hover { color: #0000ff;}
+
+#wrap {
+ margin:0 auto;
+ max-width:1024px;
+ min-width:480px;
+ position:relative;
+
+}
+h1 {
+ font-size:1.6em;
+ font-weight:bold;
+}
+
+h2 {
+ font-size:1.1em;
+ font-weight:bold;
+ margin:10px 0px 10px 0px;
+}
+
+.clearfix{
+ clear:both;
+}
+
+.red {
+ font-weight:bold;
+ color:#FF0000;
+}
+.rightbar {
+ float:right;
+}
+.slogan {
+ margin-top:10px;
+}
+#gittip_nav {
+ float:right;
+ margin:10px 0px 0px 0px;
+}
+
+.toolbar {
+ margin-top:20px;
+}
+.copyright {
+ font-size:.8em;
+ text-align:center;
+ color:909090;
+}
+.pylogo {
+ text-align:right;
+ float:right;
+}
+.code {
+ font-family:monospace;
+}
+
+li {
+ margin:1px 0px 1px 0px;
+}
+
+.speedchart td {
+ font-size:small;
+}
+
+pre.codesample {
+ margin: 1.5em;
+ padding: .5em;
+ font-size: .95em;
+ line-height:1em;
+ background-color: #eee;
+ border: 1px solid #ccc;
+ width:450px;
+ overflow:auto;
+}
+
+#speedchart {
+ margin:5px 10px 5px 10px;
+}
diff --git a/doc/build/templates/base.mako b/doc/build/templates/base.mako
new file mode 100644
index 0000000..b23be0f
--- /dev/null
+++ b/doc/build/templates/base.mako
@@ -0,0 +1,56 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
+<head>
+<title><%block name="head_title">Mako Templates for Python</%block></title>
+
+<!-- begin iterate through sphinx environment css_files -->
+% for cssfile in self.attr.default_css_files + css_files:
+ <link rel="stylesheet" href="${pathto(cssfile, 1)}" type="text/css" />
+% endfor
+<!-- end iterate through sphinx environment css_files -->
+
+<%block name="headers">
+</%block>
+
+
+</head>
+<body>
+ <div id="wrap">
+ <div class="rightbar">
+
+ <div class="slogan">
+ Hyperfast and lightweight templating for the Python platform.
+ </div>
+
+ % if toolbar:
+ <div class="toolbar">
+ <a href="${site_base}/">Home</a>
+ &nbsp; | &nbsp;
+ <a href="${site_base}/community.html">Community</a>
+ &nbsp; | &nbsp;
+ <a href="${pathto('index')}">Documentation</a>
+ &nbsp; | &nbsp;
+ <a href="${site_base}/download.html">Download</a>
+ </div>
+ % endif
+
+ </div>
+
+ <a href="${site_base}/"><img src="${pathto('_static/makoLogo.png', 1)}" /></a>
+
+ <hr/>
+
+ ${next.body()}
+<div class="clearfix">
+<%block name="footer">
+<hr/>
+
+<div class="copyright">Website content copyright &copy; by Michael Bayer.
+ All rights reserved. Mako and its documentation are licensed
+ under the MIT license. mike(&)zzzcomputing.com</div>
+</%block>
+</div>
+</div>
+</body>
+</html>
diff --git a/doc/build/templates/genindex.mako b/doc/build/templates/genindex.mako
new file mode 100644
index 0000000..cd47a4e
--- /dev/null
+++ b/doc/build/templates/genindex.mako
@@ -0,0 +1,77 @@
+<%inherit file="${context['layout']}"/>
+
+<%block name="show_title" filter="util.striptags">
+ ${_('Index')}
+</%block>
+
+ <h1 id="index">${_('Index')}</h1>
+
+ % for i, (key, dummy) in enumerate(genindexentries):
+ ${i != 0 and '| ' or ''}<a href="#${key}"><strong>${key}</strong></a>
+ % endfor
+
+ <hr />
+
+ % for i, (key, entries) in enumerate(genindexentries):
+<h2 id="${key}">${key}</h2>
+<table width="100%" class="indextable genindextable"><tr><td width="33%" valign="top">
+<dl>
+ <%
+ breakat = genindexcounts[i] // 2
+ numcols = 1
+ numitems = 0
+ %>
+% for entryname, (links, subitems) in [(a, b[0:2]) for a, b in entries]:
+
+<dt>
+ % if links:
+ <a href="${links[0][1]}">${entryname|h}</a>
+ % for unknown, link in links[1:]:
+ , <a href="${link}">[${i}]</a>
+ % endfor
+ % else:
+ ${entryname|h}
+ % endif
+</dt>
+
+ % if subitems:
+ <dd><dl>
+ % for subentryname, subentrylinks in subitems[0:2]:
+ <dt><a href="${subentrylinks[0][1]}">${subentryname|h}</a>
+ % for j, (unknown, link) in enumerate(subentrylinks[1:]):
+ <a href="${link}">[${j}]</a>
+ % endfor
+ </dt>
+ % endfor
+ </dl></dd>
+ % endif
+
+ <%
+ numitems = numitems + 1 + len(subitems)
+ %>
+ % if numcols <2 and numitems > breakat:
+ <%
+ numcols = numcols + 1
+ %>
+ </dl></td><td width="33%" valign="top"><dl>
+ % endif
+
+% endfor
+<dt></dt></dl>
+</td></tr></table>
+% endfor
+
+<%def name="sidebarrel()">
+% if split_index:
+ <h4>${_('Index')}</h4>
+ <p>
+ % for i, (key, dummy) in enumerate(genindexentries):
+ ${i > 0 and '| ' or ''}
+ <a href="${pathto('genindex-' + key)}"><strong>${key}</strong></a>
+ % endfor
+ </p>
+
+ <p><a href="${pathto('genindex-all')}"><strong>${_('Full index on one page')}</strong></a></p>
+% endif
+ ${parent.sidebarrel()}
+</%def>
diff --git a/doc/build/templates/layout.mako b/doc/build/templates/layout.mako
new file mode 100644
index 0000000..486367c
--- /dev/null
+++ b/doc/build/templates/layout.mako
@@ -0,0 +1,205 @@
+## coding: utf-8
+<%!
+ local_script_files = []
+
+ default_css_files = [
+ '_static/pygments.css',
+ '_static/docs.css',
+ '_static/site.css'
+ ]
+%>
+
+<%doc>
+ Structural elements are all prefixed with "docs-"
+ to prevent conflicts when the structure is integrated into the
+ main site.
+
+ docs-container ->
+ docs-header ->
+ docs-search
+ docs-version-header
+ docs-top-navigation
+ docs-top-page-control
+ docs-navigation-banner
+ docs-body-container ->
+ docs-sidebar
+ docs-body
+ docs-bottom-navigation
+ docs-copyright
+</%doc>
+
+<%inherit file="base.mako"/>
+
+<%
+withsidebar = bool(toc) and current_page_name != 'index'
+%>
+
+<%block name="head_title">
+ % if current_page_name != 'index':
+ ${capture(self.show_title) | util.striptags} &mdash;
+ % endif
+ ${docstitle|h}
+</%block>
+
+
+<div id="docs-container">
+
+<%block name="headers">
+ ${parent.headers()}
+
+ <script type="text/javascript">
+ var DOCUMENTATION_OPTIONS = {
+ URL_ROOT: '${pathto("", 1)}',
+ VERSION: '${release|h}',
+ COLLAPSE_MODINDEX: false,
+ FILE_SUFFIX: '${file_suffix}'
+ };
+ </script>
+ % for scriptfile in script_files + self.attr.local_script_files:
+ <script type="text/javascript" src="${pathto(scriptfile, 1)}"></script>
+ % endfor
+ % if hasdoc('about'):
+ <link rel="author" title="${_('About these documents')}" href="${pathto('about')}" />
+ % endif
+ <link rel="index" title="${_('Index')}" href="${pathto('genindex')}" />
+ <link rel="search" title="${_('Search')}" href="${pathto('search')}" />
+ % if hasdoc('copyright'):
+ <link rel="copyright" title="${_('Copyright')}" href="${pathto('copyright')}" />
+ % endif
+ <link rel="top" title="${docstitle|h}" href="${pathto('index')}" />
+ % if parents:
+ <link rel="up" title="${parents[-1]['title']|util.striptags}" href="${parents[-1]['link']|h}" />
+ % endif
+ % if nexttopic:
+ <link rel="next" title="${nexttopic['title']|util.striptags}" href="${nexttopic['link']|h}" />
+ % endif
+ % if prevtopic:
+ <link rel="prev" title="${prevtopic['title']|util.striptags}" href="${prevtopic['link']|h}" />
+ % endif
+</%block>
+
+<div id="docs-header">
+ <h1>${docstitle|h}</h1>
+
+ <div id="docs-search">
+ Search:
+ <form class="search" action="${pathto('search')}" method="get">
+ <input type="text" name="q" size="18" /> <input type="submit" value="${_('Search')}" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+ </div>
+
+ <div id="docs-version-header">
+ Release: <span class="version-num">${release}</span>
+
+ </div>
+
+</div>
+
+<div id="docs-top-navigation">
+ <div id="docs-top-page-control" class="docs-navigation-links">
+ <ul>
+ % if prevtopic:
+ <li>Prev:
+ <a href="${prevtopic['link']|h}" title="${_('previous chapter')}">${prevtopic['title']}</a>
+ </li>
+ % endif
+ % if nexttopic:
+ <li>Next:
+ <a href="${nexttopic['link']|h}" title="${_('next chapter')}">${nexttopic['title']}</a>
+ </li>
+ % endif
+
+ <li>
+ <a href="${pathto('index')}">Table of Contents</a> |
+ <a href="${pathto('genindex')}">Index</a>
+ % if sourcename:
+ | <a href="${pathto('_sources/' + sourcename, True)|h}">${_('view source')}
+ % endif
+ </li>
+ </ul>
+ </div>
+
+ <div id="docs-navigation-banner">
+ <a href="${pathto('index')}">${docstitle|h}</a>
+ % if parents:
+ % for parent in parents:
+ » <a href="${parent['link']|h}" title="${parent['title']}">${parent['title']}</a>
+ % endfor
+ % endif
+ % if current_page_name != 'index':
+ » ${self.show_title()}
+ % endif
+
+ <h2>
+ <%block name="show_title">
+ ${title}
+ </%block>
+ </h2>
+ </div>
+
+</div>
+
+<div id="docs-body-container">
+
+% if withsidebar:
+ <div id="docs-sidebar">
+ <h3><a href="${pathto('index')}">Table of Contents</a></h3>
+ ${toc}
+
+ % if prevtopic:
+ <h4>Previous Topic</h4>
+ <p>
+ <a href="${prevtopic['link']|h}" title="${_('previous chapter')}">${prevtopic['title']}</a>
+ </p>
+ % endif
+ % if nexttopic:
+ <h4>Next Topic</h4>
+ <p>
+ <a href="${nexttopic['link']|h}" title="${_('next chapter')}">${nexttopic['title']}</a>
+ </p>
+ % endif
+
+ <h4>Quick Search</h4>
+ <p>
+ <form class="search" action="${pathto('search')}" method="get">
+ <input type="text" name="q" size="18" /> <input type="submit" value="${_('Search')}" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+ </p>
+
+ </div>
+% endif
+
+ <div id="docs-body" class="${'withsidebar' if withsidebar else ''}" >
+ ${next.body()}
+ </div>
+
+</div>
+
+<div id="docs-bottom-navigation" class="docs-navigation-links">
+ % if prevtopic:
+ Previous:
+ <a href="${prevtopic['link']|h}" title="${_('previous chapter')}">${prevtopic['title']}</a>
+ % endif
+ % if nexttopic:
+ Next:
+ <a href="${nexttopic['link']|h}" title="${_('next chapter')}">${nexttopic['title']}</a>
+ % endif
+
+ <div id="docs-copyright">
+ % if hasdoc('copyright'):
+ &copy; <a href="${pathto('copyright')}">Copyright</a> ${copyright|h}.
+ % else:
+ &copy; Copyright ${copyright|h}.
+ % endif
+ % if show_sphinx:
+ Documentation generated using <a href="http://sphinx.pocoo.org/">Sphinx</a> ${sphinx_version|h}
+ with Mako templates.
+ % endif
+ </div>
+</div>
+
+</div>
diff --git a/doc/build/templates/page.mako b/doc/build/templates/page.mako
new file mode 100644
index 0000000..61cf9a0
--- /dev/null
+++ b/doc/build/templates/page.mako
@@ -0,0 +1,2 @@
+<%inherit file="${context['layout']}"/>
+${body| util.strip_toplevel_anchors} \ No newline at end of file
diff --git a/doc/build/templates/rtd_layout.mako b/doc/build/templates/rtd_layout.mako
new file mode 100644
index 0000000..3fafd53
--- /dev/null
+++ b/doc/build/templates/rtd_layout.mako
@@ -0,0 +1,37 @@
+<!-- readthedocs add-in template -->
+
+<%inherit file="/layout.mako"/>
+
+
+<%block name="headers">
+
+<link href='http://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700' rel='stylesheet' type='text/css'>
+
+<!-- RTD <head> via mako adapter -->
+<script type="text/javascript">
+ var doc_version = "${current_version}";
+ var doc_slug = "${slug}";
+ var static_root = "${pathto('_static', 1)}"
+
+ // copied from:
+ // https://github.com/rtfd/readthedocs.org/commit/edbbb4c753454cf20c128d4eb2fef60d740debaa#diff-2f70e8d9361202bfe3f378d2ff2c510bR8
+ var READTHEDOCS_DATA = {
+ project: "${slug}",
+ version: "${current_version}",
+ page: "${pagename}",
+ theme: "${html_theme or ''}"
+ };
+
+</script>
+<!-- end RTD <head> via mako adapter -->
+
+ ${parent.headers()}
+
+</%block>
+
+
+${next.body()}
+
+<%block name="footer">
+ ${parent.footer()}
+</%block>
diff --git a/doc/build/templates/search.mako b/doc/build/templates/search.mako
new file mode 100644
index 0000000..0eaa8f9
--- /dev/null
+++ b/doc/build/templates/search.mako
@@ -0,0 +1,25 @@
+<%inherit file="${context['layout']}"/>
+
+<%!
+ local_script_files = ['_static/searchtools.js']
+%>
+
+<%block name="show_title" filter="util.striptags">
+ ${_('Search')}
+</%block>
+
+<div id="searchform">
+<h3>Enter Search Terms:</h3>
+<form class="search" action="${pathto('search')}" method="get">
+ <input type="text" name="q" size="18" /> <input type="submit" value="${_('Search')}" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+</form>
+</div>
+
+<div id="search-results"></div>
+
+<%block name="footer">
+ ${parent.footer()}
+ <script type="text/javascript" src="searchindex.js"></script>
+</%block>