title: Plugin API description: Documentation on how to write PubTal plugins. PubTal plugins allow the functionality of PubTal to be expanded and customised. Currently support for new content types and new upload methods can be added using plugins.

Plugin Interface

Plugins are implemented as Python modules which are placed in either the site-packages/pubtal/plugins directory, or in a directory specified using the additional-plugins-dir configuration option. All plugins must implement a module level function called getPluginInfo() which returns a list of the functionality provided by this plugin. The list is comprised of dictionaries that describe the functionality provided by this plugin and provide additional information to PubTal about that functionality. Each dictionary in the list returned from getPluginInfo() must have a key "functionality". Legal values of for this key are currently :

Additional Content Types

In addition to the key "functionality" having a value of "content", the dictionary must also contain the following keys: The two methods defined by SitePublisher.ContentPublisher (other than the constructor) which must be implemented are: publish() and getPageContext()

Additional Upload Methods

In addition to the key "functionality" having a value of "upload-method", the dictionary must also contain the following keys: