ReStructuredText
Cliff Wells
cliff at develix.com
Tue Aug 15 03:56:48 EDT 2006
On Tue, 2006-08-15 at 09:35 +0200, Sybren Stuvel wrote:
> Cliff Wells enlightened us with:
> > Why doesn't the above turn out an enumerated list?
>
> You have to indent the list:
>
> >>> from docutils.core import publish_parts
> >>> t = '''
> ...
> ... 1. this is a test
> ... #. this is another line
> ... #. oh, screw it!
> ... '''
> >>> publish_parts(t, writer_name='html')['body']
> u'<blockquote>\n<ol class="arabic simple">\n<li>this is a
> test</li>\n<li>this is another line</li>\n<li>oh, screw
> it!</li>\n</ol>\n</blockquote>\n'
Thanks for the response. Must be a bug in my version:
Python 2.4.2 (#1, Feb 13 2006, 15:24:20)
[GCC 3.3.6 (Gentoo 3.3.6, ssp-3.3.6-1.0, pie-8.7.8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from docutils.core import publish_parts
>>> t = '''
...
... 1. this is a test
... #. this is another line
... #. oh, screw it!
...
... '''
>>> publish_parts ( t, writer_name = 'html' ) [ 'body' ]
u'<blockquote>\n1. this is a test\n#. this is another line\n#. oh, screw
it!</blockquote>\n'
Guess I'll stick to HTML.
Regards,
Cliff
--
More information about the Python-list
mailing list