Hi,
I am trying to get the output of a stream into a string. For example
the highlight
function outputs the result to an IO object, so I can open a file and write to it. I can also get it printed using stdout.
However, I just need to store it in a string. Can someone please let me know how to accomplish this.
using Highlights
highlight(stdout, MIME("text/html"), "a = 1+2", Lexers.JuliaLexer)
# I need to store the result in my_string however I cannot figure out how to get this to work
my_string = highlight(something_here, MIME("text/html"), "a = 1+2", Lexers.JuliaLexer)