diff options
| -rw-r--r-- | doc/build/builder/builders.py | 78 | ||||
| -rw-r--r-- | doc/build/conf.py | 2 | ||||
| -rw-r--r-- | doc/build/static/docs.css | 424 | ||||
| -rw-r--r-- | doc/build/static/makoLogo.png | bin | 0 -> 11715 bytes | |||
| -rw-r--r-- | doc/build/static/python-logo.gif | bin | 0 -> 2549 bytes | |||
| -rw-r--r-- | doc/build/static/site.css | 82 | ||||
| -rw-r--r-- | doc/build/templates/genindex.mako | 12 | ||||
| -rw-r--r-- | doc/build/templates/layout.mako | 222 | ||||
| -rw-r--r-- | doc/build/templates/makoorg/root.mako | 58 | ||||
| -rw-r--r-- | doc/build/templates/page.mako | 2 | ||||
| -rw-r--r-- | doc/build/templates/pre_layout.mako | 2 | ||||
| -rw-r--r-- | doc/build/templates/rtd_layout.mako | 174 | ||||
| -rw-r--r-- | doc/build/templates/search.mako | 2 | ||||
| -rw-r--r-- | doc/build/templates/site_base.mako | 8 | ||||
| -rw-r--r-- | doc/build/templates/static_base.mako | 19 |
15 files changed, 810 insertions, 275 deletions
diff --git a/doc/build/builder/builders.py b/doc/build/builder/builders.py index b1311b4..600beab 100644 --- a/doc/build/builder/builders.py +++ b/doc/build/builder/builders.py @@ -1,6 +1,7 @@ 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 * @@ -8,43 +9,81 @@ 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) + self.layout = builder.config.html_context.get('mako_layout', 'html') - - self.lookup = TemplateLookup(directories=builder.config.templates_path, + builder.config.html_context['site_base'] = builder.config['site_base'] + + self.lookup = TemplateLookup( + directories=builder.config.templates_path, imports=[ "from builder import util" ] ) - + def render(self, template, context): template = template.replace(".html", ".mako") context['prevtopic'] = context.pop('prev', None) context['nexttopic'] = context.pop('next', None) - context['mako_layout'] = self.layout == 'html' and 'static_base.mako' or 'site_base.mako' - # sphinx 1.0b2 doesn't seem to be providing _ for some reason... + + # site layout + if self.layout == 'site': + context['mako_layout'] = 'site_base.mako' + context['mako_pre_layout'] = "layout.mako" + # overrides site_base from conf.py + context['site_base'] = "/" + context['docs_base'] = "/" + else: + # 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['mako_pre_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['mako_pre_layout'] = "layout.mako" + + context['mako_layout'] = 'makoorg/root.mako' + context.setdefault('_', lambda x:x) return self.lookup.get_template(template).render_unicode(**context) - - + def render_string(self, template, context): - context['prevtopic'] = context.pop('prev', None) - context['nexttopic'] = context.pop('next', None) - context['mako_layout'] = self.layout == 'html' and 'static_base.mako' or 'site_base.mako' - # sphinx 1.0b2 doesn't seem to be providing _ for some reason... - context.setdefault('_', lambda x:x) - return Template(template, lookup=self.lookup, - format_exceptions=True, - imports=[ - "from builder import util" - ] - ).render_unicode(**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: @@ -64,5 +103,6 @@ def setup(app): # 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)
\ No newline at end of file diff --git a/doc/build/conf.py b/doc/build/conf.py index 288b3f5..43c29eb 100644 --- a/doc/build/conf.py +++ b/doc/build/conf.py @@ -38,6 +38,8 @@ templates_path = ['templates'] nitpicky = True +site_base = "http://www.makotemplates.org" + # The suffix of source filenames. source_suffix = '.rst' diff --git a/doc/build/static/docs.css b/doc/build/static/docs.css index d40dad0..bf67641 100644 --- a/doc/build/static/docs.css +++ b/doc/build/static/docs.css @@ -1,225 +1,329 @@ -/* documentation section styles */ +/* global */ -body, td { - font-family: Tahoma,Geneva,sans-serif; +body { + background-color: #FDFBFC; + margin:38px; + color:#333333; } -body { - background-color: #FDFBFC; - margin:38px; - color:#333333; +a { + font-weight:normal; + text-decoration:none; } form { display:inline; } -p { - margin-top:10px; - margin-bottom:10px; +/* 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 { - font-weight:normal; - text-decoration:none; +a.headerlink { + font-size: 0.8em; + padding: 0 4px 0 4px; + text-decoration: none; + visibility: hidden; } -a:link {color:#0000FF;} -a:visited {color:#0000FF;} -a:active {color:#0000FF;} -a:hover {color:#700000;} +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; +} -strong a { - font-weight: bold; +a.headerlink:hover { + background-color: #990000; + color: white; } -#search { - float:right; + +/* Container setup */ + +#docs-container { + max-width:1000px; } -#searchform { - padding:20px; + +/* header/footer elements */ + +#docs-header h1 { + font-size:20px; + color: #222222; + margin: 0; + padding: 0; } -#pagecontrol { - float:right; +#docs-header { + font-family:Tahoma, Geneva,sans-serif; + + font-size:.9em; + } -.topnav { - background-color: #eeeeee; - border: solid 1px #ccc; - padding:10px; - margin:10px 0px 10px 0px; +#docs-top-navigation, +#docs-bottom-navigation { + font-family: Tahoma, Geneva, sans-serif; + background-color: #EEE; + border: solid 1px #CCC; + padding:10px; + font-size:.9em; } -.bottomnav { - background-color: #eeeeee; - border:1px solid #CCCCCC; +#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; - padding:10px; } -.document { - border: solid 1px #ccc; +#docs-copyright { + font-size:.85em; + padding:5px 0px; } -.topnav .prevnext { - padding: 5px 0px 0px 0px; - /*font-size: 0.8em*/ +#docs-header h1, +#docs-top-navigation h1, +#docs-top-navigation h2 { + font-family:Tahoma,Geneva,sans-serif; + font-weight:normal; } -h1, h2, h3, h4, h5 { - font-weight:bold; +#docs-top-navigation h2 { + margin:16px 4px 7px 5px; + font-size:2em; } -h1 { - font-size:1.6em; - font-weight:bold; -} -.document h1, .document h2, .document h3, .document h4, .document h5 { - font-size: 1.2em; +#docs-search { + float:right; } -.document img { - display:block; - margin: 0 auto; +#docs-top-page-control { + float:right; + width:350px; } -.document h1 { - display:none; +#docs-top-page-control ul { + padding:0; + margin:0; } -.topnav h2 { - margin:26px 4px 0px 5px; - font-size:1.6em; - font-weight:normal; - line-height:1.6em; +#docs-top-page-control li { + list-style-type:none; + padding:1px 8px; } -.topnav h3 { + +#docs-container .version-num { font-weight: bold; - font-size: 1.4em; - margin:0px; - display:inline; } -.topnav li, -li.toctree-l1, -li.toctree-l1 li -{ - list-style-type:disc; - margin:0px; - padding:1px 8px; + +/* 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; -.topnav li ul, -li.toctree-l1 ul -{ - padding:0px 0px 0px 20px; } -.topnav li ul li li, -li.toctree-l1 ul li li -{ - /*font-size:.90em;*/ +#docs-sidebar > ul { + font-size:.9em; } -.sourcelink { - font-size:.8em; - text-align:right; - padding-top:10px; +#docs-sidebar { + float:left; + width:212px; + padding: 10px 0 0 15px; + /*font-size:.85em;*/ } -.section { - line-height: 1.5em; - padding:8px 10px 20px 10px; - margin:10px 0px 0px; +#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; } -.section .section { - margin:0px 0px 0px 0px; - padding: 0px; +#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; } -.section .section .section { - margin:0px 0px 0px 20px; + +#docs-sidebar ul ul { + margin-bottom: 0; + margin-top: 0; + list-style: square outside none; + margin-left: 20px; } -.section .section .section .section { - margin:0px 0px 0px 20px; +#docs-body { + background-color:#FFFFFF; + padding:1px 10px 10px 10px; } -th.field-name { - text-align:right; +#docs-body.withsidebar { + margin: 0 0 0 230px; + border-left:3px solid #DFDFDF; } -div.note, div.warning, p.deprecated { - background-color:#EEFFEF; +#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; +} -div.admonition, div.topic, p.deprecated { - border:1px solid #CCCCCC; - margin:5px 5px 5px 5px; - padding:5px 5px 5px 35px; - font-size:.9em; +#docs-body h2 { + font-size:1.6em; } -div.warning .admonition-title { - color:#FF0000; +#docs-body h3 { + font-size:1.4em; } -div.admonition .admonition-title { - font-weight:bold; +/* SQL popup, code styles */ + +.highlight { + background:none; } +#docs-container pre { + font-size:1.2em; +} -.totoc { - +#docs-container .pre { + font-size:1.1em; } -.doc_copyright { - font-size:.85em; - padding:10px 0px 10px 0px; +#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; } -/* take out sphinx/pygments putting some kind -of green background here... */ -.highlight { - background:none; +.popup_sql, .show_sql +{ + background-color: #FBFBEE; + padding:5px 10px; + margin:10px -5px; + border:1px dashed; } -pre { - background-color: #f0f0f0; - border: solid 1px #ccc; - padding:10px; - margin: 5px 5px 5px 5px; - overflow:auto; - line-height:1.3em; +/* 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; } -.versionheader { - margin-top: 0.5em; +#docs-container a.sql_link:hover { + text-decoration: none; + color:#fff; + border:1px solid #900; + background-color: #900; } -.versionnum { - font-weight: bold; + +/* 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 { + 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; } -.prerelease { - border: solid #c25757 2px; - border-radius: 4px; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - background-color: #c21a1a; - color: white; - padding: 0.05em 0.2em; -} dl.function > dt, dl.attribute > dt, @@ -229,7 +333,7 @@ dl.class > dt, dl.exception > dt { background-color:#F0F0F0; - margin:0px -10px; + margin:25px -10px 10px 10px; padding: 0px 10px; } @@ -279,16 +383,50 @@ tt { padding:0 1px; } -@media print { - #nav { display: none; } - #pagecontrol { display: none; } - .topnav .prevnext { display: none; } - .bottomnav { display: none; } - .totoc { display: none; } - .topnav ul li a { text-decoration: none; color: #000; } -} - /* 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 Binary files differnew file mode 100644 index 0000000..c43c087 --- /dev/null +++ b/doc/build/static/makoLogo.png diff --git a/doc/build/static/python-logo.gif b/doc/build/static/python-logo.gif Binary files differnew file mode 100644 index 0000000..01c7bf3 --- /dev/null +++ b/doc/build/static/python-logo.gif diff --git a/doc/build/static/site.css b/doc/build/static/site.css new file mode 100644 index 0000000..eb545d3 --- /dev/null +++ b/doc/build/static/site.css @@ -0,0 +1,82 @@ +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; + margin:10px 30px 10px 30px; +} +.slogan { + margin-top:10px; +} +.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/genindex.mako b/doc/build/templates/genindex.mako index 4933da4..4f535f4 100644 --- a/doc/build/templates/genindex.mako +++ b/doc/build/templates/genindex.mako @@ -1,4 +1,4 @@ -<%inherit file="layout.mako"/> +<%inherit file="pre_layout.mako"/> <%block name="show_title" filter="util.striptags"> ${_('Index')} @@ -25,19 +25,19 @@ <dt> % if links: - <a href="${links[0]}">${entryname|h}</a> - % for link in links[1:]: + <a href="${links[0][1]}">${entryname|h}</a> + % for unknown, link in links[1:]: , <a href="${link}">[${i}]</a> % endfor % else: ${entryname|h} % endif - + % if subitems: <dd><dl> % for subentryname, subentrylinks in subitems: - <dt><a href="${subentrylinks[0]}">${subentryname|h}</a> - % for j, link in enumerate(subentrylinks[1:]): + <dt><a href="${subentrylinks[0][1]}">${subentryname|h}</a> + % for j, (unknown, link) in enumerate(subentrylinks[1:]): <a href="${link}">[${j}]</a> % endfor </dt> diff --git a/doc/build/templates/layout.mako b/doc/build/templates/layout.mako index 59c3f07..c8765ef 100644 --- a/doc/build/templates/layout.mako +++ b/doc/build/templates/layout.mako @@ -1,6 +1,34 @@ ## coding: utf-8 +<%! + local_script_files = [] +%> +<%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="${context['mako_layout']}"/> +<% +withsidebar = bool(toc) and current_page_name != 'index' +%> + +<div id="docs-container"> + <%block name="headers"> <link rel="stylesheet" href="${pathto('_static/pygments.css', 1)}" type="text/css" /> <link rel="stylesheet" href="${pathto('_static/docs.css', 1)}" type="text/css" /> @@ -35,86 +63,112 @@ % if prevtopic: <link rel="prev" title="${prevtopic['title']|util.striptags}" href="${prevtopic['link']|h}" /> % endif - - <%block name="extrahead"> - </%block> </%block> - <h1>${docstitle|h}</h1> - - <div id="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 class="versionheader"> - Version: <span class="versionnum">${release}</span> Last Updated: ${last_updated} - </div> - <div class="clearboth"></div> - - <div class="topnav"> - <div id="pagecontrol"> - <a href="${pathto('genindex')}">Index</a> - - % if sourcename: - <div class="sourcelink">(<a href="${pathto('_sources/' + sourcename, True)|h}">${_('view source')})</div> - % endif - </div> - - <div class="navbanner"> - <a class="totoc" href="${pathto(master_doc)}">Table of Contents</a> - % if parents: - % for parent in parents: - » <a href="${parent['link']|h}" title="${parent['title']}">${parent['title']}</a> - % endfor - % endif - % if current_page_name != master_doc: - » ${self.show_title()} - % endif - - ${prevnext()} - <h2> - <%block name="show_title" filter="util.striptags"> - % if title: - ${title} - % endif - </%block> - </h2> - </div> - % if display_toc and not current_page_name.startswith('index'): - ${toc} +<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"> + % if title: + ${title} % endif - <div class="clearboth"></div> - </div> - - <div class="document"> - <div class="body"> - ${next.body()} - </div> - </div> - - <%block name="footer"> - <div class="bottomnav"> - ${prevnext()} - <div class="doc_copyright"> - % if hasdoc('copyright'): - © <a href="${pathto('copyright')}">Copyright</a> ${copyright|h}. - % else: - © Copyright ${copyright|h}. - % endif - % if show_sphinx: - Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> ${sphinx_version|h}. - % endif - </div> - </div> - </%block> - -<%def name="prevnext()"> -<div class="prevnext"> + </%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> @@ -123,7 +177,17 @@ Next: <a href="${nexttopic['link']|h}" title="${_('next chapter')}">${nexttopic['title']}</a> % endif -</div> -</%def> + <div id="docs-copyright"> + % if hasdoc('copyright'): + © <a href="${pathto('copyright')}">Copyright</a> ${copyright|h}. + % else: + © Copyright ${copyright|h}. + % endif + % if show_sphinx: + Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> ${sphinx_version|h}. + % endif + </div> +</div> +</div> diff --git a/doc/build/templates/makoorg/root.mako b/doc/build/templates/makoorg/root.mako new file mode 100644 index 0000000..64ae564 --- /dev/null +++ b/doc/build/templates/makoorg/root.mako @@ -0,0 +1,58 @@ +<% +in_docs = getattr(next.module, 'in_docs', False) +%> + +<html> +<%def name="title()"> +Mako Templates for Python +</%def> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> +<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"> +<head> +<title>${self.title()} </title> +<%block name="headers"> +</%block> +<link rel="stylesheet" href="${pathto('_static/site.css', 1)}"></link> + + +</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> + | + <a href="${site_base}/trac">Trac</a> + | + <a href="${site_base}/community.html">Community</a> + | + <a href="${pathto('index')}">Documentation</a> + | + <a href="${site_base}/download.html">Download</a> + </div> + % endif + + </div> + + <a href="/"><img src="${pathto('_static/makoLogo.png', 1)}" /></a> + + <hr/> + + ${next.body()} +<div class="clearfix"> +<%block name="footer"> +<hr/> + +<div class="copyright">Website content copyright © 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/page.mako b/doc/build/templates/page.mako index e0f98cf..e134ab4 100644 --- a/doc/build/templates/page.mako +++ b/doc/build/templates/page.mako @@ -1,2 +1,2 @@ -<%inherit file="layout.mako"/> +<%inherit file="pre_layout.mako"/> ${body| util.strip_toplevel_anchors}
\ No newline at end of file diff --git a/doc/build/templates/pre_layout.mako b/doc/build/templates/pre_layout.mako new file mode 100644 index 0000000..5b1c508 --- /dev/null +++ b/doc/build/templates/pre_layout.mako @@ -0,0 +1,2 @@ +<%inherit file="${context['mako_pre_layout']}"/> +${next.body()}
\ 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..09cdb97 --- /dev/null +++ b/doc/build/templates/rtd_layout.mako @@ -0,0 +1,174 @@ +<!-- readthedocs add-in template, ported from their jinja source --> + +<%inherit file="/layout.mako"/> + +<% + newscript = [] + # strip out script files that RTD wants to provide + for script in script_files: + for token in ("jquery.js", "underscore.js", "doctools.js"): + if token in script: + break + else: + newscript.append(script) + script_files[:] = newscript +%> + +<%block name="headers"> + ${parent.headers()} +<!-- RTD <head> --> +<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> +<script type="text/javascript" src="${MEDIA_URL}javascript/underscore.js"></script> +<script type="text/javascript" src="${MEDIA_URL}javascript/doctools.js"></script> +<script type="text/javascript" src="${MEDIA_URL}javascript/searchtools.js"></script> +##{% if using_theme %} +## <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/> +##{% endif %} + <script type="text/javascript"> + var doc_version = "${current_version}"; + var doc_slug = "${slug}"; + </script> + <script type="text/javascript" src="${MEDIA_URL}javascript/rtd.js"></script> +<!-- end RTD <head> --> +</%block> + +${next.body()} + +<%block name="footer"> + ${parent.footer()} + <!-- End original user content --> +## Keep this here, so that the RTD logo doesn't stomp on the bottom of the theme. +<br> +<br> +<br> + +<style type="text/css"> + .badge { + position: fixed; + display: block; + bottom: 5px; + height: 40px; + text-indent: -9999em; + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.2) inset; + -moz-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.2) inset; + -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.2) inset; + } + #version_menu { + position: fixed; + display: none; + bottom: 11px; + right: 166px; + list-style-type: none; + margin: 0; + } + .footer_popout:hover #version_menu { + display: block; + } + #version_menu li { + display: block; + float: right; + } + #version_menu li a { + display: block; + padding: 6px 10px 4px 10px; + margin: 7px 7px 0 0; + font-weight: bold; + font-size: 14px; + height: 20px; + line-height: 17px; + text-decoration: none; + color: #fff; + background: #8ca1af url(../images/gradient-light.png) bottom left repeat-x; + border-radius: 3px; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + box-shadow: 0 1px 1px #465158; + -moz-box-shadow: 0 1px 1px #465158; + -webkit-box-shadow: 0 1px 1px #465158; + text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5); + } + #version_menu li a:hover { + text-decoration: none; + background-color: #697983; + box-shadow: 0 1px 0px #465158; + -moz-box-shadow: 0 1px 0px #465158; + -webkit-box-shadow: 0 1px 0px #465158; + } + .badge.rtd { + background: #257597 url(http://media.readthedocs.org/images/badge-rtd.png) top left no-repeat; + border: 1px solid #282E32; + width: 160px; + right: 5px; + } + .badge.revsys { background: #465158 url(http://media.readthedocs.org/images/badge-revsys.png) top left no-repeat; + border: 1px solid #1C5871; + width: 290px; + right: 173px; + } + .badge.revsys-inline-sponsored { + position: inherit; + margin-left: auto; + margin-right: 175px; + margin-bottom: 5px; + background: #465158 url(http://media.readthedocs.org/images/badge-revsys.png) top left no-repeat; + border: 1px solid #1C5871; + width: 290px; + right: 173px; + } + .badge.revsys-inline { + position: inherit; + margin-left: auto; + margin-right: 175px; + margin-bottom: 5px; + background: #465158 url(http://media.readthedocs.org/images/badge-revsys-sm.png) top left no-repeat; + border: 1px solid #1C5871; + width: 205px; + right: 173px; + } + +</style> +<div class="rtd_doc_footer"> + <div class="footer_popout"> + <a href="http://readthedocs.org/projects/${slug}/?fromdocs=${slug}" class="badge rtd">Brought to you by Read the Docs</a> + <ul id="version_menu"> + ## note that rtd.js blows this away, probably checks if the links + ## are good or something like that (in which case why are they in the 'versions' + ## collection...) + % for _slug, url in versions: + <li><a href="http://readthedocs.org${url}">${_slug}</a></li> + % endfor + </ul> + </div> +</div> +<!-- RTD Analytics Code --> +<script type="text/javascript"> + var _gaq = _gaq || []; + _gaq.push(['_setAccount', 'UA-17997319-1']); + _gaq.push(['_trackPageview']); + + (function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); + })(); +</script> + +% if analytics_code: +<!-- User Analytics Code --> +<script type="text/javascript"> + var _gaq = _gaq || []; + _gaq.push(['_setAccount', '${analytics_code}']); + _gaq.push(['_trackPageview']); + + (function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); + })(); +</script> +% endif + +</%block> diff --git a/doc/build/templates/search.mako b/doc/build/templates/search.mako index eb21a24..ff03d5e 100644 --- a/doc/build/templates/search.mako +++ b/doc/build/templates/search.mako @@ -1,4 +1,4 @@ -<%inherit file="layout.mako"/> +<%inherit file="pre_layout.mako"/> <%! local_script_files = ['_static/searchtools.js'] diff --git a/doc/build/templates/site_base.mako b/doc/build/templates/site_base.mako index 833293c..30ace37 100644 --- a/doc/build/templates/site_base.mako +++ b/doc/build/templates/site_base.mako @@ -1,17 +1,11 @@ <%text>#coding:utf-8 -<%inherit file="/root.html"/> +<%inherit file="/root.mako"/> <%page cache_type="file" cached="True"/> <%! in_docs=True %> </%text> -<%doc> -## TODO: pdf -<div style="text-align:right"> -<b>PDF Download:</b> <a href="${pathto('sqlalchemy_' + release.replace('.', '_') + '.pdf', 1)}">download</a> -</div> -</%doc> ${'<%text>'} ${next.body()} diff --git a/doc/build/templates/static_base.mako b/doc/build/templates/static_base.mako deleted file mode 100644 index b3f7a52..0000000 --- a/doc/build/templates/static_base.mako +++ /dev/null @@ -1,19 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - -<html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - ${metatags and metatags or ''} - <title>${self.show_title()} — ${docstitle|h}</title> - <%block name="headers"/> - </head> - <body> - ${next.body()} - </body> -</html> - - -<%! - local_script_files = [] -%> |
