[Doc-SIG] Making reST more useable with HTML templates
Fri, 5 Jul 2002 01:09:00 +0200
David Goodger (firstname.lastname@example.org) wrote:
> Simon Budig wrote:
> <meta>), body_prefix (</head><body>), body (page contents), and
> body_suffix (</body></html). These are all lists of strings. I'll
> expose these in the Writer class. Beyond that it's up to you.
> Please don't feel that you have to use html4css1.py. It's just one
> way of producing HTML. You can write your own, or subclass it and add
> in your customizations.
With my python knowledge coming mainly from 1.5.x I am not sure if I got
the idea behind the packages correctly. Could somebody point me to a
resource, why it is a good idea to have different classes with the same
name (there are writers.Writer, html4css1.Writer and docutils_xml.Writer
in docutils, why aren't they named after what they actually write?)
I most probably miss something here since this technique is also used in
the "encodings" package from the core python.
> > Also the class names used in some <span>'s should be customizeable,
> > maybe a dictionary with a native <--> target mapping of the class
> > names.
> I don't follow. Examples?
In processed reST output you find class names like
'<a class="reference"' or '<p class="field-name">'. If you want to
include reST output as part of a larger website these class names might
clash with the names in the system-wide css file. It might be useful to
be able to replace the class names used by reST with the class names
used in the rest of the site, so that reST does not output the stuff
above but '<a class="link"' instead.
I am not sure how important this is, alternatively you could also adjust
the CSS file. But it seems nicer to me to be able to control the output
of reST instead of having to adjust the rest of your framework to the
needs of reST. Hmm.