Leandro Lucarella, el 30 de junio a las 00:16 me escribiste:
> Leandro Lucarella, el 28 de junio a las 02:18 me escribiste:
> > 
> > David Goodger, el 27 de junio a las 17:52 me escribiste:
> > > On Fri, Jun 26, 2009 at 20:37, Leandro Lucarella<[email protected]> wrote:
> > > > Sounds fair, but I need to know what writer will be used when doing the
> > > > transformation. Is that possible? How? I can't find any code doing that.
> > > 
> > > See the Filter transform here:
> > > http://docutils.sourceforge.net/docutils/transforms/components.py
> > > 
> > > Within a transform, self.document.transformer.components['writer']
> > > will give you the writer object.
> > 
> > This is really nice, but... (there's always a but =) Sphinx seems to be
> > using a SphinxDummyWriter when transforming, no matter what the real
> > output format really is =/
> > 
> > All seems to be shaping out good using the Transform approach in the
> > docutils side, but I'm getting some Sphinx-specific problems. Besides the
> > dummy writer, I don't know if I can (and how) access to the builder when
> > implementing the Directive and Transform (I need to get some Sphinx
> > options from there)
> > 
> > I think I will need some Sphinx guidance to move on...
> 
> I'm hate to be insistent, but I'm really stuck with this. Does anyone know
> how can I get what writer will be used (and the Sphinx builder object)
> when doing a Docutils Transform?

Ok, I finally got away with what I wanted by using a Sphinx event
(doctree-read) to render the image. The directive just created an image
node and add to it aafigure-specific information. When the event is
triggered, the doctree is traversed looking for image nodes with aafigure
information attached and process that nodes, rendering the images (and
applying other transformations if needed).

This worked out great and not the aafig extension get rendered as
a regular image, supporting all image options.

I hope this information can be useful...

I'll update the mscgen extension and the official graphviz extension to
use this scheme in the future.

You can peek at the code at:
http://bitbucket.org/birkenfeld/sphinx-contrib/src/tip/aafig/sphinxcontrib/aafig.py

or download the dev package:
http://pypi.python.org/pypi/sphinxcontrib-aafig/0.3dev-20090702

A new release is comming soon, so testing is welcome =)

-- 
Leandro Lucarella (luca) | Blog colectivo: http://www.mazziblog.com.ar/blog/
----------------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------------
El techo de mi cuarto lleno de estrellas

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to