krb5 commit: Sphinx HTML: Collapse l4 in ToC in the sidebar

Zhanna A Tsitkova tsitkova at MIT.EDU
Fri Jun 1 13:17:19 EDT 2012


https://github.com/krb5/krb5/commit/5befd068e13d671490e6b0ac868d1cd23ffa9496
commit 5befd068e13d671490e6b0ac868d1cd23ffa9496
Author: Zhanna Tsitkov <tsitkova at mit.edu>
Date:   Fri Jun 1 13:19:29 2012 -0400

    Sphinx HTML: Collapse l4 in ToC in the sidebar
    
    Also,
    - resize the width of the document vs sidebar;
    - decrease padding in the sidebar;
    - mark current l2 in ToC in the sidebar.

 doc/rst_source/_static/kerb.css       |   36 ++++++++++++++++++++++++--------
 doc/rst_source/_templates/layout.html |    8 ++++--
 doc/rst_source/conf.py                |    4 ++-
 3 files changed, 35 insertions(+), 13 deletions(-)

diff --git a/doc/rst_source/_static/kerb.css b/doc/rst_source/_static/kerb.css
index d23df9d..45f1b6e 100644
--- a/doc/rst_source/_static/kerb.css
+++ b/doc/rst_source/_static/kerb.css
@@ -6,7 +6,7 @@
  *
  */
 div.body {
-  padding-right: 2em;
+  padding-right: .5em;
   text-align: left;
   overflow-x: hidden;
 }
@@ -14,12 +14,10 @@ div.body {
 /* Page layout */
 
 div.header, div.content, div.footer {
-  width: 70%;
   margin-left: auto;
   margin-right: auto;
 }
 
-
 div.header-wrapper {
   background: white;
   border-bottom: 3px solid #2e3436;
@@ -48,8 +46,9 @@ div.header div.right a {
 /* Content */
 
 div.document {
-  width: 70%;
+  width: 80%;
   float: left;
+  margin: 0;
   background-color: white;
   padding-top: 20px;
   padding-bottom: 20px;
@@ -73,22 +72,41 @@ div.document div.section dl {
 div.sidebar {
   float: right;
   font-size: .9em;
-  padding-top: 0px;
   width: 20%;
-  background-color: #4c0f1a;
+  margin: 0;
+  padding: 0;
+  background-color: white;
 }
 
 div.sidebar ul {
   list-style-type: none;
-  padding: 1px;
-  margin-left: 1em;
+  margin-left: .5em;
+}
+
+div.sidebar li.toctree-l1 a {
+  margin-left: .5em;
+}
+
+div.sidebar li.toctree-l2 a {
+  margin-left: .5em;
+}
+
+div.sidebar li.toctree-l3 a {
+  margin-left: .5em;
+}
+
+div.sidebar li.toctree-l2.current a {
+  border-right: 2px solid #fcaf3e  !important;
 }
 
 div.sidebar li.toctree-l3.current a {
-  border-right: 5px solid #fcaf3e;
   font-weight: bold;
 }
 
+div.sidebar li.toctree-l4 a {
+  display: none;
+}
+
 /* Other body styles */
 
 dt:target, .highlighted {
diff --git a/doc/rst_source/_templates/layout.html b/doc/rst_source/_templates/layout.html
index 3d7c2ba..b2a9222 100644
--- a/doc/rst_source/_templates/layout.html
+++ b/doc/rst_source/_templates/layout.html
@@ -4,9 +4,10 @@
                   [('index', 'Full Table of Contents', 'C', 'Contents')] %}
 {% set css_files = css_files + ["_static/kerb.css"] %}
 
+{# Add a "feedback" button to the footer #}
 {% macro feedback_rellinks() %}
     <div class="footer-wrapper" >
-        <div class="footer"  >
+        <div class="footer" >
             <div class="left" >
                 {%- for rellink in rellinks|reverse %}
                     <a href="{{ pathto(rellink[0]) }}"
@@ -29,6 +30,7 @@
         <div class="header" style="padding-bottom: 0px;">
             {% if logo %}
                 <p class="logo">
+                    {# Link logo to kerberos.org #}
                     <a href="http://kerberos.org"> <img class="logo"
                     src="{{ pathto('_static/' + logo, 1) }}" alt="Logo" /></a>
                 </p>
@@ -50,13 +52,13 @@
     </div>
 {% endblock %}
 
-
 {%- block content %}
     <div class="content-wrapper" ;">
         <div class="content">
+            {%- block sidebar2 %} {%- endblock %}
             {%- block sidebar1 %}
                 <div class="sidebar"
-                    style="float: right; margin: 5px; background: #F9F9F9">
+                    style="float: right; background: #F9F9F9">
                     <h2>{{ _('On this page') }} </h2>
                     {{ toc }}
                     <br/>
diff --git a/doc/rst_source/conf.py b/doc/rst_source/conf.py
index 9331cbd..31b4892 100644
--- a/doc/rst_source/conf.py
+++ b/doc/rst_source/conf.py
@@ -98,7 +98,9 @@ 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 = { "linkcolor": "#a63019", "footerbg":  "#59121e", "bgcolor": "#59121e", "documentwidth": "910px", "pagewidth": "960px" }
+html_theme_options = { "linkcolor": "#a63019", "footerbg":  "#59121e",
+                       "bgcolor": "#59121e", "documentwidth": "900px",
+                       "pagewidth": "960px", "sidebarwidth": "40px" }
 
 # Add any paths that contain custom themes here, relative to this directory.
 #html_theme_path = []


More information about the cvs-krb5 mailing list