[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Consistent formating long descriptions as input data

* Andreas Tille <tillea@rki.de>, 2009-04-26, 22:55:
I tried to format a single paragraph according to some URL I found but thie does not really work without a header[3].
[3] http://code.activestate.com/recipes/193890/
That's quite overcomplicated. The following code should do the thing:

from docutils.core import publish_parts

def reSTify(string):
    return publish_parts(string, writer_name='html')['body']

Jakub Wilk

Reply to: