Replies: 2 comments 1 reply
-
It seems I can do this instead of using a string buffer: print(dwg.tostring()) It's a bit better 🙂 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hello! We have the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to print as diagram as SVG, without writing to a file.
I found the
d.render_svg()
method, but it doesn't support printing, and doesn't understandpath="-"
as "write to standard output".I also found the
to_svg(drawing, style)
method, and how to create theseDrawing
andStyle
instances thanks to thechalk.backend.svg.render
function, but this just means copy/pastingrender_svg
to removedwg.save()
and write the drawing into a string buffer instead:Obviously I'd prefer having to call just one method or function 😅 Something like
print(d.to_svg())
.Is there an easier way? Or would it need a feature request?
Beta Was this translation helpful? Give feedback.
All reactions