Re: patterns for using sphinx with the Zope Toolkit?

Benji York <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
On Sat, Jan 2, 2010 at 8:44 PM, Chris McDonough <[email protected]> wrote:
> Python samples in Sphinx docs are generated like so:
>
> .. code-block:: python
>
>     a == 1
>
> I did a bit of fooling around with Manuel, because I wanted to make sure that
> the code blocks in my documentation actually worked, but I wound up in a place
> where I use Manuel to check only the *syntax* of a subets of the Sphinx code
> blocks I use.  It will do this right out of the box if you read the Manuel docs
>  But I couldn't really figure out a way to do the moral equivalent of this:
>
> .. code-block:: python
>
>    a == 1
>
> .. manuel-expect:
>
>    True

Sphinx and Manuel both support interpreter blocks, so the normal
approach will work:

    >>> a == 1
    True

Occasionally you want to show some code but hide the assertions about
the effects of the code.  You can do that by putting the tests in a reST
comment after the code.

.. code-block:: python

    a = Foo()
    b = a.bar()

.. make sure the above worked correctly

    >>> b.baz
    42
-- 
Benji York
_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.