TurboGears will automatically register Brevé as a template engine. There is nothing additional to do.
You need to set a minimum of one option in your config file:
[global] breve.root = 'myproject.templates'
Then all you need to do is prefix the path to your template with 'breve:'.
For example:
@expose ( template = 'breve:index' )
def index ( self ):
return { }
Note that unlike some other TurboGears templates, Brevé templates are all relative to breve.root. This includes references to templates from within templates (i.e. via the include and inherits directives).
@expose ( template = 'breve:index' )
def index ( self ):
return { }
TurboGears has a rather convoluted and specific initialization sequence. This makes it difficult to pass configuration options to template engines. If you find yourself unable to set a Brevé option from the configuration file, there are a couple workarounds you can try.
At the top of your controllers.py file, add the following:
from breve import Template
Template.debug = False
Template.tidy = True
You can use this method to set whatever configuration options you like.
@render ( 'breve:index?format=rss' )