116 Format ``tokensource``, an iterable of ``(tokentype, tokenstring)``
117 tuples and write it into ``outfile``.
119 For our implementation we put all lines in their own 'line group'.
129 outfile.write(
'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" '
130 '"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/'
142 if counter % counter_step == 0:
143 outfile.write(
'<text x="%s" y="%s" %s text-anchor="end">%s</text>' %
148 outfile.write(
'<text x="%s" y="%s" xml:space="preserve">' % (line_x, y))
149 for ttype, value
in tokensource:
151 tspan = style
and '<tspan' + style +
'>' or ''
152 tspanend = tspan
and '</tspan>' or ''
157 for part
in parts[:-1]:
161 if self.
linenos and counter % counter_step == 0:
162 outfile.write(
'<text x="%s" y="%s" text-anchor="end" %s>%s</text>' %
166 outfile.write(
'<text x="%s" y="%s" ' 'xml:space="preserve">' % (line_x,y))