view piecrust/formatting/markdownformatter.py @ 18:0170f449f924

Slightly better exception throwing in the processing pipeline.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 18 Aug 2014 16:53:26 -0700
parents f485ba500df3
children c95c90c82263
line wrap: on
line source

from markdown import markdown
from piecrust.formatting.base import Formatter


class MarkdownFormatter(Formatter):
    FORMAT_NAMES = ['markdown', 'mdown', 'md']
    OUTPUT_FORMAT = 'html'

    def render(self, format_name, txt):
        return markdown(txt)