[Zope-Checkins] CVS: Zope/lib/python/HelpSys - HelpTopic.py:1.17.24.1

Jeffrey P Shell jeffrey@cuemedia.com
Wed, 13 Nov 2002 16:56:09 -0500


Update of /cvs-repository/Zope/lib/python/HelpSys
In directory cvs.zope.org:/tmp/cvs-serv12456

Modified Files:
      Tag: ajung-restructuredtext-integration-branch
	HelpTopic.py 
Log Message:
Added new ``ReSTTopic`` class, which uses the DTML "restructured-text"
formatter to render reStructuredText [1]_ help topics.

.. [1] http://docutils.sourceforge.net/rst.html


=== Zope/lib/python/HelpSys/HelpTopic.py 1.17 => 1.17.24.1 ===
--- Zope/lib/python/HelpSys/HelpTopic.py:1.17	Wed Aug 14 17:34:42 2002
+++ Zope/lib/python/HelpSys/HelpTopic.py	Wed Nov 13 16:56:08 2002
@@ -227,6 +227,28 @@
 <dtml-var standard_html_footer>""")
 
 
+class ReSTTopic(TextTopic):
+    """
+    A reStructuredText [1]_ topic.  Similar to STXTopic, it uses a
+    simle DTML construct to render its contents - this time using the
+    *reStructuredText* language.
+
+    .. [1] reStructuredText
+       (http://docutils.sourceforge.net/rst.html)
+    """
+    index_html = None
+
+    def __call__(self, REQUEST=None):
+        """ Renders the ReST Help Topic """
+        self._check_for_update()
+        return self.htmlfile(self, REQUEST)
+
+    htmlfile = HTML("""\
+<dtml-var standard_html_header>
+<dtml-var obj fmt="restructured-text">
+<dtml-var standard_html_footer>""")
+    
+
 class ImageTopic(HelpTopic):
     """
     A image Help Topic. Holds an ImageFile object.