[Edu-sig] Crunchy and Sphinx?

Andre Roberge andre.roberge at gmail.com
Mon Jun 22 21:18:09 CEST 2009


On Mon, Jun 22, 2009 at 3:53 PM, Jeff Elkner<jeff at elkner.net> wrote:
> Hi André!  I've spent the last month converting python educational materials
> from lore to sphinx.
>
> For the results, see:
>
> http://openbookproject.net/thinkcs/python/english2e
>
> and
>
> http://www.openbookproject.net/pybiblio/gasp/course
>

This looks great!


> The only missing feature at this point (sphinx rocks!) is support for
> crunchy.  Any thoughts on that? I didn't see any reference to
> reStructuredText or Sphinx on the crunchy site.

Crunchy can read either reStructuredText files (and transform them in
html files) or html files directly.

If you launch Crunchy, you can see it in action with the menu item:
Advanced Topic -> reStructuredText

Crunchy recognizes a few additional "rst directives".  For example,
some cut-and-paste text from taken directly from that file:
"""
We start by showing two simple Python code samples,
with no special directives,
one with a simulated interactive Python session,
the other without, so that Crunchy will perform
its magic based on your preferences.

    >>> print "Python is great!"
    Python is great!

And for the other example without a Python prompt, that
Crunchy will not know what to do with.

    print "Crunchy is pretty good too!"

We now move on to using embedded directives.

Interpreters
============

The following is an example of a borg interpreter.
If you type the above text into the box, you will see
that "answer" can be defined and then printed

.. interpreter:: interpreter
   :linenumber:

   >>> answer = 42
   >>> print answer
   42
"""

If all you're using are interpreter prompts, then the Crunchy default
should work just fine, with no additional directives.

I just loaded the page
http://www.openbookproject.net/pybiblio/gasp/course/1-intro.html,
setting this site to "trusted" (from the security item on the Crunchy
menu at the top), reloaded the page, and everything worked just fine!

It looks better if you de-select the "popups" from the preferences.

I've attached a "screen capture image" so that anyone interested can
compare with the original.  Note that the "style" (css) is the Crunchy
default which is different from that on the original website.

Cheers,
André



>
> Thanks!
>
> jeff elkenr
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screen_capture.tiff
Type: image/tiff
Size: 49136 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/edu-sig/attachments/20090622/d35f96a7/attachment-0001.tiff>


More information about the Edu-sig mailing list