view piecrust/formatting/textileformatter.py @ 1003:7a1903ede496

Added tag 2.1.2 for changeset 6f32a6dc2306
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 21 Nov 2017 11:00:06 -0800
parents f4f5685019a2
children
line wrap: on
line source

from piecrust.formatting.base import Formatter


class TextileFormatter(Formatter):
    FORMAT_NAMES = ['textile', 'text']
    OUTPUT_FORMAT = 'html'

    def render(self, format_name, text):
        from textile import textile
        assert format_name in self.FORMAT_NAMES
        return textile(text)