.. -*- restructuredtext -*-

=============================
Shoebot extension for Sphinx
=============================

:author: Stuart Axon <stuaxo2@yahoo.com>


About
=====

This extensions allows rendering of shoebot bots using python_. 

This extensions adds the ``shoebot`` directive that will replace the shoebot
commands with the image of the graphics bot. 


Quick Example
-------------

This source::

    .. shoebot::

        size(100, 100)
        background(.8)
        fill(.3)
        rect(10, 10, 35, 35)
        # see how roundness affects the shape
        rect(55, 10, 35, 35, 0.3)
        rect(10, 55, 35, 35, 0.7)
        rect(55, 55, 35, 35, 1)


will render an image of a rounded rectangle.



Options
-------

Size - change the size of the rendered bot.

    .. shoebot::
        :snapshot:
        :size: 400, 400

        # On a 400x400 canvas draw some rectangles
        def draw():
            nofill()
            strokewidth(20)
            stroke(0.75, 0., 0)
            for i in xrange(380, 0, -40):
                rect(200-i, 200-i, i*2, i*2)

Used to change the canvas size without including 'size' in the 
script itself.

Requirements
------------

* shoebot_.

Shoebot_ should be installed and be in the current python environment.


Installing
----------

Install the module::

  $ python setup.py install



Enabling the extension in Sphinx_
---------------------------------

Just add ``sphinxcontrib.shoebot`` to the list of extensions in the ``conf.py``
file. For example::

    extensions = ['sphinxcontrib.shoebot']



Bugs / Limitations
------------------

1. Sphinx warns:  image file not readable.

The extension should output the images to another folder and point to them.



2. HTML output only supported at present.


