Commit a283c9ed authored by Julien Muchembled's avatar Julien Muchembled

Better fix of ReST transform"

This reverts commit 1b1859b9
and monkey-patch docutils instead.
parent b9ceb45e
......@@ -26,7 +26,7 @@
#
##############################################################################
import sys, types
import os, sys, types
if sys.version_info < (2, 5):
import __builtin__, imp
......@@ -108,3 +108,9 @@ if sys.version_info < (2, 7):
raise missing_ordereddict
import collections
collections.OrderedDict = OrderedDict
# Workaround bad use of getcwd() in docutils.
# Required by PortalTransforms.transforms.rest
from docutils import utils
utils.relative_path = lambda source, target: os.path.abspath(target)
......@@ -2,7 +2,6 @@ from Products.PortalTransforms.interfaces import ITransform
from zope.interface import implements
from reStructuredText import HTML
import sys
import os
class rest:
r"""Converts from reST to HTML.
......@@ -57,11 +56,9 @@ class rest:
input_encoding = kwargs.get('input_encoding', encoding)
output_encoding = kwargs.get('output_encoding', encoding)
language = kwargs.get('language', 'en')
warnings = kwargs.get('warnings', None)
rest_template = os.path.join(os.path.dirname(__file__), 'rest.template')
warnings = kwargs.get('warnings', None)
settings = {'documentclass': '',
'traceback': 1,
'template' : rest_template
}
html = HTML(orig,
report_level=2,
......
%(head_prefix)s
%(head)s
%(stylesheet)s
%(body_prefix)s
%(body_pre_docinfo)s
%(docinfo)s
%(body)s
%(body_suffix)s
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment