[CMF-checkins] CVS: CMF - Document.py:1.17

tseaver@digicool.com tseaver@digicool.com
Tue, 29 May 2001 22:53:18 -0400 (EDT)


Update of /cvs-repository/CMF/CMFDefault
In directory korak.digicool.com:/tmp/cvs-serv9800/CMFDefault

Modified Files:
	Document.py 
Log Message:


 - Moved STX handling ('_format_stx') out of CMFDefault.Document into
   CMFCore.utils & made it a free function (it was only a faux method
   anyway).

 - Created new document class in order to override search patterns
   for 'doc_href';  STXNG inexplicably doesn't include underscore in
   the reference portion (Tracker #281).

 - Added CMFCore.FSSTXMethod, to allow creation of "skin" methods from
   StructuredText files.  Note that these skin methods are not yet
   customizable.



--- Updated File Document.py in package CMF --
--- Document.py	2001/05/29 14:55:15	1.16
+++ Document.py	2001/05/30 02:53:17	1.17
@@ -95,6 +95,7 @@
 
 from Products.CMFCore import CMFCorePermissions
 from Products.CMFCore.WorkflowCore import WorkflowAction, afterCreate
+from Products.CMFCore.utils import _format_stx
 from utils import parseHeadersBody, SimpleHTMLParser, bodyfinder, _dtmldir
 
 factory_type_information = ( { 'id'             : 'Document'
@@ -242,20 +243,10 @@
                 cooked = body = bodyfound.group('bodycontent')
         else:
             headers, body = parseHeadersBody(text, headers)
-            cooked = self._format_stx(text=body)
+            cooked = _format_stx(text=body)
 
         return headers, body, cooked, format
             
-    def _format_stx(self, text, level=1):
-        """ Renders structured text """
-        st = StructuredText.Basic(text) # Creates the basic DOM
-        if not st:                      # If it's an empty object
-            return ""                   # return now or have errors!
-
-        doc = StructuredText.DocumentWithImages(st)
-        html = CMFHtmlWithImages(doc, level)
-        return html
-
     security.declareProtected(CMFCorePermissions.View, 'SearchableText')
     def SearchableText(self):
         """ Used by the catalog for basic full text indexing """