Modified the Sphinx HTML page layout
authorZhanna Tsitkov <tsitkova@mit.edu>
Wed, 23 May 2012 19:59:24 +0000 (15:59 -0400)
committerZhanna Tsitkov <tsitkova@mit.edu>
Wed, 23 May 2012 19:59:24 +0000 (15:59 -0400)
1. The Feedback button is moved into the footer;
2. The default page/doc width are set to 960px;

doc/rst_source/_static/kerb.css
doc/rst_source/_templates/layout.html
doc/rst_source/conf.py

index 93c1340fe7f5c5147741cef3f17b70d8180f9495..d23df9df0dada4ff33cf75f43e9d243fe00d9a05 100644 (file)
@@ -8,18 +8,36 @@
 div.body {
   padding-right: 2em;
   text-align: left;
+  overflow-x: hidden;
 }
 
 /* Page layout */
 
+div.header, div.content, div.footer {
+  width: 70%;
+  margin-left: auto;
+  margin-right: auto;
+}
+
+
 div.header-wrapper {
-  background: #59121e;
+  background: white;
   border-bottom: 3px solid #2e3436;
-  border-top: 3px solid #2e3436;
+  border-top: 13px solid #59121e;
 }
 
 /* Header */
 
+div.header {
+  padding-top: 10px;
+  padding-bottom: 10px;
+}
+
+div.header h1 {
+  font-family: "Georgia", "Times New Roman", serif,  black;
+  font-weight: normal;
+}
+
 div.header div.right a {
   color: #fcaf3e;
   letter-spacing: .1em;
@@ -29,6 +47,14 @@ div.header div.right a {
 
 /* Content */
 
+div.document {
+  width: 70%;
+  float: left;
+  background-color: white;
+  padding-top: 20px;
+  padding-bottom: 20px;
+}
+
 div.document div.section h1 {
   margin-bottom: 20px;
   padding: 1px;
@@ -44,6 +70,14 @@ div.document div.section dl {
 
 /* Sidebar */
 
+div.sidebar {
+  float: right;
+  font-size: .9em;
+  padding-top: 0px;
+  width: 20%;
+  background-color: #4c0f1a;
+}
+
 div.sidebar ul {
   list-style-type: none;
   padding: 1px;
index 438c8dfcd2924598554cce12e9c796a8b30f4eee..3d7c2ba7b253e91b675df0361741cd50f3483fb2 100644 (file)
@@ -4,46 +4,80 @@
                   [('index', 'Full Table of Contents', 'C', 'Contents')] %}
 {% set css_files = css_files + ["_static/kerb.css"] %}
 
-{% block relbar1 %}
-   <div class="header-wrapper">
-       <div class="header" >
-           <div class="right" >
-              <a href="mailto:krb5-bugs@mit.edu?subject=Documentation__{{ title }}";>
-                  feedback </a>
-           </div>
-           <br/>
-       </div>
-   </div>
+{% macro feedback_rellinks() %}
+    <div class="footer-wrapper" >
+        <div class="footer"  >
+            <div class="left" >
+                {%- for rellink in rellinks|reverse %}
+                    <a href="{{ pathto(rellink[0]) }}"
+                    title="{{ rellink[1]|striptags }}"
+                    {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
+                    {{ reldelim2 }}
+                {%- endfor %}
+                {%- block rootrellink %}
+                    <a href="mailto:krb5-bugs@mit.edu?subject=Documentation__{{ title }}";>feedback</a>
+                {%- endblock %}
+            </div>
+        </div>
+    </div>
+{%- endmacro %}
+
+{% block footer %} {{ feedback_rellinks() }}{% endblock %}
+
+{% block header %}
+    <div class="header-wrapper">
+        <div class="header" style="padding-bottom: 0px;">
+            {% if logo %}
+                <p class="logo">
+                    <a href="http://kerberos.org"> <img class="logo"
+                    src="{{ pathto('_static/' + logo, 1) }}" alt="Logo" /></a>
+                </p>
+            {% endif %}
+            {% block headertitle %}
+                <h1><a href="{{ pathto (master_doc) }}"
+                style="color: #59121e; font-size: 120%;
+                padding-top: 10px;">{{ shorttitle|e }}</a><h1>
+            {% endblock %}
+            <div class="rel" style="font-size: 60%; padding-bottom: 0px;" >
+                {%- for rellink in rellinks|reverse %}
+                    <a href="{{ pathto(rellink[0]) }}"
+                    title="{{ rellink[1]|striptags }}"
+                    {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
+                    {%- if not loop.last %}{{ reldelim2 }}{% endif %}
+                {%- endfor %}
+            </div>
+        </div>
+    </div>
 {% endblock %}
 
+
 {%- block content %}
-    <div class="content-wrapper" style="width: 97%;">
+    <div class="content-wrapper" ;">
         <div class="content">
-           {%- block sidebar1 %}
-               <div class="sidebar"
+            {%- block sidebar1 %}
+                <div class="sidebar"
                     style="float: right; margin: 5px; background: #F9F9F9">
-                  <h2>{{ _('On this page') }} </h2>
-                  {{ toc }}
-                  <br/>
-                  <h2>{{ _('Table of contents') }}</h2>
-                  {{ toctree(collapse=true, maxdepth=-1, titles_only=true) }}
-                  <br/>
-                  <h4><a href="{{ pathto('index') }}">Full Table of Contents</a></h4>
-                  <h4>{{ _('Search') }}</h4>
-                  <form class="search" action="{{ pathto('search') }}" method="get">
-                      <input type="text" name="q" size="18" />
-                      <input type="submit" value="{{ _('Go') }}" />
-                      <input type="hidden" name="check_keywords" value="yes" />
-                      <input type="hidden" name="area" value="default" />
-                  </form>
-               </div>
-           {%- endblock %}
-           <div class="document">
-              {%- block document %}
-                  {{ super() }}
-              {%- endblock %}
-           </div>
-           <div class="clearer"></div>
+                    <h2>{{ _('On this page') }} </h2>
+                    {{ toc }}
+                    <br/>
+                    <h2>{{ _('Table of contents') }}</h2>
+                    {{ toctree(collapse=true, maxdepth=-1, titles_only=true) }}
+                    <br/>
+                    <h4><a href="{{ pathto('index') }}">Full Table of Contents
+                    </a></h4>
+                    <h4>{{ _('Search') }}</h4>
+                    <form class="search" action="{{ pathto('search') }}" method="get">
+                        <input type="text" name="q" size="18" />
+                        <input type="submit" value="{{ _('Go') }}" />
+                        <input type="hidden" name="check_keywords" value="yes" />
+                        <input type="hidden" name="area" value="default" />
+                    </form>
+                </div>
+            {%- endblock %}
+            <div class="document">
+                 {%- block document %}{{ super() }}{%- endblock %}
+            </div>
+            <div class="clearer" ></div>
         </div>
     </div>
 {% endblock %}
index 45d6d546e1ecdd8a84a68ec14e0b241de18b1a00..9331cbd022d0b0b6ceb9f966b8d30efbdf3a73c0 100644 (file)
@@ -98,7 +98,7 @@ html_theme = 'agogo'
 # 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
 # documentation.
-html_theme_options = { "headerbg":  "#59121e", "linkcolor": "#a63019", "footerbg":  "#59121e", "bgcolor": "#59121e" }
+html_theme_options = { "linkcolor": "#a63019", "footerbg":  "#59121e", "bgcolor": "#59121e", "documentwidth": "910px", "pagewidth": "960px" }
 
 # Add any paths that contain custom themes here, relative to this directory.
 #html_theme_path = []