Skip to content

Commit

Permalink
Sphinx HTML: Collapse l4 in ToC in the sidebar
Browse files Browse the repository at this point in the history
Also,
- resize the width of the document vs sidebar;
- decrease padding in the sidebar;
- mark current l2 in ToC in the sidebar.
  • Loading branch information
tsitkov committed Jun 1, 2012
1 parent 627ed34 commit 5befd06
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 13 deletions.
36 changes: 27 additions & 9 deletions doc/rst_source/_static/kerb.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,18 @@
*
*/
div.body {
padding-right: 2em;
padding-right: .5em;
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: white;
border-bottom: 3px solid #2e3436;
Expand Down Expand Up @@ -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;
Expand All @@ -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 {
Expand Down
8 changes: 5 additions & 3 deletions doc/rst_source/_templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -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]) }}"
Expand All @@ -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>
Expand All @@ -50,13 +52,13 @@ <h1><a href="{{ pathto (master_doc) }}"
</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/>
Expand Down
4 changes: 3 additions & 1 deletion doc/rst_source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@
# 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 = []
Expand Down

0 comments on commit 5befd06

Please sign in to comment.