diff options
author | Pauli Virtanen <pav@iki.fi> | 2013-05-04 01:29:11 +0300 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2013-05-04 01:29:11 +0300 |
commit | bbf1a70bc95f571b25b7e8a608f9a4a0406d922f (patch) | |
tree | abdc0439fc3ec0fe723f40487d7b11d40065552b | |
parent | d68be9a15367d9703f221e3a5a22098d8921aaa4 (diff) | |
download | scipy-sphinx-theme-bbf1a70bc95f571b25b7e8a608f9a4a0406d922f.tar.gz |
Add a theme option for hiding Sphinx's next/prev navigation links
-rw-r--r-- | README.rst | 41 | ||||
-rw-r--r-- | _theme/scipy/layout.html | 29 | ||||
-rw-r--r-- | _theme/scipy/theme.conf | 1 |
3 files changed, 45 insertions, 26 deletions
@@ -10,35 +10,40 @@ Theme options The theme takes the followin options in the `html_options` configuration variable: -``edit_link`` +- ``edit_link`` - ``True`` or ``False``. Determines if an "edit this page" link is displayed - in the left sidebar. + ``True`` or ``False``. Determines if an "edit this page" link is displayed + in the left sidebar. -``rootlinks`` +- ``rootlinks`` - List of tuples ``(url, link_name)`` to show in the beginning of the - breadcrumb list on the top left. You can override it by defining an - `edit_link` block in ``searchbox.html``. + List of tuples ``(url, link_name)`` to show in the beginning of the + breadcrumb list on the top left. You can override it by defining an + `edit_link` block in ``searchbox.html``. -``sidebar`` +- ``sidebar`` - One of ``"left"``, ``"right"``, ``"none"``. Defines where the sidebar - should appear. + One of ``"left"``, ``"right"``, ``"none"``. Defines where the sidebar + should appear. -``scipy_org_logo`` +- ``scipy_org_logo`` - ``True`` or ``False``. Whether to plaster the scipy.org logo on top. + ``True`` or ``False``. Whether to plaster the scipy.org logo on top. - You can use your own logo by overriding the :attr:`layout.html:header` - block. + You can use your own logo by overriding the :attr:`layout.html:header` + block. + +- ``navigation_links`` + + ``True`` or ``False``. Whether to display "next", "prev", "index", etc. + links. The following blocks are defined: -``layout.html:header`` +- ``layout.html:header`` - Block at the top of the page, for logo etc. + Block at the top of the page, for logo etc. -``searchbox.html:edit_link`` +- ``searchbox.html:edit_link`` - Edit link HTML code to paste in the left sidebar, if `edit_link` is enabled. + Edit link HTML code to paste in the left sidebar, if `edit_link` is enabled. diff --git a/_theme/scipy/layout.html b/_theme/scipy/layout.html index ebc331f..b5e1855 100644 --- a/_theme/scipy/layout.html +++ b/_theme/scipy/layout.html @@ -36,12 +36,12 @@ {%- macro relbar_top_right() %} <ul class="nav nav-pills pull-right"> - {%- for rellink in rellinks %} - <li class="active"> - <a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}" - {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a> - </li> - {%- endfor %} + {%- for rellink in rellinks %} + <li class="active"> + <a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}" + {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a> + </li> + {%- endfor %} </ul> {%- endmacro %} @@ -181,25 +181,38 @@ <div class="container"> <div class="main"> {%- block navbar %} + {% if theme_navigation_links or sidebar == 'left' %} <div class="row-fluid"> <div class="span12"> <div class="spc-navbar"> {{ relbar_top() }} + {% if theme_navigation_links %} {{ relbar_top_right() }} + {% endif %} </div> </div> </div> + {% endif %} {% endblock %} <div class="row-fluid"> {%- if theme_sidebar == 'left' -%} - {{ sidebar() }} - {%- endif %} + {{ sidebar() }} + {%- endif %} {%- if theme_sidebar == 'none' -%} <div class="span1"></div> <div class="span10"> {% else %} <div class="span9"> {%- endif %} + {% if not theme_navigation_links and sidebar != 'left' %} + <div class="row-fluid"> + <div class="span9"> + <div class="spc-navbar"> + {{ relbar_top() }} + </div> + </div> + </div> + {% endif %} {%- block document %} <div class="bodywrapper"> <div class="body" id="spc-section-body"> diff --git a/_theme/scipy/theme.conf b/_theme/scipy/theme.conf index bd48c4e..7cfff6c 100644 --- a/_theme/scipy/theme.conf +++ b/_theme/scipy/theme.conf @@ -8,3 +8,4 @@ edit_link = false rootlinks = [] sidebar = left scipy_org_logo = +navigation_links = true |