errata icon indicating copy to clipboard operation
errata copied to clipboard

Rendering to a string?

Open andrzejolszak opened this issue 3 years ago • 1 comments

I was looking for a way to render Reports to a string (accepting drawbacks like losing the colors, monospace font requirement for display, etc.), and it seems that this would require implementing a special IAnsiConsole.

Do this sound viable, or would expect problems? Or maybe there is already a way to do this that I just haven't found?

Thanks!

andrzejolszak avatar Jan 21 '22 10:01 andrzejolszak

@andrzejolszak Should be possible to do. You have two options here, either implement a custom IAnsiConsole, or implement a IAnsiConsoleRecorder and use the record functionality of IAnsiConsole. There should already be a text recorder in Spectre.Console that should do what you need.

Will add an example once I'm at a computer.

patriksvensson avatar Jan 21 '22 11:01 patriksvensson