Skip to content

Commit

Permalink
Add new theme "agogo", by Andi Albrecht.
Browse files Browse the repository at this point in the history
  • Loading branch information
birkenfeld committed Nov 16, 2009
1 parent 4f03d86 commit 03aaed9
Show file tree
Hide file tree
Showing 19 changed files with 497 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGES
@@ -1,6 +1,8 @@
Release 1.0 (in development)
============================

* Added new HTML theme ``agogo``, created by Andi Albrecht.

* Added ``html_output_encoding`` config value.

* #200: Added ``Sphinx.add_stylesheet()``.
Expand Down
7 changes: 7 additions & 0 deletions doc/_templates/layout.html
@@ -1,5 +1,12 @@
{% extends "!layout.html" %}

{% block extrahead %}
<style type="text/css">
table.right { float: right; margin-left: 20px; }
table.right td { border: 1px solid #ccc; }
</style>
{% endblock %}

{% block rootrellink %}
<li><a href="{{ pathto('index') }}">Sphinx home</a>&nbsp;|&nbsp;</li>
<li><a href="{{ pathto('contents') }}">Documentation</a>&raquo;</li>
Expand Down
Binary file added doc/themes/agogo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/themes/default.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/themes/fullsize/agogo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/themes/fullsize/default.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/themes/fullsize/scrolls.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/themes/fullsize/sphinxdoc.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/themes/fullsize/traditional.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/themes/scrolls.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/themes/sphinxdoc.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/themes/traditional.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 47 additions & 1 deletion doc/theming.rst
Expand Up @@ -52,7 +52,33 @@ file :file:`blue.zip`, you can put it right in the directory containing
Builtin themes
--------------

Sphinx comes with a selection of themes to choose from:
.. cssclass:: right

+-----------------------------------------+
| **Theme overview** |
+--------------------+--------------------+
| |default| | |sphinxdoc| |
| | |
| *default* | *sphinxdoc* |
+--------------------+--------------------+
| |scrolls| | |agogo| |
| | |
| *scrolls* | *agogo* |
+--------------------+--------------------+
| |traditional| | |
| | |
| *traditional* | |
+--------------------+--------------------+

.. |default| image:: themes/default.png
.. |sphinxdoc| image:: themes/sphinxdoc.png
.. |scrolls| image:: themes/scrolls.png
.. |agogo| image:: themes/agogo.png
.. |traditional| image:: themes/traditional.png

Sphinx comes with a selection of themes to choose from.

These themes are:

* **basic** -- This is a basically unstyled layout used as the base for the
*default* and *sphinxdoc* themes, and usable as the base for custom themes as
Expand Down Expand Up @@ -103,6 +129,26 @@ Sphinx comes with a selection of themes to choose from:
* **traditional** -- A theme resembling the old Python documentation. There are
currently no options beyond *nosidebar*.

* **agogo** -- A theme created by Andi Albrecht. The following options are
supported:

- **bodyfont** (CSS font family): Font for normal text.
- **headerfont** (CSS font family): Font for headings.
- **pagewidth** (CSS length): Width of the page content, default 70em.
- **documentwidth** (CSS length): Width of the document (without sidebar),
default 50em.
- **sidebarwidth** (CSS length): Width of the sidebar, default 20em.
- **bgcolor** (CSS color): Background color.
- **headerbg** (CSS value for "background"): background for the header area,
default a grayish gradient.
- **footerbg** (CSS value for "background"): background for the footer area,
default a light gray gradient.
- **linkcolor** (CSS color): Body link color.
- **headercolor1**, **headercolor2** (CSS color): colors for <h1> and <h2>
headings.
- **headerlinkcolor** (CSS color): Color for the backreference link in
headings.


Creating themes
---------------
Expand Down
81 changes: 81 additions & 0 deletions sphinx/themes/agogo/layout.html
@@ -0,0 +1,81 @@
{% extends "basic/layout.html" %}

{% block header %}
<div class="header-wrapper">
<div class="header">
{%- if logo %}
<p class="logo"><a href="{{ pathto(master_doc) }}">
<img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/>
</a></p>
{%- endif %}
{%- block headertitle %}
<h1><a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a></h1>
{%- endblock %}
<div class="rel">
{%- for rellink in rellinks %}
<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">
<div class="content">
<div class="document">
{%- block document %}
{{ super() }}
{%- endblock %}
</div>
<div class="sidebar">
{%- block sidebartoc %}
<h3>{{ _('Contents') }}</h3>
{{ toctree() }}
{%- endblock %}
{%- block sidebarsearch %}
<h3 style="margin-top: 1.5em;">{{ _('Search') }}</h3>
<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>
<p class="searchtip" style="font-size: 90%">
{{ _('Enter search terms or a module, class or function name.') }}
</p>
{%- endblock %}
</div>
<div class="clearer"></div>
</div>
</div>
{% endblock %}

{% block footer %}
<div class="footer-wrapper">
<div class="footer">
<div class="left">
{%- for rellink in rellinks %}
<a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags }}"
{{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
{%- if not loop.last %}{{ reldelim2 }}{% endif %}
{%- endfor %}
{%- if show_source and has_source and sourcename %}
<br/>
<a href="{{ pathto('_sources/' + sourcename, true)|e }}"
rel="nofollow">{{ _('Show Source') }}</a>
{%- endif %}
</div>

<div class="right">
{{ super() }}
</div>
<div class="clearer"></div>
</div>
</div>
{% endblock %}

{% block relbar1 %}{% endblock %}
{% block relbar2 %}{% endblock %}

0 comments on commit 03aaed9

Please sign in to comment.