[IMP] doc: support disabling sidebar

This commit is contained in:
Xavier Morel 2015-02-03 15:45:38 +01:00
parent 2a2cbfc5ae
commit 2140ead305
3 changed files with 27 additions and 3 deletions

View File

@ -26,7 +26,7 @@
{%- endblock -%}
{%- block content -%}
<div class="document-super {% if meta is defined %}{{ meta.classes }}{% endif %}">
<div class="document-super {% if meta is defined %}{{ meta.classes }}{% endif %} {% if render_sidebar %}with-sidebar{% endif %}">
{{ super() }}
</div>
{%- endblock -%}
@ -34,6 +34,7 @@
{# sidebar to the left, except sidebar1 is *outside* div.document where
sidebar2 is inside, so inject sidebar into document block #}
{%- block document -%}
{%- if render_sidebar -%}
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
{{ toctree(maxdepth=4, collapse=False, includehidden=True,
@ -45,6 +46,7 @@
{% endif %}
</div>
</div>
{%- endif -%}
{{ super() }}
{%- endblock -%}
{%- block sidebar1 -%}{%- endblock -%}

View File

@ -6247,6 +6247,18 @@ body {
}
@media (min-width: 992px) {
.documentwrapper {
float: left;
width: 100%;
}
}
.with-sidebar .documentwrapper {
position: relative;
min-height: 1px;
padding-left: 15px;
padding-right: 15px;
}
@media (min-width: 992px) {
.with-sidebar .documentwrapper {
float: left;
width: 75%;
}
@ -6611,6 +6623,9 @@ div.section > h2 {
padding-top: 20px;
margin-top: 0;
}
.body {
position: relative;
}
.body > .section > .section {
margin-bottom: 60px;
}

View File

@ -37,6 +37,9 @@ body {
}
.documentwrapper {
.make-md-column(12);
}
.with-sidebar .documentwrapper {
.make-md-column(9);
}
.sphinxsidebar {
@ -403,8 +406,12 @@ div.section > h2 {
margin-top: 0;
}
// ~docs-section
.body > .section > .section {
margin-bottom: 60px;
.body {
// otherwise main section right column content may not be visible
position: relative;
> .section > .section {
margin-bottom: 60px;
}
}
.literal:extend(code) {}