AirspeedTemplate

Description

AirspeedTemplate is a MoinMoin macro for including an airspeed template in a page.

Airspeed is a Python clone of the Velocity template engine.

Download & Release Notes

Download

Release Version

Moin Version

Release Notes

(withdrawn)

1.0

1.8, 1.7

First release

AirspeedTemplate.py

1.1

1.8, 1.7

Bugfix release, fix crash on stand-alone server

Usage

Macro parameters:

Standard variables and functions added to the context:

Example

Contents of plugins/action/fruit_action.py:

   1 from MoinMoin.Page import Page
   2     def execute(pagename, request):
   3         request.template_context = {'apples': 5, 'bananas': '<two>'}
   4         return Page(request, pagename).send_page()

Contents of plugins/airspeed_templates/fruit.html:

<b>We have $apples apples and $escape($bananas) bananas.</b>

Source text of FruitStatus wiki page:

Here is the status of our fruit supply:<<BR>>
<<AirspeedTemplate(fruit.html)>>

Result of http://localhost/wiki/FruitStatus?action=fruit_action :

Copyright 2009 by David Handy, Handy Software and Publishing

License

AirspeedTemplate is released under the Simplified BSD License.

Bugs

Report them here

Discussion

Security

The AirspeedTemplate macro does not allow users to put arbitrary HTML into a page. However, poorly designed templates can still have cross-site scripting bugs anyway. Use the $escape() function in your templates to quote any data that might contain unwanted HTML.

The AirspeedTemplate macro will only use template files found in a sub-directory of your wiki's plugins directory. The name of this sub-directory is configurable with an optional macro parameter (see description above) and defaults to "airspeed_templates".

David Handy 19 Jan 2008

MoinMoin: MacroMarket/AirspeedTemplate (last edited 2009-02-05 23:04:10 by DavidHandy)