From: David G. <go...@py...> - 2004-02-15 16:38:28
|
Radim Novotný wrote: > I'm using reStructuredText with HTML writer output. I'd like to > render horizontally centered image without any text around it. How > can I do it, please? The way you're doing it is correct. > The second question is about .. class:: (or image :class:, > respectively). When I define class 'bordered' (1px border around > image), RST output is: class="bordered bordered". Why? I don't know. Perhaps it was a bug. It's doesn't happen with the latest code. > For example (asterixes are RST delimiter from other text): > > *************************************************** > Lorem ipsum dolor sit amet, consectetuer adipiscing elit. > Nullam in sem. Cras eget lorem. > > .. image:: http://www.lipsum.org/images/lorem.gif > :class: bordered > :align: center > > Nulla et sem a erat posuere pellentesque. > Nulla id sem a enim volutpat semper. Sed vitae leo. > > ***************************************************** > Is rendered as > > <div class="document"> > <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam > in sem. Cras eget lorem.</p> > <p><img align="center" alt="Lorem Ipsum" class="bordered bordered" > src="http://www.lipsum.org/images/lorem.gif" /></p> <p>Nulla et sem > a erat posuere pellentesque. Nulla id sem a enim volutpat > semper. Sed vitae leo.</p> > </div> > > I think, I need the second paragraph to be 'align="center"' or to > have some specific 'centered' class, which I can define in > stylesheet. With the latest Docutils code, your example text is processed to HTML as: <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam in sem. Cras eget lorem.</p> <p align="center"><img align="center" alt="http://www.lipsum.org/images/lorem.gif" class="bordered" src="http://www.lipsum.org/images/lorem.gif" /></p> <p>Nulla et sem a erat posuere pellentesque. Nulla id sem a enim volutpat semper. Sed vitae leo.</p> So the solution seems to be, please get the latest Docutils code. -- David Goodger http://python.net/~goodger For hire: http://python.net/~goodger/cv |