Re: [Epydoc-devel] Coloured syntax directive [was Re: Planning for 3.0]
Brought to you by:
edloper
|
From: Edward L. <ed...@gr...> - 2007-02-07 02:07:59
|
Daniele Varrazzo wrote:
> I am trying to add a directive to parse a docstring such as the following,
> generating a box with colored syntax:: [...]
I believe this should do what you want:
def run(self):
self.assert_has_content()
text = '\n'.join(self.content)
node = docutils.nodes.doctest_block(text, text)
return [ node ]
(The class doctest_block inherits its constructor from FixedTextElement.
The first arg of the constructor gives the rawsource, and the second
gives the text content.)
You should only be using nested_parse if the directive contains
something that is formatted using rst syntax.
-Edward
|