Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

Examples

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki

Show how application code turns console markup into syscall-backed stdout/stderr lines using Console.Format and the split stream modules.

Console.FormatLine("[green]ok[/] **built** in 12ms");

FormatLine renders with ShouldStyle() (same predicate as ShouldEmitAnsi()), then calls System.Output.WriteLine. When color is stripped, output is plain text without bracket tags interpreted as color.

string plain = Console.Format.Markdown.RenderPlain("[red]ignored[/]");
string styled = Console.Format.Markdown.RenderStyled("[red]alert[/]");

Use RenderPlain for logs and redirected stdout; use RenderStyled or Format when building strings that will be gated before write.

string line = Console.Format.Markdown.RenderStyled(
"[blue]**Error:**[/] file not found"
);
System.Output.WriteLine(line);

Inner ** spans compose with outer bracket color via Ansi.StyleChain (see flow and algorithm).

Golden coverage: FormatMarkdownTests.bd, FormatAttributesTests.bd, AnsiStyleChainTests.bd under compiler/corelib/beskid_corelib/tests/corelib_tests/src/console/.