Back to index

plone3  3.1.7
st.py
Go to the documentation of this file.
00001 from StructuredText.StructuredText import HTML
00002 from Products.PortalTransforms.interfaces import itransform
00003 
00004 DEFAULT_STX_LEVEL = 2
00005 STX_LEVEL = DEFAULT_STX_LEVEL
00006 
00007 class st:
00008     __implements__ = itransform
00009 
00010     __name__ = "st_to_html"
00011     inputs   = ("text/structured",)
00012     output   = "text/html"
00013 
00014     def name(self):
00015         return self.__name__
00016 
00017     def convert(self, orig, data, level=None, **kwargs):
00018         if level is None:
00019             level = STX_LEVEL
00020         data.setData(HTML(orig, level=level, header=0))
00021         return data
00022 
00023 def register():
00024     return st()