Version 4 (modified by Noah Kantrowitz, 12 years ago) (diff)

Add API guide

Modular styles manager


This plugin simplifies the process of distributing and deploying themes and styles.

API Basics

Most themes should simply subclass ThemeBase (in themeengine.api). This works similarly to WikiMacroBase, use you theme name followed by "Theme" as the class name, and put the description as the class's docstring. There are a number of class variable you can define to affect how your theme will be loaded, if any is set to True, it will take on a default value (see below):

The path to the header template. (Defaults to templates/header.cs)
The path to the footer template. (Defaults to templates/footer.cs)
The path to the CSS template. (Defaults to templates/css.cs)
The folder containing the static content. (Defaults to htdocs)
The path to the screenshot file. (Defaults to htdocs/screenshot.png)
A dict containing the data normally in [header_logo] in trac.ini. (Defaults to {})

Packaging A Theme

For lack of a decent guide right now, check out some of the existing themes.

One request, when taking screenshots please make them of the first wiki page, preferably with its default content. Also please make them match the aspect ration of 640x400.

Bugs/Feature Requests

Existing bugs and feature requests for ThemeEnginePlugin are here.

If you have any issues, create a new ticket.


Download the zipped source from [download:themeengineplugin here].


You can check out ThemeEnginePlugin from here using Subversion, or browse the source with Trac.


To enable:

themeengine.* = enabled

To specify a theme:

theme = <Name>

Recent Changes

16075 by rjollos on 2016-12-11 09:48:17
2.2.4: Improve test discovery
16074 by rjollos on 2016-12-11 09:14:02
2.2.4: Run tests using python test
15031 by rjollos on 2015-11-03 20:26:39
2.2.3dev: Correct issue numbers in changelog


Author: coderanger

Attachments (3)

Download all attachments as: .zip