Mercurial > hg > contenttransformer
diff contenttransformer/transformers.py @ 0:29805d442afc
initial commit of contenttransformer; still in the stub stage
author | k0s <k0scist@gmail.com> |
---|---|
date | Mon, 11 Jan 2010 11:32:24 -0500 |
parents | |
children | 1e2c475015d8 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/contenttransformer/transformers.py Mon Jan 11 11:32:24 2010 -0500 @@ -0,0 +1,23 @@ +import docutils.core +from webob import Response + +class Graphviz(object): + def __init__(self, content): + """create a Graphviz object""" + + def __call__(self, environ, start_response): + """return a WSGI response""" + + +class RestructuredText(object): + settings = { 'report_level': 5 } + + def __init__(self, content): + """template: genshi(?) template to use (???)""" + self.html = docutils.core.publish_string(content, + writer_name='html', + settings_overrides=self.settings) + + def __call__(self, environ, start_response): + """return a WSGI response""" + return Response(content_type='text/html', body=self.html)