Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 8b32d38f0094104a5fd847636983daa8 > files > 12

zope-doc-2.11.2-11mdv2010.0.i586.rpm

Integration of reStructuredText (reST) in Zope:

Zope 2.7 or higher integrates reST as part of the Python
docutils package. The syntax of reST is defined under

    http://docutils.sf.net/spec/rst/introduction.html


Usage inside DTML:

     <dtml-var rest-document fmt="restructured-text">


Usage inside ZPT:

    <span tal:content="structure python: modules['Products.PythonScripts.standard'].restructured_test(rest_txt)" />


Usage inside PythonScripts:

    from Products.PythonScripts.standard import restructured_text

    rendered_html = restructured_test(rest_txt)
    return rendered_html


Usage inside Zope products:

    from reStructuredText import HTML
    rendered_html = HTML(rest_txt)
    ...

Character set issues:

   reST processes the reST document internally using unicode. A reST
   document is converted using Pythons default encoding to unicode and
   converted back from unicode to the default encoding on the output side.
   This means you must ensure that Python default encoding is properly.

   You can customize the default encoding by creating a file sitecustomize.py
   somewhere in yout PYTHONPATH:

      import sys
      sys.setdefaultencoding("iso-8859-1")



This version of Zope also includes the ZReST product written by Richard Jones.
ZRest is a standalone Zope product to handle reStructuredText documents.