Skip to content

Commit

Permalink
Close #6729: HTML theme: agogo theme now supports rightsidebar option
Browse files Browse the repository at this point in the history
  • Loading branch information
tk0miya committed Oct 14, 2019
1 parent b060ec9 commit a950df1
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGES
Expand Up @@ -18,6 +18,7 @@ Features added

* #6707: C++, support bit-fields.
* #267: html: Eliminate prompt characters of doctest block from copyable text
* #6729: html theme: agogo theme now supports ``rightsidebar`` option

Bugs fixed
----------
Expand Down
2 changes: 2 additions & 0 deletions doc/usage/theming.rst
Expand Up @@ -237,6 +237,8 @@ These themes are:
- **documentwidth** (CSS length): Width of the document (without sidebar),
default 50em.
- **sidebarwidth** (CSS length): Width of the sidebar, default 20em.
- **rightsidebar** (true or false): Put the sidebar on the right side.
Defaults to ``True``.
- **bgcolor** (CSS color): Background color.
- **headerbg** (CSS value for "background"): background for the header area,
default a grayish gradient.
Expand Down
29 changes: 20 additions & 9 deletions sphinx/themes/agogo/layout.html
Expand Up @@ -33,15 +33,7 @@
</div>
{% endblock %}

{% block content %}
<div class="content-wrapper">
<div class="content">
<div class="document">
{%- block document %}
{{ super() }}
{%- endblock %}
</div>
<div class="sidebar">
{%- macro agogo_sidebar() %}
{%- block sidebartoc %}
<h3>{{ _('Table of Contents') }}</h3>
{{ toctree() }}
Expand All @@ -55,7 +47,26 @@ <h3 style="margin-top: 1.5em;">{{ _('Search') }}</h3>
</form>
</div>
{%- endblock %}
{% endmacro %}

{% block content %}
<div class="content-wrapper">
<div class="content">
{%- if not theme_rightsidebar|tobool %}
<div class="sidebar">
{{ agogo_sidebar() }}
</div>
{%- endif %}
<div class="document">
{%- block document %}
{{ super() }}
{%- endblock %}
</div>
{%- if theme_rightsidebar|tobool %}
<div class="sidebar">
{{ agogo_sidebar() }}
</div>
{%- endif %}
<div class="clearer"></div>
</div>
</div>
Expand Down
8 changes: 8 additions & 0 deletions sphinx/themes/agogo/static/agogo.css_t
Expand Up @@ -175,7 +175,11 @@ div.document {
}

div.body {
{%- if theme_rightsidebar|tobool %}
padding-right: 2em;
{%- else %}
padding-left: 2em;
{% endif %}
text-align: {{ theme_textalign }};
}

Expand Down Expand Up @@ -270,7 +274,11 @@ div.document ol {

div.sidebar {
width: {{ theme_sidebarwidth|todim }};
{%- if theme_rightsidebar|tobool %}
float: right;
{%- else %}
float: left;
{%- endif %}
font-size: .9em;
}

Expand Down
1 change: 1 addition & 0 deletions sphinx/themes/agogo/theme.conf
Expand Up @@ -8,6 +8,7 @@ bodyfont = "Verdana", Arial, sans-serif
headerfont = "Georgia", "Times New Roman", serif
pagewidth = 70em
documentwidth = 50em
rightsidebar = true
sidebarwidth = 20em
bgcolor = #eeeeec
headerbg = #555573 url(bgtop.png) top left repeat-x
Expand Down

0 comments on commit a950df1

Please sign in to comment.