Console.Format targets terminal styling, not a document renderer.
Examples
Platform spec article
Examples
Spec standingStandard
-
Only the tested markup subset is normative.
Context
Decision
Rule Detail Scope Tested sigils and markdown subset only Non-goal Full CommonMark compliance Consequences
New syntax requires tests before Standard promotion.
Verification anchors
FormatMarkdownTests.bd;Format/Scan.bd. -
Bracket color tags map to fixed palette names.
Context
Arbitrary RGB in markup v1 would bypass capability downgrade rules.
Decision
Rule Detail Tags [red]-style names map to fixed paletteRGB Not supported inside markup v1 Consequences
Authors use Ansi builders for advanced color outside markup.
Verification anchors
FormatAttributesTests.bd.
- Contracts and edge cases Markup parsing rules and rendering requirements.
- Design model Markup syntax layers and render pipeline overview.
- Examples Console markup usage for CLI output.
- Flow and algorithm Recursive descent rendering for console markup.
- Verification and traceability Markup golden tests and module anchors.
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
| Section id | Required | Found |
|---|---|---|
what-this-feature-specifies | yes | yes |
implementation-anchors | yes | yes |
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
Purpose
Section titled “Purpose”Show how application code turns console markup into syscall-backed stdout/stderr lines using Console.Format and the split stream modules.
Canonical references
Section titled “Canonical references”- Feature hub: Console markup format
- Parsing rules: contracts and edge cases (FMT-001–FMT-005)
- Escape tables: ANSI escape model / design model
- Write surface: Console I/O streams / examples
Detailed behavior
Section titled “Detailed behavior”One-line styled output
Section titled “One-line styled output”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.
Plain vs styled render entry points
Section titled “Plain vs styled render entry points”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.
Nested styles
Section titled “Nested styles”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).
Verification
Section titled “Verification”Golden coverage: FormatMarkdownTests.bd, FormatAttributesTests.bd, AnsiStyleChainTests.bd under compiler/corelib/beskid_corelib/tests/corelib_tests/src/console/.
Related topics
Section titled “Related topics”- Console capabilities — when
ShouldStyle()is false - Console controls — full-screen widgets that may call
Formatfor labels