Table of Contents

Class MarkdownStyle

Namespace
SharpConsoleUI.Configuration
Assembly
SharpConsoleUI.dll

Styling for Markdown rendered via the [markdown] markup tag. Markdown is structural: emphasis and headings emit colorless tags (inheriting the surrounding scope), so only "chrome" components (code, quotes, links, table borders) carry colors here. This is intentionally NOT part of the global theme — the parser is static and theme-agnostic. Override per-build via WithMarkdownStyle or globally via Default.

public record MarkdownStyle : IEquatable<MarkdownStyle>
Inheritance
MarkdownStyle
Implements
Inherited Members
Extension Methods

Properties

BorderColor

Color for table border (box-drawing) characters.

public Color BorderColor { get; init; }

Property Value

Color

BulletGlyph

Glyph used for bullet list items. Default: .

public string BulletGlyph { get; init; }

Property Value

string

CodeBackground

Background color for inline code and code blocks.

public Color CodeBackground { get; init; }

Property Value

Color

CodeForeground

Foreground color for inline code and code blocks.

public Color CodeForeground { get; init; }

Property Value

Color

CodeHighlighters

Per-style language→highlighter overrides for fenced code blocks. Checked BEFORE the global SyntaxHighlighters registry. Empty by default (falls through to the registry, then to a flat shaded block).

public IReadOnlyDictionary<string, ISyntaxHighlighter> CodeHighlighters { get; init; }

Property Value

IReadOnlyDictionary<string, ISyntaxHighlighter>

Default

The process-wide default style used by the [markdown] tag when no per-control override is supplied AND no active theme is reachable. Assigning this marks it as an explicit app choice (see SharpConsoleUI.Configuration.MarkdownStyle.DefaultExplicitlySet), so it then wins over the theme-derived default.

public static MarkdownStyle Default { get; set; }

Property Value

MarkdownStyle

H1Color

Optional color for H1. null = colorless (structural weight only).

public Color? H1Color { get; init; }

Property Value

Color?

H2Color

Optional color for H2. null = colorless.

public Color? H2Color { get; init; }

Property Value

Color?

H3Color

Optional color for H3. null = colorless.

public Color? H3Color { get; init; }

Property Value

Color?

H4Color

Optional color for H4. null = colorless.

public Color? H4Color { get; init; }

Property Value

Color?

H5Color

Optional color for H5. null = colorless.

public Color? H5Color { get; init; }

Property Value

Color?

H6Color

Optional color for H6. null = colorless.

public Color? H6Color { get; init; }

Property Value

Color?

LinkColor

Color for link text.

public Color LinkColor { get; init; }

Property Value

Color

ListIndent

Spaces of indentation per nested list level. Default: 2.

public int ListIndent { get; init; }

Property Value

int

QuoteColor

Color for blockquote text and the quote bar glyph.

public Color QuoteColor { get; init; }

Property Value

Color

QuoteGlyph

Glyph used for the blockquote vertical bar. Default: .

public string QuoteGlyph { get; init; }

Property Value

string

Methods

FromTheme(ITheme)

Derives a Markdown style from the active theme so the [markdown] tag follows the theme: headings use the theme accent (descending prominence), code/quote/border derive from the theme surfaces. Non-color settings (glyphs, indent, highlighters) keep the built-in defaults. Used as the default when no explicit style is set.

public static MarkdownStyle FromTheme(ITheme theme)

Parameters

theme ITheme

The active theme to derive chrome colors from.

Returns

MarkdownStyle