Sorry, noob question: Can I use this for Console.Program?
Closed this issue · 2 comments
I'm just a self study programming noob that wants to take my string userMessage, pepper a few words with color for readability, and then send that string from it's declaration/creation in LibraryB to Console.Program to be printed on screen, with the keywords having color, using markdown.
am I in the right place? I currently get this done by passing list of String,Color pairs but keeping it all in text would be more ideal.
I don't want to create the message in Console.Program because I don't want the color nor the text to be copy/pasted on other potential UI's or dependent on the UI.
For this you would need to take the AST and format it for console using ANSI color escapes instead of HTML that the library supports by default.
You might be able to use the simple debug formatter as a starting point for this: https://github.com/Knagis/CommonMark.NET/blob/master/CommonMark/Formatters/Printer.cs