Mercurial > piecrust2
diff piecrust/formatting/textileformatter.py @ 124:f49fcf9448df
Add Textile formatter.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Fri, 14 Nov 2014 22:44:59 +0100 |
parents | |
children | f4f5685019a2 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/piecrust/formatting/textileformatter.py Fri Nov 14 22:44:59 2014 +0100 @@ -0,0 +1,12 @@ +from textile import textile +from piecrust.formatting.base import Formatter + + +class TextileFormatter(Formatter): + FORMAT_NAMES = ['textile', 'text'] + OUTPUT_FORMAT = 'html' + + def render(self, format_name, text): + assert format_name in self.FORMAT_NAMES + return textile(text) +