Integrating CSS and Restructured Text

Those who are not familiar restructured text mayThrough deployment solely of the class
initially bemoan it's lack of power and flexibility when"float-right-360" to the figure directive below, it is
compared to XHTML, but as often the case in life,possible to add a polaroid effect to a photograph in
initial appearances can be deceiving.the following manner:
Although the use of CSS for styling and presentationAs reStructuredText:
is "best practice" in XHTML, it is not yet mandatory,.. figure:: /images/the_moon.jpg
which allows anyone with knowledge of such:alt: the moon
"deprecated" tags as "align=center" or "font", to:figclass: float-right-360
illegally wreck havoc with your beautiful CMS-basedThe moon during a lunar-eclipse. Pretty!
site.To produce the following image and caption:the moon
Outside of a mandatory 2 month course in basicSee result at: A Blog about Plone
XHTML and CSS, one solution which desperateWhich is achieved with the following css:
webmasters have often deployed is to force site.float-right-360 {position: relative;float: right;text-align:
editors and contributors to work with WYSIWYGleft;background-image:
editors configured to strip out any and all illegal tags.url(polaroid_360_270.png);background-repeat:
Not only is this a somewhat draconian solution, andno-repeat;margin: 10px 0 10px 20px;padding: 1px 8px
immensely frustrating from a user point of view, but8px 1px;border: none;
it still doesn't bring your site any closer to being}
beautifully or correctly formatted. Just not illegally so..float-right-360 img {border: #fff 7px
And don't get me started on tables...solid;border-bottom: #fff 36px solid;width:
Restructured text on the other hand forces247px;height: 308px;
compliance to XHTML best practise precisely because}
it is not XHTML. By allowing users to work in an.float-right-360 p.caption {position: absolute;font:
environment much closer to the simple text notepadnormal 11px/13px Arial, Helvetica, sans-serif
which almost everybody is familiar with, and without!important;;color: #000;margin: 0;padding: 0 10px 0
a single (more often than not forgotten) tag in sight,0;top: 321px;left: 10px;
the simplicity of ReST leaves the site contributor the}
concentrate on content, as God would have intendedNote there is one limitation to this effect--the image
it, and takes care of the parsing of said content intoused must be exactly 308px H by 247px W,
strict XHTML for them.because there simply aren't enough "hooks" inside the
But that's not all. Presentation is still possible viafigure directive to deploy the necessary number of
CSS--also as God intends it--yet much to the relief ofbackground images to allow scaling.
the site designer and webmaster--outside of theAs a work around to this limitation, one could create
control of a user whose obsession with "beautifying"a variety of classes for pre-determined image sizes
one little plant can be to the detriment of theand orientations, which would also have the added
wellbeing of the entire garden.benefit of forcing your users to stick to creating
And not just the presentation of your basicimages in sizes complimentary to the overall site
paragraph and heading tags, but, watching closely,design.
the ReST figure directive, which in combination with aWhich raises another sore point about CMS's which
little CSS jiggery-pokery detailed below is capable ofdon't employ image-sizing engines--but that would be
deploying some quite remarkable effects.another topic...
The Polaroid Effect