view piecrust/formatting/markdownformatter.py @ 4:7dc71c2dc9a8

Added requirements file for `pip`.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 11 Aug 2014 22:36:36 -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)