Module: theme

Theme support

Creating themes for Apydia is fairly easy if you know how to use Genshi (and it's limited XInclude implementation). If you don't, take a look at the bundled "elixir"- and "apydia"-themes to get an idea.

Each theme must have a theme.ini-file with one or more of the following options in it's [theme]-section:

Option Description
title The name of the project for which documention is generated.
inherits The parent theme the current theme will inherit. You might want to set this to default and modify the default theme. You can omit it, if you prefer, and create all templates and CSS from scratch.
description Short description about the theme. This is currently not used at all.
pygments_style The identifier of the Pygments style to use for syntax highlighting.
pygments_style_css Custom filename for the CSS-file generated by Pygments. If left out it will default to the value of pygments_style appended by -pygments.css.
resources Whitespace separated list for resources to be copied. May contain wildcards (see Python's glob-module for details). Apydia will try to locate the specified files relative to the theme's base directory, then the parent theme's directory and so forth.

Example:

[theme]
title = Apydia
inherits = default
description = "API Reference Theme for Apydia"
pygments_style = apydia
pygments_style_css = css/pygments.css
resources = css/default.css css/apydia.css images/*

Classes

InheritanceError

Exception to be raised when there's any problem with inheritance. Currently InheritanceErrors will only be raised if a theme is configured to inherit from itself or from one of it's descendants.

Theme

The Theme-class represents and loads themes. It also knows where the theme's and it parent theme's resources can be found.

ThemeNotFoundError

A ThemeNotFoundError will be raised if the specified theme is not available.