From f0cbdd1bcf2eef7a6409f9e29514844b1851a202 Mon Sep 17 00:00:00 2001 From: Christoph Groth <christoph.groth@cea.fr> Date: Sat, 7 Sep 2013 16:07:19 +0200 Subject: [PATCH] use custom sphinx theme --- doc/kwantdoctheme/static/kwantdoctheme.css | 198 +++++++++++++++++++ doc/kwantdoctheme/theme.conf | 26 +++ doc/source/_static/kwant.css | 202 +------------------ doc/source/_static/kwant_logo.png | Bin 2952 -> 3017 bytes doc/source/_static/sidebar.js | 155 +++++++++++++++ doc/source/conf.py | 4 +- doc/templates/layout.html | 220 ++++++++++++++++++++- 7 files changed, 604 insertions(+), 201 deletions(-) create mode 100644 doc/kwantdoctheme/static/kwantdoctheme.css create mode 100644 doc/kwantdoctheme/theme.conf create mode 100644 doc/source/_static/sidebar.js diff --git a/doc/kwantdoctheme/static/kwantdoctheme.css b/doc/kwantdoctheme/static/kwantdoctheme.css new file mode 100644 index 0000000..8837f6e --- /dev/null +++ b/doc/kwantdoctheme/static/kwantdoctheme.css @@ -0,0 +1,198 @@ +/* This theme is based on pydoctheme by Georg Brandl. */ + +@import url("default.css"); + +body { + background-color: white; + margin-left: 1em; + margin-right: 1em; +} + +/* Disable typewriter font in headings. */ +h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt { + font-family: "Bitstream Vera Sans", Verdana, sans-serif; + font-size: 100%; +} + +div.body p, div.body dd, div.body li { + -webkit-hyphens: auto; + -moz-hyphens: auto; + -ms-hyphens: auto; + -o-hyphens: auto; + hyphens: auto; +} + +div.related { + margin-bottom: 1.2em; + padding: 0.5em 0; + border-top: 1px solid #ccc; + margin-top: 0.5em; +} + +dt:target, .highlighted { + background-color: #fbf1aa; +} + +div.related:first-child { + border-top: 0; + border-bottom: 1px solid #ccc; +} + +div.sphinxsidebar { + background-color: #eeeeee; + border-radius: 5px; + line-height: 130%; + font-size: smaller; + overflow: hidden; +} + +div.sphinxsidebar h3, div.sphinxsidebar h4 { + margin-top: 1.5em; +} + +div.sphinxsidebarwrapper > h3:first-child { + margin-top: 0.2em; +} + +div.sphinxsidebarwrapper > ul > li > ul > li { + margin-bottom: 0.4em; +} + +div.sphinxsidebar input { + font-family: 'Bitstream Vera Serif', Georgia, serif + border: 1px solid #999999; + font-size: smaller; + border-radius: 3px; +} + +div.sphinxsidebar input[type=text] { + max-width: 220px; +} + +div.body { + padding: 0 0 0 1.2em; +} + +div.body p { + line-height: 140%; +} + +div.body h1, div.body h2, div.body h3, div.body h4, div.body h5, div.body h6 { + margin: 0; + border: 0; + padding: 0.3em 0; +} + +div.body hr { + border: 0; + background-color: #ccc; + height: 1px; +} + +div.body pre { + border-radius: 3px; + border: 1px solid #ac9; +} + +div.body div.admonition, div.body div.impl-detail { + border-radius: 3px; +} + +div.body div.impl-detail > p { + margin: 0; +} + +div.body div.seealso { + border: 1px solid #dddd66; +} + +tt, pre { + font-family: monospace, sans-serif; + font-size: 96.5%; + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + -o-hyphens: none; + hyphens: none; +} + +div.body tt { + border-radius: 3px; +} + +div.body tt.descname { + font-size: 120%; +} + +div.body tt.xref, div.body a tt { + font-weight: normal; +} + +p.deprecated { + border-radius: 3px; +} + +table.docutils { + border: 1px solid #ddd; + min-width: 20%; + border-radius: 3px; + margin-top: 10px; + margin-bottom: 10px; +} + +table.docutils td, table.docutils th { + border: 1px solid #ddd !important; + border-radius: 3px; +} + +table p, table li { + text-align: left !important; +} + +table.docutils th { + background-color: #eee; + padding: 0.3em 0.5em; +} + +table.docutils td { + background-color: white; + padding: 0.3em 0.5em; +} + +table.footnote, table.footnote td { + border: 0 !important; +} + +div.footer { + line-height: 150%; + margin-top: -2em; + text-align: right; + width: auto; + margin-right: 10px; +} + +/* have arguments of functions or classes also a monospace font */ +table.longtable.docutils > tbody > tr > td:first-child, +dl.function > dt, +dl.class > dt, +dl.method > dt +{ + font-family: "Bitstream Vera Sans Mono", monospace, serif; + font-size: 96.5%; +} + +/* rescale font for <tt> so that it is again 96.5% with respect to body */ +table.longtable.docutils > tbody > tr > td:first-child tt, +dl.function > dt tt, +dl.class > dt tt, +dl.method > dt tt +{ + font-family: "Bitstream Vera Sans Mono", monospace, serif; + font-size: 100%; +} + +td.field-body strong +{ + font-family: "Bitstream Vera Sans Mono", monospace, serif; + font-size: 96.5%; +} diff --git a/doc/kwantdoctheme/theme.conf b/doc/kwantdoctheme/theme.conf new file mode 100644 index 0000000..1a5f002 --- /dev/null +++ b/doc/kwantdoctheme/theme.conf @@ -0,0 +1,26 @@ +# This theme is based on pydoctheme by Georg Brandl + +[theme] +inherit = default +stylesheet = kwantdoctheme.css +pygments_style = sphinx + +[options] +bodyfont = "Bitstream Vera Serif", Georgia, serif +headfont = "Bitstream Vera Sans", Verdana, sans-serif +footerbgcolor = white +footertextcolor = #555555 +relbarbgcolor = white +relbartextcolor = #666666 +relbarlinkcolor = #444444 +sidebarbgcolor = white +sidebartextcolor = #444444 +sidebarlinkcolor = #444444 +sidebarwidth = 300 +bgcolor = white +textcolor = black +linkcolor = #045e94 +visitedlinkcolor = #045e94 +headtextcolor = black +headbgcolor = white +headlinkcolor = #aaaaaa diff --git a/doc/source/_static/kwant.css b/doc/source/_static/kwant.css index 00875a2..246b713 100644 --- a/doc/source/_static/kwant.css +++ b/doc/source/_static/kwant.css @@ -1,209 +1,27 @@ -@import "default.css"; - -/** - * Spacing fixes - - -div.body p, div.body dd, div.body li { - line-height: 125%; -} - -ul.simple { - margin-top: 0; - margin-bottom: 0; - padding-top: 0; - padding-bottom: 0; -} -*/ +@import "kwantdoctheme.css"; /* spacing around blockquoted fields in parameters/attributes/returns */ -/*Essential. Otherwise there is way too much space around*/ +/* Essential. Otherwise there is way too much space around*/ td.field-body > blockquote { margin-top: 0.1em; margin-bottom: 0.5em; } -/* THE NEXT TWO ARE EVENTUALLY IMPORTANT I THINK */ -/* spacing around example code -div.highlight > pre { - padding: 2px 5px 2px 5px; -} -*/ - -/* spacing in see also definition lists -dl.last > dd { - margin-top: 1px; - margin-bottom: 5px; - margin-left: 30px; -} -*/ -/* hide overflowing content in the sidebar -div.sphinxsidebarwrapper p.topless { - overflow: hidden; -} -*/ - -/** - * Hide dummy toctrees - - -ul { - padding-top: 0; - padding-bottom: 0; - margin-top: 0; - margin-bottom: 0; -} -ul li { - padding-top: 0; - padding-bottom: 0; - margin-top: 0; - margin-bottom: 0; -} -ul li a.reference { - padding-top: 0; - padding-bottom: 0; - margin-top: 0; - margin-bottom: 0; -} - -*/ - -/** - * Make high-level subsections easier to distinguish from top-level ones - -div.body h3 { - background-color: transparent; -} - -div.body h4 { - border: none; - background-color: transparent; -} -*/ - -/** - * Scipy colors - -body { - background-color: rgb(100,135,220); -} - -div.document { - background-color: rgb(230,230,230); -} - -div.sphinxsidebar { - background-color: rgb(230,230,230); -} - -div.related { - background-color: rgb(100,135,220); -} - -div.sphinxsidebar h3 { - color: rgb(0,102,204); -} - -div.sphinxsidebar h3 a { - color: rgb(0,102,204); -} - -div.sphinxsidebar h4 { - color: rgb(0,82,194); -} - -div.sphinxsidebar p { - color: black; -} - -div.sphinxsidebar a { - color: #355f7c; -} - -div.sphinxsidebar ul.want-points { - list-style: disc; -} -*/ - .field-list th { - color: rgb(0,50,150); - background-color: #EEE8AA; - white-space: nowrap; /*Essential. Otherwise the colons can break - into a new line*/ -} - - - -/** - * Extra admonitions - - -div.tip { - background-color: #ffffe4; - border: 1px solid #ee6; -} - -div.plot-output { - clear-after: both; -} - -div.plot-output .figure { - float: left; - text-align: center; - margin-bottom: 0; - padding-bottom: 0; -} - -div.plot-output .caption { - margin-top: 2; - padding-top: 0; -} - -div.plot-output p.admonition-title { - display: none; -} - -div.plot-output:after { - content: ""; - display: block; - height: 0; - clear: both; -} -*/ - - -/* -div.admonition-example { - background-color: #e4ffe4; - border: 1px solid #ccc; -}*/ - - -/** - * Styling for field lists - */ - -table.field-list th { - border-left: 2px solid #999 !important; - padding-left: 5px; + /* color: rgb(0,50,150); */ + /* background-color: #EEE8AA; */ + white-space: nowrap; /* Essential. Otherwise the colons can break + into a new line */ } table.field-list { - border-collapse: separate; /*Essential. Otherwise Parameters and Returns - are sharing one solid colored field. That looks - weird.*/ + border-collapse: separate; /* Essential. Otherwise Parameters and Returns + are sharing one solid colored field. That looks + weird. */ border-spacing: 10px; + border-style: hidden; } -/** - * Styling for footnotes - - -table.footnote td, table.footnote th { - border: none; -} -*/ - div.specialnote-title { font-size: 105%; font-weight: bold; diff --git a/doc/source/_static/kwant_logo.png b/doc/source/_static/kwant_logo.png index ff89b6a48c1d4be400a5ecce5ef40b2adaf69549..7e4cf313f98503cc3bccd0457e77dc5b81b73832 100644 GIT binary patch delta 2999 zcmV;o3rO^c7s(ePiBL{Q4GJ0x0000DNk~Le0000-0000G2nGNE07N@tP>~@re+UUV zIrM<h@&Et}R!KxbR9M5^R%>`v<+XnI>^*z#GnreGNeCeUk`PP+0g_|678?qR6h!f$ z9F-$js1Zw__INm_0)k4diuC|TEnuY5TCo9BLp4A|POt<C#1Jl$%j7!DOfr|uec!+H z!;%A!m&ae{hu^RLtnYo-THm|&e_GF?ZrlFhxPI^TH|9((NN3dyv1#cq_B~Yb0KSK3 z{+=d${P=7<fApGlrpqYKEzgdB8=iXVQ0rr7dwg#Uj3lsXdI4CPYW>fpCFS^@o|!uv z4c<UxP{rzkWjXe;+D9uA--Km)64K$e!QrXntcJO7UT{w`8VvY89|Nndf7CNn+NDbu zG-~ZXWdLx06IOL-^^8Dx*F)>05_Q;SFu;AK{r@%DeaFA}TKmBh9p8!nYW?M}wI4av z{k8V>rDLdvXB1%NkLTm(Q?sdW^Ud7&D9Lppz=@bQeF_>50`vErw)FTTD=TvChPhc5 z3?>BX_h&kSBE=kxytGW5fBeG7V|#l0msJ$yF|)JN&>QFY31(gGmU~LQH+-(x-<;Ld zJ#_EX9GhCJQsMX|w`fbVyx+I|?tTEMdbvTr;oVb<R_tz^Uf<SLST?E1+I2l3P0!Eh z`E^s*F#vzb-&_y(w#B0fm+xp8-__??d`DR!6XHaA!(GL@p8d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ztNu?z*{L_)XV) zd~DN9RO~p$DKm*Y4S@9?#+AxmtlV}ljo;7%0DO5*A-b-7iIxjM$0eBq+(~v@7?L^> zDnUZ}cSN+D0Zj3)OQe%ZNT;Rf*;+*E_CYmaqQ>*wo5j)PfA9smtxFA=1dTl&!Hew> z6CEOKc7%FVB?Hrt7kYrS?b%S2_SQNf*aP3?KByXZ><gEnFff&Zk<s=>z1f#36;BWJ zZQE?VRe}j72N3820)Kw>KUp0!*I)`IcQ=zp6HujxWgS|-97Km-M3Lm?s5y>YwH-(> z>4jxwl2spwe@@UiRHbAwi3oZTtPg@x2TAe-Np|}u9n+#UTvJ=BvX)TvTqQ`3K+07U zr<NK*Z~SFSYc4t*SwQ>0t(6jIYA%o<6bs|-6REQ~2|^SQbbw9^oPGz<u-GXU6&@w! z`68xR6Hxa#5TAyCM}=Th2aGm_{ceE_8CFP%7I1YPe}e8Pbkhsr`Nvg=5?E9dJT3*6 z3>9gd7DQ`Z2#H3h#VE@xBG4Blqags*q<nN8tbw4BSZ4wPy$W<T38WWEV<I3BhFCZr z=(q-7O%FuK(B&sUk*zqj=OU)88Vv+|@Luu4JR<|JB?J8~AQ%Q>bb#83NOuTTZ(rf8 zsc~eqOA$!$Bh(&+reGA%?}e|?3$H7})=Uk$>q3ajBGOLE2P~NYD?=sTcN4Ir0d40H fzR?fCk;4B4vNi45xKwci00000NkvXXu0mjfHVmxe diff --git a/doc/source/_static/sidebar.js b/doc/source/_static/sidebar.js new file mode 100644 index 0000000..5ffeb12 --- /dev/null +++ b/doc/source/_static/sidebar.js @@ -0,0 +1,155 @@ +/* + * sidebar.js + * ~~~~~~~~~~ + * + * This script makes the Sphinx sidebar collapsible. + * + * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds in + * .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton used to + * collapse and expand the sidebar. + * + * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden and the + * width of the sidebar and the margin-left of the document are decreased. + * When the sidebar is expanded the opposite happens. This script saves a + * per-browser/per-session cookie used to remember the position of the sidebar + * among the pages. Once the browser is closed the cookie is deleted and the + * position reset to the default (expanded). + * + * :copyright: Copyright 2007-2011 by the Sphinx team. + * :license: BSD, see LICENSE.txt for details. + * + */ + +$(function() { + // global elements used by the functions. + // the 'sidebarbutton' element is defined as global after its + // creation, in the add_sidebar_button function + var bodywrapper = $('.bodywrapper'); + var sidebar = $('.sphinxsidebar'); + var sidebarwrapper = $('.sphinxsidebarwrapper'); + + // original margin-left of the bodywrapper and width of the sidebar + // with the sidebar expanded + var bw_margin_expanded = bodywrapper.css('margin-left'); + var ssb_width_expanded = sidebar.width(); + + // margin-left of the bodywrapper and width of the sidebar + // with the sidebar collapsed + var bw_margin_collapsed = '.8em'; + var ssb_width_collapsed = '.8em'; + + // colors used by the current theme + var dark_color = '#AAAAAA'; + var light_color = '#CCCCCC'; + + function sidebar_is_collapsed() { + return sidebarwrapper.is(':not(:visible)'); + } + + function toggle_sidebar() { + if (sidebar_is_collapsed()) + expand_sidebar(); + else + collapse_sidebar(); + } + + function collapse_sidebar() { + sidebarwrapper.hide(); + sidebar.css('width', ssb_width_collapsed); + bodywrapper.css('margin-left', bw_margin_collapsed); + sidebarbutton.css({ + 'margin-left': '0', + 'height': bodywrapper.height(), + 'border-radius': '5px' + }); + sidebarbutton.find('span').text('»'); + sidebarbutton.attr('title', _('Expand sidebar')); + document.cookie = 'sidebar=collapsed'; + } + + function expand_sidebar() { + bodywrapper.css('margin-left', bw_margin_expanded); + sidebar.css('width', ssb_width_expanded); + sidebarwrapper.show(); + sidebarbutton.css({ + 'margin-left': ssb_width_expanded-12, + 'height': bodywrapper.height(), + 'border-radius': '0 5px 5px 0' + }); + sidebarbutton.find('span').text('«'); + sidebarbutton.attr('title', _('Collapse sidebar')); + //sidebarwrapper.css({'padding-top': + // Math.max(window.pageYOffset - sidebarwrapper.offset().top, 10)}); + document.cookie = 'sidebar=expanded'; + } + + function add_sidebar_button() { + sidebarwrapper.css({ + 'float': 'left', + 'margin-right': '0', + 'width': ssb_width_expanded - 28 + }); + // create the button + sidebar.append( + '<div id="sidebarbutton"><span>«</span></div>' + ); + var sidebarbutton = $('#sidebarbutton'); + // find the height of the viewport to center the '<<' in the page + var viewport_height; + if (window.innerHeight) + viewport_height = window.innerHeight; + else + viewport_height = $(window).height(); + var sidebar_offset = sidebar.offset().top; + var sidebar_height = Math.max(bodywrapper.height(), sidebar.height()); + sidebarbutton.find('span').css({ + 'display': 'block', + 'position': 'fixed', + 'top': Math.min(viewport_height/2, sidebar_height/2 + sidebar_offset) - 10 + }); + + sidebarbutton.click(toggle_sidebar); + sidebarbutton.attr('title', _('Collapse sidebar')); + sidebarbutton.css({ + 'border-radius': '0 5px 5px 0', + 'color': '#444444', + 'background-color': '#CCCCCC', + 'font-size': '1.2em', + 'cursor': 'pointer', + 'height': sidebar_height, + 'padding-top': '1px', + 'padding-left': '1px', + 'margin-left': ssb_width_expanded - 12 + }); + + sidebarbutton.hover( + function () { + $(this).css('background-color', dark_color); + }, + function () { + $(this).css('background-color', light_color); + } + ); + } + + function set_position_from_cookie() { + if (!document.cookie) + return; + var items = document.cookie.split(';'); + for(var k=0; k<items.length; k++) { + var key_val = items[k].split('='); + var key = key_val[0]; + if (key == 'sidebar') { + var value = key_val[1]; + if ((value == 'collapsed') && (!sidebar_is_collapsed())) + collapse_sidebar(); + else if ((value == 'expanded') && (sidebar_is_collapsed())) + expand_sidebar(); + } + } + } + + add_sidebar_button(); + var sidebarbutton = $('#sidebarbutton'); + set_position_from_cookie(); +}); diff --git a/doc/source/conf.py b/doc/source/conf.py index 29f08e5..224e266 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -111,7 +111,9 @@ pngmath_latex_preamble = r"""\newcommand{\bra}[1]{\left\langle#1\right|} # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. -html_theme = 'default' +html_theme = 'kwantdoctheme' +html_theme_path = ['..'] +html_theme_options = {'collapsiblesidebar': True} html_style = 'kwant.css' # Theme options are theme-specific and customize the look and feel of a theme diff --git a/doc/templates/layout.html b/doc/templates/layout.html index e34537c..781a09f 100644 --- a/doc/templates/layout.html +++ b/doc/templates/layout.html @@ -1,9 +1,213 @@ -{% extends "!layout.html" %} +{# + This file is based on the "Master layout template for Sphinx themes". + + :copyright: Copyright 2007-2011 by the Sphinx team. + :license: BSD, see LICENSE.txt for details. + + We cannot use layout.html as provided by Sphinx because we want to set + the <html> lang attribute. +#} + {% set script_files = script_files + ["_static/togglediv.js"] %} -{% block rootrellink %} - <li><a href="http://kwant-project.org/"> - <img src="{{ pathto('_static/kwant_logo.png', 1) }}" - style="vertical-align: middle; margin-top: -4px" alt="Kwant logo"/></a> - {{ reldelim1 }}</li> - <li><a href="{{ pathto('index') }}">{{ shorttitle }}</a>{{ reldelim1 }}</li> -{% endblock %} +{% if theme_collapsiblesidebar|tobool %} +{% set script_files = script_files + ['_static/sidebar.js'] %} +{% endif %} + +{%- block doctype -%} +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +{%- endblock %} +{%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %} +{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %} +{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and + (sidebars != []) %} +{%- set url_root = pathto('', 1) %} +{# XXX necessary? #} +{%- if url_root == '#' %}{% set url_root = '' %}{% endif %} +{%- if not embedded and docstitle %} + {%- set titlesuffix = " — "|safe + docstitle|e %} +{%- else %} + {%- set titlesuffix = "" %} +{%- endif %} + +{%- macro relbar() %} + <div class="related"> + <h3>{{ _('Navigation') }}</h3> + <ul> + {%- for rellink in rellinks %} + <li class="right" {% if loop.first %}style="margin-right: 10px"{% endif %}> + <a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}" + {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a> + {%- if not loop.first %}{{ reldelim2 }}{% endif %}</li> + {%- endfor %} + {%- block rootrellink %} + <li><a href="http://kwant-project.org/"> + <img src="{{ pathto('_static/kwant_logo.png', 1) }}" + style="vertical-align: middle; margin-top: -4px" alt="Kwant logo"/></a> + {{ reldelim1 }}</li> + <li><a href="{{ pathto('index') }}">{{ shorttitle }}</a>{{ reldelim1 }}</li> + {%- endblock %} + {%- for parent in parents %} + <li><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>{{ reldelim1 }}</li> + {%- endfor %} + {%- block relbaritems %} {% endblock %} + </ul> + </div> +{%- endmacro %} + +{%- macro sidebar() %} + {%- if render_sidebar %} + <div class="sphinxsidebar"> + <div class="sphinxsidebarwrapper"> + {%- block sidebarlogo %} + {%- if logo %} + <p class="logo"><a href="{{ pathto(master_doc) }}"> + <img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/> + </a></p> + {%- endif %} + {%- endblock %} + {%- if sidebars != None %} + {#- new style sidebar: explicitly include/exclude templates #} + {%- for sidebartemplate in sidebars %} + {%- include sidebartemplate %} + {%- endfor %} + {%- else %} + {#- old style sidebars: using blocks -- should be deprecated #} + {%- block sidebartoc %} + {%- include "localtoc.html" %} + {%- endblock %} + {%- block sidebarrel %} + {%- include "relations.html" %} + {%- endblock %} + {%- block sidebarsourcelink %} + {%- include "sourcelink.html" %} + {%- endblock %} + {%- if customsidebar %} + {%- include customsidebar %} + {%- endif %} + {%- block sidebarsearch %} + {%- include "searchbox.html" %} + {%- endblock %} + {%- endif %} + </div> + </div> + {%- endif %} +{%- endmacro %} + +{%- macro script() %} + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT: '{{ url_root }}', + VERSION: '{{ release|e }}', + COLLAPSE_INDEX: false, + FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}', + HAS_SOURCE: {{ has_source|lower }} + }; + </script> + {%- for scriptfile in script_files %} + <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script> + {%- endfor %} +{%- endmacro %} + +{%- macro css() %} + <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" /> + <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" /> + {%- for cssfile in css_files %} + <link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" /> + {%- endfor %} +{%- endmacro %} + +<html xmlns="http://www.w3.org/1999/xhtml" lang="en"> + <head> + <meta http-equiv="Content-Type" content="text/html; charset={{ encoding }}" /> + {{ metatags }} + {%- block htmltitle %} + <title>{{ title|striptags|e }}{{ titlesuffix }}</title> + {%- endblock %} + {{ css() }} + {%- if not embedded %} + {{ script() }} + {%- if use_opensearch %} + <link rel="search" type="application/opensearchdescription+xml" + title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}" + href="{{ pathto('_static/opensearch.xml', 1) }}"/> + {%- endif %} + {%- if favicon %} + <link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/> + {%- endif %} + {%- endif %} +{%- block linktags %} + {%- if hasdoc('about') %} + <link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" /> + {%- endif %} + {%- if hasdoc('genindex') %} + <link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" /> + {%- endif %} + {%- if hasdoc('search') %} + <link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" /> + {%- endif %} + {%- if hasdoc('copyright') %} + <link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" /> + {%- endif %} + <link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}" /> + {%- if parents %} + <link rel="up" title="{{ parents[-1].title|striptags|e }}" href="{{ parents[-1].link|e }}" /> + {%- endif %} + {%- if next %} + <link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}" /> + {%- endif %} + {%- if prev %} + <link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" /> + {%- endif %} +{%- endblock %} +{%- block extrahead %} {% endblock %} + </head> + <body> +{%- block header %}{% endblock %} + +{%- block relbar1 %}{{ relbar() }}{% endblock %} + +{%- block content %} + {%- block sidebar1 %} {# possible location for sidebar #} {% endblock %} + + <div class="document"> + {%- block document %} + <div class="documentwrapper"> + {%- if render_sidebar %} + <div class="bodywrapper"> + {%- endif %} + <div class="body"> + {% block body %} {% endblock %} + </div> + {%- if render_sidebar %} + </div> + {%- endif %} + </div> + {%- endblock %} + + {%- block sidebar2 %}{{ sidebar() }}{% endblock %} + <div class="clearer"></div> + </div> +{%- endblock %} + +{%- block relbar2 %}{{ relbar() }}{% endblock %} + +{%- block footer %} + <div class="footer"> + {%- if show_copyright %} + {%- if hasdoc('copyright') %} + {% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %} + {%- else %} + {% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %} + {%- endif %} + {%- endif %} + {%- if last_updated %} + {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %} + {%- endif %} + {%- if show_sphinx %} + {% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %} + {%- endif %} + </div> +{%- endblock %} + </body> +</html> -- GitLab