okfn / sphinx-theme-okfn

Standard Open Knowledge Foundation sphinx theme resembling that on http://okfn.org/
12 stars 7 forks source link

A bootstrap-based theme for Sphinx Documentation generator developed for use at the Open Knowledge Foundation (but usuable by anyone!).

Theme Options

Configuring the sidebar

Use the standard sphinx sidebars setup: http://sphinx.pocoo.org/config.html#confval-html\_sidebars

E.g. to have the global ToC there just add globaltoc.html to the list. To have local table of contents (for current page) add localtoc.html to the list.

Configuring the Footer

Override the footer.html template.

Configuring the Top Bar

You can add navigation links (and other material) to the top bar by overriding the navbar-nav.html template. This material will fit into the bootstrap topbar after the main brand link on the left. An example navbar-nav would be:

<ul class="nav">
  <li><a href="https://github.com/okfn/sphinx-theme-okfn/blob/master/">my link</a></li>
</ul>

How to Use

Imagine you have a sphinx project with layout like:

source
  conf.py
{other-dirs ...}  

You would do:

git submodule add git://github.com/okfn/sphinx-theme-okfn.git source/_themes/sphinx-theme-okfn
# then commit ...
git commit -m "Adding submodule for sphinx-theme-okfn"

Then in conf.py you would config like:

sys.path.append(os.path.abspath('_themes'))
html_theme_path = ['_themes']
html_theme = 'sphinx-theme-okfn'
html_theme_options = {
        'logo_icon': ...
        'google_analytics_id': ...
    }

License

Copyright (c) 2012 Open Knowledge Foundation

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.