1
# Authors: Felix Wiemann
2
# Contact: Felix_Wiemann@ososo.de
3
# Revision: $Revision: 3909 $
4
# Date: $Date: 2005-09-26 20:17:31 +0200 (Mon, 26 Sep 2005) $
5
# Copyright: This module has been placed in the public domain.
8
Auxiliary transforms mainly to be used by Writer components.
10
This module is called "writer_aux" because otherwise there would be
11
conflicting imports like this one::
13
from docutils import writers
14
from docutils.transforms import writers
17
__docformat__ = 'reStructuredText'
19
from docutils import nodes, utils
20
from docutils.transforms import Transform
23
class Compound(Transform):
26
Flatten all compound paragraphs. For example, transform ::
36
<literal_block classes="continued">
37
<paragraph classes="continued">
40
default_priority = 810
43
for compound in self.document.traverse(nodes.compound):
45
for child in compound:
47
if not isinstance(child, nodes.Invisible):
50
child['classes'].append('continued')
51
# Substitute children for compound.
52
compound.replace_self(compound[:])