Mercurial > piecrust2
view piecrust/formatting/smartypantsformatter.py @ 147:ab6e7e0e9d44
Pass date information to routing when building URLs.
This is so that URLs with dates in them can be built even when the date
information is not coming from the source metadata, but from the page's
config.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 29 Nov 2014 21:00:44 -0800 |
parents | fdb08d986384 |
children | 370e74941d32 |
line wrap: on
line source
import smartypants from piecrust.formatting.base import Formatter, PRIORITY_LAST class SmartyPantsFormatter(Formatter): FORMAT_NAMES = ['html'] OUTPUT_FORMAT = 'html' def __init__(self): super(SmartyPantsFormatter, self).__init__() self.priority = PRIORITY_LAST def initialize(self, app): super(SmartyPantsFormatter, self).initialize(app) self.enabled = ( app.config.get('smartypants/enable') or app.config.get('smartypants/enabled')) def render(self, format_name, txt): assert format_name == 'html' return smartypants.smartypants(txt)