Mercurial > piecrust2
annotate piecrust/formatting/textileformatter.py @ 989:8adc27285d93
bake: Big pass on bake performance.
- Reduce the amount of data passed between processes.
- Make inter-process data simple objects to make it easier to test with
alternatives to pickle.
- Make sources have the basic requirement to be able to find a content item
from an item spec (path).
- Make Hoedown the default Markdown formatter.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 19 Nov 2017 14:29:17 -0800 |
parents | f4f5685019a2 |
children |
rev | line source |
---|---|
124 | 1 from piecrust.formatting.base import Formatter |
2 | |
3 | |
4 class TextileFormatter(Formatter): | |
5 FORMAT_NAMES = ['textile', 'text'] | |
6 OUTPUT_FORMAT = 'html' | |
7 | |
8 def render(self, format_name, text): | |
423
f4f5685019a2
render: Lazily import Textile package.
Ludovic Chabant <ludovic@chabant.com>
parents:
124
diff
changeset
|
9 from textile import textile |
124 | 10 assert format_name in self.FORMAT_NAMES |
11 return textile(text) | |
12 |