[Doc-SIG] Unindented blocks in reStructuredText
goodger at python.org
Sun Oct 21 15:55:07 CEST 2007
> I'd like my rst documents to include snippets of Python that are
> pasteable into the interpreter.
> Am I missing an option here?
You can use
.. include:: source.py
combined with the :start-after: and :end-before: options.
> I find it surprising that a tool written in and for Python
reST is written in Python but is not specifically for Python. It's a
general-purpose tool. (Doctest blocks are an exception to the rule; call them a
wart if you like, an early mistake.)
> would make it hard to include valid Python code. To
> clarify my expectations, I'd expect something (approximately) like
> this to work:
> This text demonstrates creation of a class::
> class Foo(object):
> (The ".." could mark the end of the block.)
It's an interesting idea, worth considering. It isn't currently implemented though.
David Goodger <http://python.net/~goodger>
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 249 bytes
Desc: OpenPGP digital signature
Url : http://mail.python.org/pipermail/doc-sig/attachments/20071021/144a7748/attachment.pgp
More information about the Doc-SIG