So I've got a reStructuredText document which includes fields:
:param foo: set this to do magic
and I want to turn the rST into html, with special treatment of param
(and other) fields.
Turning rST into html can be done with docutils.core.publish_parts
as suggested here, but obviously without control of how fields are output. Or I can use docutils.core.publish_doctree
as suggested here to get the pseudo-XML, and presumably (fairly tediously) modify that, but I don't see how I can control how this is translated to html.
I can see there's a HTMLTranslator
class in docutils.writers.html4css1.__init__.py
, but I surely can't have to modify this just to control how fields are output? I'm hoping there's some sort of template system somewhere which controls how XML is translated to html ...